Skip to content

Commit 7d2425c

Browse files
authored
chart: fix rendering webhook-certs volume and volume mount when ko-crds.enabled=false (#3228)
1 parent 968b92b commit 7d2425c

20 files changed

+95
-81
lines changed

.github/workflows/charts-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,12 @@ jobs:
172172
- name: Install cert-manager
173173
run: make install.helm.cert-manager
174174

175+
- name: Install CRDs
176+
run: make install.crds
177+
175178
- name: Run chart-testing (install)
176179
run: |
177180
kubectl create ns kong-test
178-
make install.helm.cert-manager
179181
make test.charts.ct.install CHART_NAME=${{ matrix.chart-name}}
180182
# No need to delete the ns the cluster is scrapped after the job anyway.
181183

Makefile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -870,20 +870,23 @@ test.charts.golden.update:
870870

871871
.PHONY: test.charts.ct.install
872872
test.charts.ct.install:
873-
# NOTE: We add ko-crds.keep=false below because allowing the chart to manage CRDs
873+
# NOTE: We add ko-crds.enabled=false below to handle CRD management outside of ct.
874+
# This is to work around the flaky CRD uninstall behavior of ct.
875+
# Without this, CRDs created by one test helm release installation
876+
# would sometimes not get removed upon uninstalling the release,
874877
# and keep them around after helm uninstall would yield ownership issues.
875878
# Error: INSTALLATION FAILED: Unable to continue with install: CustomResourceDefinition "aigateways.gateway-operator.konghq.com" in namespace ""
876879
# exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name"
877880
# must equal "kong-operator-h39gau9scc": current value is "kong-operator-tiptva339m"
878881
#
879-
# NOTE: We add the --wait below to ensure that we wait for all objects to get removed
880-
# for each release. Without this, some objects like CRDs can still be around
881-
# when another test helm release is being installed and the above mentioned
882-
# ownership error will be returned.
882+
# This could potentially be solved by setting the --cascade foreground option
883+
# to helm uninstall command in ct, but ct does not currently support passing
884+
# extra args to helm uninstall.
885+
# There's an open PR for this: https://github.com/helm/chart-testing/pull/806
883886

884887
ct install --target-branch main \
885888
--debug \
886-
--helm-extra-set-args "--set=ko-crds.keep=false" \
889+
--helm-extra-set-args "--set=ko-crds.enabled=false" \
887890
--helm-extra-args "--wait" \
888891
--helm-extra-args "--timeout=3m" \
889892
--charts charts/$(CHART_NAME) \
@@ -1069,6 +1072,10 @@ uninstall.helm.cert-manager: download.helm
10691072
# Install CRDs into the K8s cluster specified in ~/.kube/config.
10701073
.PHONY: install
10711074
install: install.helm.cert-manager manifests kustomize install.gateway-api-crds
1075+
$(MAKE) install.crds
1076+
1077+
.PHONY: install.crds
1078+
install.crds: kustomize
10721079
$(KUSTOMIZE) build config/crd | kubectl apply --server-side -f -
10731080

10741081
# Install RBACs from config/rbac into the K8s cluster specified in ~/.kube/config.
@@ -1085,8 +1092,11 @@ install.all: install.helm.cert-manager manifests kustomize install.gateway-api-c
10851092
# Call with ignore-not-found=true to ignore resource not found errors during deletion.
10861093
.PHONY: uninstall
10871094
uninstall: manifests kustomize uninstall.gateway-api-crds uninstall.helm.cert-manager
1088-
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
1095+
$(MAKE) uninstall.crds
10891096

1097+
.PHONY: uninstall.crds
1098+
uninstall.crds: kustomize
1099+
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
10901100

10911101
# Uninstall standard and experimental CRDs from the K8s cluster specified in ~/.kube/config.
10921102
# Call with ignore-not-found=true to ignore resource not found errors during deletion.

charts/kong-operator/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.1.1
4+
5+
### Fixes
6+
7+
- Fix an issue with missing volume mount when `ko-crds.enabled=false` is set
8+
and conversion webhook is enabled.
9+
[#2356](https://github.com/Kong/kong-operator/pull/2356)
10+
311
## 1.1.0
412

513
### Changed

charts/kong-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ maintainers:
88
name: kong-operator
99
sources:
1010
- https://github.com/Kong/kong-operator/charts/kong-operator/
11-
version: 1.1.0
11+
version: 1.1.1
1212
appVersion: "2.1.0"
1313
annotations:
1414
artifacthub.io/category: networking

charts/kong-operator/ci/__snapshots__/affinity-values.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kong-operator/ci/__snapshots__/controlplane-config-dump.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kong-operator/ci/__snapshots__/disable-gateway-controller-values.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kong-operator/ci/__snapshots__/env-and-args-values.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kong-operator/ci/__snapshots__/env-and-customenv-values.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kong-operator/ci/__snapshots__/extra-labels-values.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)