Skip to content

Commit 3eaa664

Browse files
fix: Support latest image tag
1 parent 0e29de9 commit 3eaa664

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

components/tyk-gateway/templates/_helpers.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ Create chart name and version as used by the chart label.
5252
{{- printf "%s" .Values.gateway.image.tag | replace "v" "" -}}
5353
{{- end -}}
5454

55+
56+
{{- define "tyk-gateway.probe-on-control-port" -}}
57+
{{- if or .Values.gateway.control.probe (eq .Values.gateway.image.tag "latest") -}}
58+
true
59+
{{- else -}}
60+
{{- or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .)) -}}
61+
{{- end -}}
62+
{{- end -}}
63+
5564
{{- define "tyk-gateway.redis_url" -}}
5665
{{- if .Values.global.redis.addrs -}}
5766
{{ join "," .Values.global.redis.addrs }}

components/tyk-gateway/templates/deployment-gw-repset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ spec:
277277
httpGet:
278278
scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}"
279279
path: /hello
280-
{{- if and .Values.gateway.control.enabled (or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .))) }}
280+
{{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }}
281281
port: {{ .Values.gateway.control.containerPort }}
282282
{{- else }}
283283
port: {{ .Values.global.servicePorts.gateway }}
@@ -290,7 +290,7 @@ spec:
290290
httpGet:
291291
scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}"
292292
path: /hello
293-
{{- if and .Values.gateway.control.enabled (or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .))) }}
293+
{{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }}
294294
port: {{ .Values.gateway.control.containerPort }}
295295
{{- else }}
296296
port: {{ .Values.global.servicePorts.gateway }}

components/tyk-gateway/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ gateway:
191191
# annotations for control port service
192192
annotations: {}
193193

194+
# The health endpoint is exposed on the control port or the service port, depending on image tag.
195+
# Set to true to override to having the health endpoint on the control port.
196+
# Useful if the tag is not semVer compatible.
197+
probe: false
198+
194199
# Creates an ingress object in k8s. Will require an ingress-controller and
195200
# annotation to that ingress controller.
196201
ingress:

0 commit comments

Comments
 (0)