diff --git a/keda/templates/manager/deployment.yaml b/keda/templates/manager/deployment.yaml index 7751fef1..91821bb2 100644 --- a/keda/templates/manager/deployment.yaml +++ b/keda/templates/manager/deployment.yaml @@ -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 }} diff --git a/keda/templates/manager/serviceaccount.yaml b/keda/templates/manager/serviceaccount.yaml index 00888198..6449adaf 100644 --- a/keda/templates/manager/serviceaccount.yaml +++ b/keda/templates/manager/serviceaccount.yaml @@ -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 -}} diff --git a/keda/templates/metrics-server/deployment.yaml b/keda/templates/metrics-server/deployment.yaml index 91628b26..919eed14 100644 --- a/keda/templates/metrics-server/deployment.yaml +++ b/keda/templates/metrics-server/deployment.yaml @@ -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 }} diff --git a/keda/templates/metrics-server/serviceaccount.yaml b/keda/templates/metrics-server/serviceaccount.yaml index 7227699a..67e3b67b 100644 --- a/keda/templates/metrics-server/serviceaccount.yaml +++ b/keda/templates/metrics-server/serviceaccount.yaml @@ -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 -}} diff --git a/keda/templates/webhooks/deployment.yaml b/keda/templates/webhooks/deployment.yaml index 680401a5..b5b5e0f6 100644 --- a/keda/templates/webhooks/deployment.yaml +++ b/keda/templates/webhooks/deployment.yaml @@ -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 }} diff --git a/keda/templates/webhooks/serviceaccount.yaml b/keda/templates/webhooks/serviceaccount.yaml index da5a83a2..32189023 100644 --- a/keda/templates/webhooks/serviceaccount.yaml +++ b/keda/templates/webhooks/serviceaccount.yaml @@ -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 -}}