From e5852071aebb3f035d08e39389a33795a874188c Mon Sep 17 00:00:00 2001 From: Anish gehlot Date: Thu, 10 Oct 2024 18:26:26 +0530 Subject: [PATCH] fix: kong proxy semver issue to use latest tag --- charts/nethgate/Chart.yaml | 2 +- charts/nethgate/README.md | 2 +- charts/nethgate/templates/_helpers.tpl | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/charts/nethgate/Chart.yaml b/charts/nethgate/Chart.yaml index 5a554935..e3f290f3 100644 --- a/charts/nethgate/Chart.yaml +++ b/charts/nethgate/Chart.yaml @@ -8,7 +8,7 @@ maintainers: name: nethgate sources: - https://github.com/Kong/charts/tree/main/charts/kong -version: 2.33.6 +version: 2.33.7 appVersion: "3.5" dependencies: - name: postgresql diff --git a/charts/nethgate/README.md b/charts/nethgate/README.md index 2696c4e7..c614aaba 100644 --- a/charts/nethgate/README.md +++ b/charts/nethgate/README.md @@ -610,7 +610,7 @@ directory. | Parameter | Description | Default | | ---------------------------------- | ------------------------------------------------------------------------------------- | ------------------- | | image.repository | Kong image | `kong` | -| image.tag | Kong image version | `3.5` | +| image.tag | Kong image version (proxy can use latest tag) | `3.5` | | image.effectiveSemver | Semantic version to use for version-dependent features (if `tag` is not a semver) | | | image.pullPolicy | Image pull policy | `IfNotPresent` | | image.pullSecrets | Image pull secrets | `null` | diff --git a/charts/nethgate/templates/_helpers.tpl b/charts/nethgate/templates/_helpers.tpl index 5fe5127a..3740845d 100644 --- a/charts/nethgate/templates/_helpers.tpl +++ b/charts/nethgate/templates/_helpers.tpl @@ -1800,10 +1800,16 @@ extensions/v1beta1 {{- define "kong.proxy.compatibleReadiness" -}} {{- $proxyReadiness := .Values.readinessProbe -}} -{{- if (or (semverCompare "< 3.3.0" (include "kong.effectiveVersion" .Values.image)) (and .Values.ingressController.enabled (semverCompare "< 2.11.0" (include "kong.effectiveVersion" .Values.ingressController.image)))) -}} +{{- $effectiveVersion := include "kong.effectiveVersion" .Values.image | default "0.0.0" -}} +{{- $ingressVersion := include "kong.effectiveVersion" .Values.ingressController.image | default "0.0.0" -}} + +{{- if (or (and (not (eq .Values.image.tag "latest")) (semverCompare "< 3.3.0" $effectiveVersion)) + (and .Values.ingressController.enabled (not (eq .Values.ingressController.image.tag "latest")) (semverCompare "< 2.11.0" $ingressVersion)) + (eq .Values.image.tag "latest")) -}} {{- if (eq $proxyReadiness.httpGet.path "/status/ready") -}} {{- $_ := set $proxyReadiness.httpGet "path" "/status" -}} {{- end -}} {{- end -}} -{{- (toYaml $proxyReadiness) -}} + +{{- (toYaml $proxyReadiness) | nindent 2 -}} {{- end -}}