Skip to content

Commit ed7aef1

Browse files
fix: Always mount ConfigMap and add --config flag
When alphaConfig.enabled=true and forceLegacyConfig=false, the deployment was not mounting the ConfigMap or adding the --config flag because the condition checked for existingConfig OR configFile. Since configFile defaults to empty string, the condition was false and oauth2-proxy failed with 'missing setting for email validation'. Fixed by removing the conditions entirely: - ConfigMap volume is always created (using existingConfig if specified) - ConfigMap is always mounted - --config flag is always added This ensures email_domains is always provided to oauth2-proxy, whether using the generated ConfigMap or an existingConfig. This is NOT a breaking change - it fixes a bug where the app didn't work with default values when using alphaConfig. Signed-off-by: pierluigilenoci <pierluigi.lenoci@gmail.com> Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
1 parent 79831db commit ed7aef1

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ spec:
145145
{{- toYaml . | nindent 10 }}
146146
{{- end }}
147147
{{- end }}
148-
{{- if or .Values.config.existingConfig .Values.config.configFile }}
149148
- --config=/etc/oauth2_proxy/oauth2_proxy.cfg
150-
{{- end }}
151149
{{- if .Values.authenticatedEmailsFile.enabled }}
152150
{{- if .Values.authenticatedEmailsFile.template }}
153151
- --authenticated-emails-file=/etc/oauth2-proxy/{{ .Values.authenticatedEmailsFile.template }}
@@ -298,11 +296,9 @@ spec:
298296
readOnly: true
299297
{{- end }}
300298
{{- end }}
301-
{{- if or .Values.config.existingConfig .Values.config.configFile }}
302299
- mountPath: /etc/oauth2_proxy/oauth2_proxy.cfg
303300
name: configmain
304301
subPath: oauth2_proxy.cfg
305-
{{- end }}
306302
{{- if .Values.alphaConfig.enabled }}
307303
- mountPath: /etc/oauth2_proxy/oauth2_proxy.yml
308304
name: configalpha
@@ -366,12 +362,10 @@ spec:
366362
name: {{ template "oauth2-proxy.fullname" . }}-wait-for-redis
367363
defaultMode: 0775
368364
{{- end }}
369-
{{- if or .Values.config.existingConfig .Values.config.configFile }}
370365
- configMap:
371366
defaultMode: 420
372367
name: {{ if .Values.config.existingConfig }}{{ .Values.config.existingConfig }}{{ else }}{{ template "oauth2-proxy.fullname" . }}{{ end }}
373368
name: configmain
374-
{{- end }}
375369
{{- if .Values.alphaConfig.enabled }}
376370
{{- if .Values.alphaConfig.existingConfig }}
377371
- configMap:

0 commit comments

Comments
 (0)