diff --git a/.cruft.json b/.cruft.json index e6b359e..cb86994 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/vshn/appcat-cookiecutter", - "commit": "5309ae05edb3c118e23e64e8ec0bed2b6768ac86", + "commit": "128d270ba199a581122ff74c2f82b8e3019490f0", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7be5052..b55b1f3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -111,7 +111,7 @@ jobs: with: token: ${{ secrets.COMPONENT_ACCESS_TOKEN }} title: 'PR for ${{ env.APP_NAME }} on ${{ steps.extract_branch.outputs.branch }}' - body: "${{ github.event.pull_request.body}}\nLink: ${{ github.event.pull_request.url }}" + body: "${{ github.event.pull_request.body}}\nLink: ${{ github.event.pull_request.html_url }}" branch: "${{ env.APP_NAME }}/${{ github.event.pull_request.number }}/${{ steps.extract_branch.outputs.branch }}" base: master draft: false diff --git a/ci.mk b/ci.mk index f76fa79..34263aa 100644 --- a/ci.mk +++ b/ci.mk @@ -46,7 +46,7 @@ package-build-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD package-build-branchtag: docker-build-branchtag package-build .PHONY: package-push-package-branchtag -package-push-package-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g') +package-push-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g') package-push-branchtag: package-build-branchtag package-push .PHONY: docker-build-local diff --git a/kind/config.yaml b/kind/config.yaml deleted file mode 100644 index d6ed52c..0000000 --- a/kind/config.yaml +++ /dev/null @@ -1,25 +0,0 @@ -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -containerdConfigPatches: - - |- - [plugins."io.containerd.grpc.v1.cri".registry] - config_path = "/etc/containerd/certs.d" -nodes: - - role: control-plane - kubeadmConfigPatches: - - | - kind: InitConfiguration - nodeRegistration: - kubeletExtraArgs: - node-labels: "ingress-ready=true" - extraPortMappings: - - containerPort: 80 - hostPort: 8081 - protocol: TCP - - containerPort: 443 - hostPort: 8443 - protocol: TCP - # registry can't be sensibly exposed via Ingress under 127.0.0.0.nip.io host with subpath - - containerPort: 30500 - hostPort: 5000 - protocol: TCP diff --git a/kind/kind.mk b/kind/kind.mk deleted file mode 100644 index c2883a9..0000000 --- a/kind/kind.mk +++ /dev/null @@ -1,68 +0,0 @@ -kind_dir ?= $(PWD)/.kind -kind_bin = $(go_bin)/kind - -# Prepare kind binary -$(kind_bin): export GOOS = $(shell go env GOOS) -$(kind_bin): export GOARCH = $(shell go env GOARCH) -$(kind_bin): export GOBIN = $(go_bin) -$(kind_bin): | $(go_bin) - go install sigs.k8s.io/kind@latest - -mirror_sentinel = $(kind_dir)/mirror_sentinel - -.PHONY: kind -kind: export KUBECONFIG = $(KIND_KUBECONFIG) -kind: kind-setup-ingress kind-load-image ## All-in-one kind target - -.PHONY: kind-setup -kind-setup: export KUBECONFIG = $(KIND_KUBECONFIG) -kind-setup: $(KIND_KUBECONFIG) ## Creates the kind cluster - -.PHONY: kind-setup-ingress -kind-setup-ingress: export KUBECONFIG = $(KIND_KUBECONFIG) -kind-setup-ingress: kind-setup ## Install NGINX as ingress controller onto kind cluster (localhost:8081) - kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml - -.PHONY: kind-load-image -# We fix the arch to linux/amd64 since kind runs in amd64 even on Mac/arm. -kind-load-image: export GOOS = linux -kind-load-image: export GOARCH = amd64 -kind-load-image: kind-setup docker-build ## Load the container image onto kind cluster - @$(kind_bin) load docker-image --name $(KIND_CLUSTER) $(IMG) - -.PHONY: kind-clean -kind-clean: export KUBECONFIG = $(KIND_KUBECONFIG) -kind-clean: ## Removes the kind Cluster - @$(kind_bin) delete cluster --name $(KIND_CLUSTER) || true - docker rm -f kind-registry - rm -rf $(kind_dir) $(kind_bin) - -$(KIND_KUBECONFIG): export KUBECONFIG = $(KIND_KUBECONFIG) -$(KIND_KUBECONFIG): $(kind_bin) - $(kind_bin) create cluster \ - --name $(KIND_CLUSTER) \ - --image $(KIND_IMAGE) \ - --config kind/config.yaml - @kubectl version - @kubectl cluster-info - @kubectl config use-context kind-$(KIND_CLUSTER) - @echo ======= - @echo "Setup finished. To interact with the local dev cluster, set the KUBECONFIG environment variable as follows:" - @echo "export KUBECONFIG=$$(realpath "$(KIND_KUBECONFIG)")" - @echo ======= - -.PHONY: mirror-setup -mirror-setup: $(mirror_sentinel) ## Installs an image registry required for the package image in kind cluster. - -$(mirror_sentinel): export KUBECONFIG = $(KIND_KUBECONFIG) -$(mirror_sentinel): - - REGISTRY_DIR="/etc/containerd/certs.d/registry.registry-system.svc.cluster.local:5000" && \ - REGISTRY_HOST='[host."http://localhost:30500"]' && \ - for node in $$(kind get nodes -n $(KIND_CLUSTER)); do \ - echo $$node ; \ - docker exec "$${node}" mkdir -p "$${REGISTRY_DIR}" ; \ - echo "$${REGISTRY_HOST}" | docker exec -i "$${node}" cp /dev/stdin "$${REGISTRY_DIR}/hosts.toml" ; \ - done - - @touch $@