Skip to content

Commit

Permalink
Patch v1.14 to republish
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinbunney committed Nov 26, 2024
1 parent 717e1cc commit 97f2834
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
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"]
}
}

0 comments on commit 97f2834

Please sign in to comment.