diff --git a/.goreleaser.yml b/.goreleaser.yml index 33cc6e98..a2299d0a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 before: hooks: - go mod tidy diff --git a/Makefile b/Makefile index 74ce2569..731f8b50 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ CURRENT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) TEST?=$$(go list ./... |grep -v 'vendor') -GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) PKG_NAME=kubernetes export GO111MODULE=on @@ -13,7 +12,7 @@ build: go install dist: - goreleaser build --single-target --skip-validate --rm-dist + goreleaser build --single-target --skip validate test: go test -i $(TEST) || exit 1 @@ -30,7 +29,7 @@ k3s-stop: @bash scripts/stop-k3s.sh publish: - goreleaser release --rm-dist + goreleaser release --clean vet: @echo "go vet ." @@ -41,8 +40,12 @@ vet: exit 1; \ fi +update-deps: + go get -u ./... + go mod tidy + fmt: - gofmt -w $(GOFMT_FILES) + gofmt -s -w . fmtcheck: @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" @@ -51,13 +54,14 @@ errcheck: @sh -c "'$(CURDIR)/scripts/errcheck.sh'" ci-build-setup: - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > docker-compose + sudo rm -f /usr/local/bin/docker-compose + curl -L https://github.com/docker/compose/releases/download/v2.30.3/docker-compose-`uname -s`-`uname -m` > docker-compose chmod +x docker-compose sudo mv docker-compose /usr/local/bin curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.20.7/bin/linux/amd64/kubectl + curl -LO "https://dl.k8s.io/release/v1.31.3/bin/linux/amd64/kubectl" chmod +x kubectl sudo mv kubectl /usr/local/bin/ bash scripts/gogetcookie.sh -.PHONY: build dist test testacc k3s-start k3s-stop publish vet fmt fmtcheck errcheck ci-build-setup +.PHONY: build dist test testacc k3s-start k3s-stop publish vet fmt fmtcheck errcheck ci-build-setup \ No newline at end of file diff --git a/scripts/start-k3s.sh b/scripts/start-k3s.sh index b47f61f8..e8e17b7c 100755 --- a/scripts/start-k3s.sh +++ b/scripts/start-k3s.sh @@ -6,6 +6,7 @@ cd ${DIR} export KUBECONFIG="${DIR}/kubeconfig.yaml" export COMPOSE_PROJECT_NAME=k3s +export DOCKER_DEFAULT_PLATFORM=linux/$(uname -m) echo "--> Tearing down k3s in docker-compose" docker-compose down -v &>/dev/null || true @@ -13,11 +14,11 @@ rm -rf ${KUBECONFIG} sync; sync; echo "--> Starting k3s in docker-compose" -docker-compose up -d --build +docker-compose up -d --build --pull always 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 +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 @@ -56,6 +57,6 @@ done TIMER_DURATION=$(( SECONDS - TIMER_START )) # restart the node to make sure the registries configuration has been picked up -docker restart k3s_node_1 +docker restart k3s-node-1 -echo "> Connection established to k3s in ${TIMER_DURATION}s" +echo "> Connection established to k3s in ${TIMER_DURATION}s" \ No newline at end of file diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 00000000..625ab562 --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": ["5.0"] + } +} \ No newline at end of file