mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e210f43e3
commit
a01a89cb13
327 changed files with 11181 additions and 7330 deletions
|
@ -4,24 +4,20 @@ Returns the value for serviceAccountName
|
|||
{{- define "bjw-s.common.lib.pod.field.serviceAccountName" -}}
|
||||
{{- $rootContext := .ctx.rootContext -}}
|
||||
{{- $controllerObject := .ctx.controllerObject -}}
|
||||
|
||||
{{- $serviceAccountName := "default" -}}
|
||||
|
||||
{{- if $rootContext.Values.enforceServiceAccountCreation -}}
|
||||
{{- if (get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "create") -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "name" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "name" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $controllerObject.serviceAccount -}}
|
||||
{{- if hasKey . "identifier" -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml) "name" -}}
|
||||
{{- $subject := (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml) -}}
|
||||
|
||||
{{- if not $subject }}
|
||||
{{- fail (printf "No enabled ServiceAccount found with this identifier. (controller: '%s', identifier: '%s')" $controllerObject.identifier .identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $serviceAccountName = get $subject "name" -}}
|
||||
{{- else if hasKey . "name" -}}
|
||||
{{- $serviceAccountName = .name -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $serviceAccountName -}}
|
||||
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue