Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch v1.14.0 to republish as v1.16.0 #314

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
before:
hooks:
- go mod tidy
Expand Down
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -30,7 +29,7 @@ k3s-stop:
@bash scripts/stop-k3s.sh

publish:
goreleaser release --rm-dist
goreleaser release --clean

vet:
@echo "go vet ."
Expand All @@ -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'"
Expand All @@ -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
11 changes: 6 additions & 5 deletions scripts/start-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ 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
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
Expand Down Expand Up @@ -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"
6 changes: 6 additions & 0 deletions terraform-registry-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": 1,
"metadata": {
"protocol_versions": ["5.0"]
}
}