diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5cd51ac3..65f96171 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,30 @@ version: 2 updates: -- package-ecosystem: gomod - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 5 -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 5 + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" + update-types: + - minor + - patch + labels: [dependencies] + commit-message: + prefix: "Dependencies:" + schedule: + interval: daily + - package-ecosystem: gomod + directory: / + groups: + gomod: + patterns: + - "*" + update-types: + - minor + - patch + labels: [dependencies] + commit-message: + prefix: "Dependencies:" + schedule: + interval: daily diff --git a/.gitignore b/.gitignore index 6d13dae4..78e56875 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.dll *.exe .DS_Store -.vscode example.tf terraform.tfplan terraform.tfstate diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index 0e958795..00000000 --- a/scripts/build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -set -e -cd `dirname $0` -cd .. - -# This script builds executables for multiple platforms and architectures -# it is used by the CI system to output releases. When testing locally it shouldn't be required -# unless you wish to share a build with someone on a different platform -platforms=("linux/amd64" "windows/amd64" "windows/386" "darwin/amd64" "linux/386" "linux/arm") - -for platform in "${platforms[@]}" -do - platform_split=(${platform//\// }) - GOOS=${platform_split[0]} - GOARCH=${platform_split[1]} - CGO_ENABLED=0 - output_name='./bin/terraform-provider-kubectl-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then - output_name+='.exe' - fi - echo "Building for $GOOS $GOARCH..." - - GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED go build -a -installsuffix cgo -o $output_name - - if [ $? -ne 0 ]; then - echo 'An error has occurred! Aborting the script execution...' - exit 1 - fi -done - -echo "Completed builds, for output see ./bin" diff --git a/scripts/docker-compose.yaml b/scripts/docker-compose.yaml deleted file mode 100644 index 2ea26db2..00000000 --- a/scripts/docker-compose.yaml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3' -services: - server: - image: rancher/k3s:v1.20.7-k3s1 - command: server --disable-agent --tls-san 172.17.0.1 - environment: - - K3S_CLUSTER_SECRET=somethingtotallyrandom - - K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml - - K3S_KUBECONFIG_MODE=666 - volumes: - - ${TRAVIS_BUILD_DIR:-..}/scripts:/output - ports: - - 6443:6443 - - node: - image: rancher/k3s:v1.20.7-k3s1 - tmpfs: - - /run - - /var/run - privileged: true - environment: - - K3S_URL=https://server:6443 - - K3S_CLUSTER_SECRET=somethingtotallyrandom - - registry: - image: registry:2 - ports: - - 5000:5000 diff --git a/scripts/errcheck.sh b/scripts/errcheck.sh old mode 100755 new mode 100644 diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh old mode 100755 new mode 100644 diff --git a/scripts/gogetcookie.sh b/scripts/gogetcookie.sh old mode 100755 new mode 100644 index 79059deb..31a0d558 --- a/scripts/gogetcookie.sh +++ b/scripts/gogetcookie.sh @@ -5,4 +5,4 @@ git config --global http.cookiefile ~/.gitcookies tr , \\t <<\__END__ >>~/.gitcookies go.googlesource.com,FALSE,/,TRUE,2147483647,o,git-admin.hashicorptest.com=1/5dMSZVNdQscVq3on5V38iBrG9sP2TYRlbj3TDMJHKEvoBxl_QW-zl-L7a8lk-FU- -__END__ \ No newline at end of file +__END__ diff --git a/scripts/registries.yaml b/scripts/registries.yaml deleted file mode 100644 index 21b79df0..00000000 --- a/scripts/registries.yaml +++ /dev/null @@ -1,4 +0,0 @@ -mirrors: - "registry:5000": - endpoint: - - http://registry:5000 diff --git a/scripts/start-k3s.sh b/scripts/start-k3s.sh deleted file mode 100755 index 88e3ed16..00000000 --- a/scripts/start-k3s.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd ${DIR} - -export KUBECONFIG="${DIR}/kubeconfig.yaml" -export COMPOSE_PROJECT_NAME=k3s - -echo "--> Tearing down k3s in docker-compose" -docker compose down -v &>/dev/null || true -rm -rf ${KUBECONFIG} -sync; sync; - -echo "--> Starting k3s in docker-compose" -docker compose up -d --build - -echo "--> Allow insecure access to registry" -docker exec k3s-node-1 /bin/sh -c 'mkdir -p /etc/rancher/k3s' -docker cp "${DIR}/registries.yaml" k3s-node-1:/etc/rancher/k3s/registries.yaml - -echo "--> Wait for k3s kubeconfig file to exist" -while [ ! -s "${KUBECONFIG}" ] || [ ! -f "${KUBECONFIG}" ]; do sleep 1; done -while ! grep "127.0.0.1" "${KUBECONFIG}" &>/dev/null; do sleep 1; done - -HOST_IP="127.0.0.1" -if [ -f /.dockerenv ]; then - HOST_IP="127.0.0.1" -fi - -echo "--> Update IP of server to match host ip ${HOST_IP}" -kubectl config set-cluster default --server=https://${HOST_IP}:6443 --kubeconfig ${KUBECONFIG} - -TIMEOUT=120 -INTERVAL=5 -echo "> Waiting for kubectl to make a successful connection to k3s (retrying every ${INTERVAL}s for ${TIMEOUT}s)" -TIMER_START=$SECONDS -COMMAND_RESULT="" -limit=$(( ${TIMEOUT} / ${INTERVAL} )) -count=0 -while : ; do - printf "." - - COMMAND_RESULT=$((kubectl get nodes --kubeconfig ${KUBECONFIG} -o json 2>/dev/null || true) | jq '.items | length') - [[ "${COMMAND_RESULT}" -gt 0 ]] && printf "\n" && break - - if [[ "${count}" -ge "${limit}" ]]; then - printf "\n[!] Timeout waiting for connection\n" >&2 - exit 1 - fi - - sleep ${INTERVAL} - count=$[$count+1] -done - -TIMER_DURATION=$(( SECONDS - TIMER_START )) - -# restart the node to make sure the registries configuration has been picked up -docker restart k3s-node-1 - -echo "> Connection established to k3s in ${TIMER_DURATION}s" diff --git a/scripts/stop-k3s.sh b/scripts/stop-k3s.sh deleted file mode 100755 index 7aaba4ad..00000000 --- a/scripts/stop-k3s.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd ${DIR} - -export COMPOSE_PROJECT_NAME=k3s - -echo "--> Stopping k3s in docker-compose" -docker-compose down -v -rm -rf kubeconfig.yaml