Skip to content

Commit a97917a

Browse files
committed
Update workflow for PRs
Update Kubernetes version to latest available and lowest supported (N-2). Match Go version with our `go.mod`. Bump Cert Manager to 1.7.0 because 1.8.0 has breaking changes, and we have not tested whether we are compatible with those changes. Sometimes, Cert Manager Pods become ready, however Cert Manager itself is not ready to serve requests. If Topology Operator is deployed at that time, Cert Manager will not inject the certificate into the Webhooks, causing an error of the kind "x509: certificate signed by unknown authority". The solution is to wait for the API to be ready, using their new CLI `cmctl`.
1 parent cdb3979 commit a97917a

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.github/workflows/pr.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
k8s: [v1.19.11, v1.21.1]
26+
k8s: [v1.22.9, v1.24.1]
2727
steps:
2828
- name: Check out code into the Go module directory
2929
uses: actions/checkout@v2
3030
- uses: actions/setup-go@v2
3131
with:
32-
go-version: '^1.16.0' # Require Go 1.16 and above, but lower than Go 2.0.0
32+
go-version: '^1.17.0' # Require Go 1.16 and above, but lower than Go 2.0.0
3333
- name: System tests
3434
env:
3535
K8S_VERSION: ${{ matrix.k8s }}
3636
run: |
3737
export GOPATH="$HOME/go"
3838
export PATH="$PATH:$GOPATH/bin"
39-
make install-tools
39+
make install-tools cmctl
4040
kind create cluster --image kindest/node:"$K8S_VERSION"
41-
make cert-manager
42-
make cluster-operator
41+
make cert-manager cluster-operator
4342
DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind BUILD_KIT=docker
4443
make system-tests BUILD_KIT=docker

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ cover.out
66
tags
77
releases/
88
testbin/
9+
bin/
10+
tmp/
911
*.iml

Makefile

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ install-tools:
2626
ENVTEST_K8S_VERSION = 1.22.1
2727
ARCHITECTURE = amd64
2828
LOCAL_TESTBIN = $(CURDIR)/testbin
29+
30+
LOCAL_BIN := $(CURDIR)/bin
31+
$(LOCAL_BIN):
32+
mkdir -p -v $(@)
33+
34+
LOCAL_TMP := $(CURDIR)/tmp
35+
$(LOCAL_TMP):
36+
mkdir -p -v $(@)
37+
2938
# "Control plane binaries (etcd and kube-apiserver) are loaded by default from /usr/local/kubebuilder/bin.
3039
# This can be overridden by setting the KUBEBUILDER_ASSETS environment variable"
3140
# https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest
@@ -80,6 +89,7 @@ uninstall: manifests
8089
kustomize build config/crd | kubectl delete -f -
8190

8291
deploy-manager:
92+
$(CMCTL) check api --wait=2m
8393
kustomize build config/default/overlays/cert-manager/ | kubectl apply -f -
8494

8595
deploy: manifests deploy-rbac deploy-manager
@@ -90,12 +100,14 @@ destroy:
90100

91101
# Deploy operator with local changes
92102
deploy-dev: check-env-docker-credentials docker-build-dev manifests deploy-rbac docker-registry-secret set-operator-image-repo
103+
$(CMCTL) check api --wait=2m
93104
kustomize build config/default/overlays/dev | sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -
94105

95106
# Load operator image and deploy operator into current KinD cluster
96107
deploy-kind: manifests deploy-rbac
97108
$(BUILD_KIT) build --build-arg=GIT_COMMIT=$(GIT_COMMIT) -t $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT) .
98109
kind load docker-image $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)
110+
$(CMCTL) check api --wait=2m
99111
kustomize build config/default/overlays/kind | sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -
100112

101113
deploy-rbac:
@@ -176,14 +188,31 @@ endif
176188
cluster-operator:
177189
@kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
178190

191+
destroy-cluster-operator:
192+
@kubectl delete -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml --ignore-not-found
193+
179194
## used in CI pipeline to create release artifact
180195
generate-manifests:
181196
mkdir -p releases
182197
kustomize build config/installation/ > releases/messaging-topology-operator.bak
183198
sed '/CERTIFICATE_NAMESPACE.*CERTIFICATE_NAME/d' releases/messaging-topology-operator.bak > releases/messaging-topology-operator.yaml
184199
kustomize build config/installation/cert-manager/ > releases/messaging-topology-operator-with-certmanager.yaml
185200

186-
CERT_MANAGER_VERSION ?=v1.2.0
201+
################
202+
# Cert Manager #
203+
################
204+
205+
CERT_MANAGER_VERSION ?= v1.7.0
206+
CERT_MANAGER_MANIFEST ?= https://github.com/jetstack/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml
207+
208+
CMCTL = $(LOCAL_BIN)/cmctl
209+
.PHONY: cmctl
210+
cmctl: | $(CMCTL)
211+
$(CMCTL): | $(LOCAL_BIN) $(LOCAL_TMP)
212+
curl -sSL -o $(LOCAL_TMP)/cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cmctl-$(platform)-$(shell go env GOARCH).tar.gz
213+
tar -C $(LOCAL_TMP) -xzf $(LOCAL_TMP)/cmctl.tar.gz
214+
mv $(LOCAL_TMP)/cmctl $(CMCTL)
215+
187216
cert-manager: ## Deploys Cert Manager from JetStack repo. Use CERT_MANAGER_VERSION to customise version e.g. v1.2.0
188217
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml
189218

0 commit comments

Comments
 (0)