File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
hosting/k8s/helm/templates Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -559,6 +559,17 @@ Generate docker config for image pull secret
559559{{- end }}
560560{{- end }}
561561
562+ {{/*
563+ Create the name of the webapp service account to use
564+ */ }}
565+ {{- define " trigger-v4.webappServiceAccountName" -}}
566+ {{- if .Values.supervisor.serviceAccount.create }}
567+ {{- default (printf " %s -webapp" (include " trigger-v4.fullname" . )) .Values.webapp.serviceAccount.name }}
568+ {{- else }}
569+ {{- default " default" .Values.webapp.serviceAccount.name }}
570+ {{- end }}
571+ {{- end }}
572+
562573{{/*
563574Merge webapp ingress annotations to avoid duplicates
564575*/ }}
Original file line number Diff line number Diff line change 1+ {{- if .Values.webapp.serviceAccount.create }}
12apiVersion : v1
23kind : ServiceAccount
34metadata :
4- name : {{ include "trigger-v4.fullname " . }}-webapp
5+ name : {{ include "trigger-v4.webappServiceAccountName " . }}
56 labels :
67 {{- $component := "webapp" }}
78 {{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
9+ {{- with .Values.webapp.serviceAccount.annotations }}
10+ annotations :
11+ {{- toYaml . | nindent 4 }}
12+ {{- end }}
13+ {{- end }}
814---
915apiVersion : rbac.authorization.k8s.io/v1
1016kind : Role
@@ -27,7 +33,7 @@ metadata:
2733 {{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
2834subjects :
2935 - kind : ServiceAccount
30- name : {{ include "trigger-v4.fullname " . }}-webapp
36+ name : {{ include "trigger-v4.webappServiceAccountName " . }}
3137 namespace : {{ .Release.Namespace }}
3238roleRef :
3339 kind : Role
5662 labels :
5763 {{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
5864 spec :
59- serviceAccountName : {{ include "trigger-v4.fullname " . }}-webapp
65+ serviceAccountName : {{ include "trigger-v4.webappServiceAccountName " . }}
6066 {{- with .Values.global.imagePullSecrets }}
6167 imagePullSecrets :
6268 {{- toYaml . | nindent 8 }}
You can’t perform that action at this time.
0 commit comments