Skip to content

Commit 12ad328

Browse files
committed
fix: better search for the supplied version
1 parent bc940ae commit 12ad328

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

helm/oauth2-proxy/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,10 @@ Compute the redis url if not set explicitly.
101101
{{ fail "please set sessionStorage.redis.standalone.connectionUrl or enable the redis subchart via redis.enabled" }}
102102
{{- end -}}
103103
{{- end -}}
104+
105+
{{/*
106+
Returns the version
107+
*/}}
108+
{{- define "oauth2-proxy.version" -}}
109+
{{ trimPrefix "v" (lower (.Values.image.tag | default (printf "v%s" .Chart.AppVersion))) }}
110+
{{- end -}}

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
{{- end }}
5656
containers:
5757
- name: {{ .Chart.Name }}
58-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
58+
image: "{{ .Values.image.repository }}:v{{ include "oauth2-proxy.version" . }}"
5959
imagePullPolicy: {{ .Values.image.pullPolicy }}
6060
args:
6161
{{- if .Values.alphaConfig.enabled }}
@@ -194,7 +194,7 @@ spec:
194194
{{- if .Values.readinessProbe.enabled }}
195195
readinessProbe:
196196
httpGet:
197-
path: {{ gt .Chart.AppVersion "7.4.0" }}/ready{{ else }}/ping{{ end }}
197+
path: {{ if gt (include "oauth2-proxy.version" .) "7.4.0" }}/ready{{ else }}/ping{{ end }}
198198
port: {{ .Values.httpScheme }}
199199
scheme: {{ .Values.httpScheme | upper }}
200200
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}

0 commit comments

Comments
 (0)