Skip to content

Commit

Permalink
fix: broken "| default" logic for automountServiceAccountToken (#665)
Browse files Browse the repository at this point in the history
When setting (.Values.serviceAccount.operator).automountServiceAccountToken to boolean false, the "| default" part kicks in.
Fix is strongly inspired from helm/helm#12080 (comment)

Signed-off-by: François Blondel <[email protected]>
Co-authored-by: François Blondel <[email protected]>
  • Loading branch information
Farfaday and François Blondel authored Jul 31, 2024
1 parent 5d6d5d1 commit 6e4d362
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ (.Values.serviceAccount.operator).name | default .Values.serviceAccount.name }}
automountServiceAccountToken: {{ (.Values.serviceAccount.operator).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.operator).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.operator).automountServiceAccountToken }}
securityContext:
{{- if .Values.podSecurityContext.operator }}
{{- toYaml .Values.podSecurityContext.operator | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/manager/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ metadata:
{{- end }}
name: {{ (.Values.serviceAccount.operator).name | default .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
automountServiceAccountToken: {{ (.Values.serviceAccount.operator).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.operator).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.operator).automountServiceAccountToken }}
{{- end -}}
2 changes: 1 addition & 1 deletion keda/templates/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ (.Values.serviceAccount.metricServer).name | default .Values.serviceAccount.name }}
automountServiceAccountToken: {{ (.Values.serviceAccount.metricServer).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.metricServer).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.metricServer).automountServiceAccountToken }}
securityContext:
{{- if .Values.podSecurityContext.metricServer }}
{{- toYaml .Values.podSecurityContext.metricServer | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/metrics-server/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ metadata:
{{- end }}
name: {{ (.Values.serviceAccount.metricServer).name | default .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
automountServiceAccountToken: {{ (.Values.serviceAccount.metricServer).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.metricServer).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.metricServer).automountServiceAccountToken }}
{{- end -}}
2 changes: 1 addition & 1 deletion keda/templates/webhooks/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ (.Values.serviceAccount.webhooks).name | default .Values.serviceAccount.name }}
automountServiceAccountToken: {{ (.Values.serviceAccount.webhooks).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.webhooks).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.webhooks).automountServiceAccountToken }}
securityContext:
{{- if .Values.podSecurityContext.webhooks }}
{{- toYaml .Values.podSecurityContext.webhooks | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion keda/templates/webhooks/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ metadata:
{{- end }}
name: {{ (.Values.serviceAccount.webhooks).name | default .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
automountServiceAccountToken: {{ (.Values.serviceAccount.webhooks).automountServiceAccountToken | default .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ kindIs "invalid" (.Values.serviceAccount.webhooks).automountServiceAccountToken | ternary .Values.serviceAccount.automountServiceAccountToken (.Values.serviceAccount.webhooks).automountServiceAccountToken }}
{{- end -}}

0 comments on commit 6e4d362

Please sign in to comment.