diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 5389b30e1..b400b8f0e 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -4,6 +4,13 @@ Nothing yet. +## 2.26.1 + +### Fixed + +* Fix parsing enterprise tags (like e.g. `3.4.0.0`) + [#857](https://github.com/Kong/charts/pull/857) + ## 2.26.0 ### Improvements diff --git a/charts/kong/Chart.yaml b/charts/kong/Chart.yaml index 000c5644d..e3f627d3b 100644 --- a/charts/kong/Chart.yaml +++ b/charts/kong/Chart.yaml @@ -11,7 +11,7 @@ maintainers: name: kong sources: - https://github.com/Kong/charts/tree/main/charts/kong -version: 2.26.0 +version: 2.26.1 appVersion: "3.3" dependencies: - name: postgresql diff --git a/charts/kong/ci/test-enterprise-version-3.4.0.0-values.yaml b/charts/kong/ci/test-enterprise-version-3.4.0.0-values.yaml new file mode 100644 index 000000000..e439d2267 --- /dev/null +++ b/charts/kong/ci/test-enterprise-version-3.4.0.0-values.yaml @@ -0,0 +1,17 @@ +ingressController: + enabled: false + +proxy: + type: NodePort + +image: + repository: kong/kong-gateway + tag: "3.4.0.0" + +readinessProbe: + httpGet: + path: "/status" + port: status + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 1 diff --git a/charts/kong/templates/_helpers.tpl b/charts/kong/templates/_helpers.tpl index 015e99127..c898f5b61 100644 --- a/charts/kong/templates/_helpers.tpl +++ b/charts/kong/templates/_helpers.tpl @@ -786,10 +786,22 @@ The name of the service used for the ingress controller's validation webhook {{/* effectiveVersion takes an image dict from values.yaml. if .effectiveSemver is set, it returns that, else it returns .tag */}} {{- define "kong.effectiveVersion" -}} +{{- /* Because Kong Gateway enterprise uses versions with 4 segments and not 3 */ -}} +{{- /* as semver does, we need to account for that here by extracting */ -}} +{{- /* first 3 segments for comparison */ -}} {{- if .effectiveSemver -}} -{{- .effectiveSemver -}} + {{- if regexMatch "^[0-9]+.[0-9]+.[0-9]+" .effectiveSemver -}} + {{- regexFind "^[0-9]+.[0-9]+.[0-9]+" .effectiveSemver -}} + {{- else -}} + {{- .effectiveSemver -}} + {{- end -}} {{- else -}} -{{- (trimSuffix "-redhat" .tag) -}} + {{- $tag := (trimSuffix "-redhat" .tag) -}} + {{- if regexMatch "^[0-9]+.[0-9]+.[0-9]+" .tag -}} + {{- regexFind "^[0-9]+.[0-9]+.[0-9]+" .tag -}} + {{- else -}} + {{- .tag -}} + {{- end -}} {{- end -}} {{- end -}}