Skip to content

Commit

Permalink
fix: Support latest image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-bochenski committed Oct 18, 2023
1 parent 0e29de9 commit 3eaa664
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions components/tyk-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ Create chart name and version as used by the chart label.
{{- printf "%s" .Values.gateway.image.tag | replace "v" "" -}}
{{- end -}}


{{- define "tyk-gateway.probe-on-control-port" -}}
{{- if or .Values.gateway.control.probe (eq .Values.gateway.image.tag "latest") -}}
true
{{- else -}}
{{- or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .)) -}}
{{- end -}}
{{- end -}}

{{- define "tyk-gateway.redis_url" -}}
{{- if .Values.global.redis.addrs -}}
{{ join "," .Values.global.redis.addrs }}
Expand Down
4 changes: 2 additions & 2 deletions components/tyk-gateway/templates/deployment-gw-repset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ spec:
httpGet:
scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}"
path: /hello
{{- 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" .))) }}
{{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }}
port: {{ .Values.gateway.control.containerPort }}
{{- else }}
port: {{ .Values.global.servicePorts.gateway }}
Expand All @@ -290,7 +290,7 @@ spec:
httpGet:
scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}"
path: /hello
{{- 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" .))) }}
{{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }}
port: {{ .Values.gateway.control.containerPort }}
{{- else }}
port: {{ .Values.global.servicePorts.gateway }}
Expand Down
5 changes: 5 additions & 0 deletions components/tyk-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ gateway:
# annotations for control port service
annotations: {}

# The health endpoint is exposed on the control port or the service port, depending on image tag.
# Set to true to override to having the health endpoint on the control port.
# Useful if the tag is not semVer compatible.
probe: false

# Creates an ingress object in k8s. Will require an ingress-controller and
# annotation to that ingress controller.
ingress:
Expand Down

0 comments on commit 3eaa664

Please sign in to comment.