Skip to content

Commit c77e16c

Browse files
feat(lmutil): added util function to fetch serviceaccount
1 parent 615b613 commit c77e16c

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

charts/lmutil/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: library
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.9
18+
version: 0.1.10
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/lmutil/templates/_util.tpl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,6 @@ app.kubernetes.io/instance: {{ .Release.Name }}
9797
{{- end }}
9898

9999

100-
{{/*
101-
Create the name of the service account to use
102-
*/}}
103-
{{- define "lmutil.serviceAccountName" -}}
104-
{{- if .Values.serviceAccount.create }}
105-
{{- default (include "lmutil.fullname" .) .Values.serviceAccount.name }}
106-
{{- else }}
107-
{{- default "default" .Values.serviceAccount.name }}
108-
{{- end }}
109-
{{- end }}
110-
111100
{{- define "lmutil.generic.labels" }}
112101
helm.sh/chart: {{ template "lmutil.chart" . }}
113102
app.kubernetes.io/part-of: {{ include "lmutil.name" . }}
@@ -146,6 +135,20 @@ This takes an array of three values:
146135
{{- include "lmutil.merge" (append . "lmutil.default-container-sec-context-nonroot" ) -}}
147136
{{- end -}}
148137

138+
139+
{{- define "lmutil.serviceAccountName" -}}
140+
{{- if .Values.serviceAccount.name -}}
141+
{{ .Values.serviceAccount.name }}
142+
{{- else if .Values.global.serviceAccount.name -}}
143+
{{ .Values.global.serviceAccount.name }}
144+
{{- else if .Values.serviceAccount.create -}}
145+
{{ include "lmutil.fullname" . }}
146+
{{- else -}}
147+
{{ "default" | quote }}
148+
{{- end -}}
149+
{{- end -}}
150+
151+
149152
{{/*
150153
Return secret name to be used based on the userDefinedSecret.
151154
*/}}

charts/lmutil/values.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)