mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release 3.5.0 (#357)
Co-authored-by: Lawrence Gil <lawrence.gil@assemblyglobal.com>
This commit is contained in:
parent
5a722abfa9
commit
90e6b9e7cf
42 changed files with 1092 additions and 164 deletions
|
@ -0,0 +1,17 @@
|
|||
{{/*
|
||||
Return a ServiceAccount Object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceAccount.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- if eq $identifier "default" -}}
|
||||
{{- include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" "default" "values" $rootContext.Values.serviceAccount) -}}
|
||||
{{- else -}}
|
||||
{{- $serviceAccountValues := dig "extraServiceAccounts" $identifier nil $rootContext.Values.serviceAccount -}}
|
||||
{{- if not (empty $serviceAccountValues) -}}
|
||||
{{- include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $serviceAccountValues) -}}
|
||||
{{- else -}}
|
||||
{{- fail (printf "No ServiceAccount configured with identifier: %s" $identifier) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -7,17 +7,19 @@ Convert ServiceAccount values to an object
|
|||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the serviceAccount name */ -}}
|
||||
{{- $serviceAccountName := "" -}}
|
||||
{{- $defaultServiceAccountName := "default" -}}
|
||||
{{- if $objectValues.create -}}
|
||||
{{- $defaultServiceAccountName = (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
{{- $defaultServiceAccountName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- $objectName := $defaultServiceAccountName -}}
|
||||
|
||||
{{- with $objectValues.name -}}
|
||||
{{- $objectName = . -}}
|
||||
{{- end -}}
|
||||
{{- if and (ne $identifier "default") (not $objectValues.name) -}}
|
||||
{{- $objectName = printf "%s-%s" $defaultServiceAccountName $identifier -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $serviceAccountName = default $defaultServiceAccountName $objectValues.name -}}
|
||||
|
||||
{{- $_ := set $objectValues "name" $serviceAccountName -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the serviceAccount object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue