fix(common): Release 2.0.2 (#196)

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-10-05 12:25:05 +02:00 committed by GitHub
parent d86b0de790
commit f729651dbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 260 additions and 41 deletions

View file

@ -6,6 +6,11 @@ Convert controller values to an object
{{- $identifier := .id -}}
{{- $objectValues := .values -}}
{{- /* Default the controller type to Deployment */ -}}
{{- if eq (dig "type" "" $objectValues) "" -}}
{{- $_ := set $objectValues "type" "deployment" -}}
{{- end -}}
{{- /* Determine and inject the controller name */ -}}
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}

View file

@ -4,15 +4,8 @@ Returns the value for serviceAccountName
{{- define "bjw-s.common.lib.pod.field.serviceAccountName" -}}
{{- $rootContext := .ctx.rootContext -}}
{{- /* Default to "default" */ -}}
{{- $name := "default" -}}
{{- $serviceAccountValues := (mustDeepCopy $rootContext.Values.serviceAccount) -}}
{{- $serviceAccountObject := (include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" "default" "values" $serviceAccountValues)) | fromYaml -}}
{{- $serviceAccountObject.name -}}
{{- /* See if an override is needed */ -}}
{{- if $rootContext.Values.serviceAccount.create -}}
{{- $serviceAccountValues := (mustDeepCopy $rootContext.Values.serviceAccount) -}}
{{- $serviceAccountObject := (include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" "default" "values" $serviceAccountValues)) | fromYaml -}}
{{- $name = $serviceAccountObject.name -}}
{{- end -}}
{{- $name -}}
{{- end -}}

View file

@ -6,7 +6,7 @@ Validate Service values
{{- $serviceObject := .object -}}
{{- if empty (get $serviceObject "controller") -}}
{{- fail (printf "controller is required for Service. (service: %s)" $serviceObject.identifier) -}}
{{- fail (printf "controller field is required for Service. (service: %s)" $serviceObject.identifier) -}}
{{- end -}}
{{- /* Validate Service type */ -}}

View file

@ -1,5 +1,5 @@
{{/*
Convert Secret values to an object
Convert ServiceAccount values to an object
*/}}
{{- define "bjw-s.common.lib.serviceAccount.valuesToObject" -}}
{{- $rootContext := .rootContext -}}
@ -7,12 +7,15 @@ Convert Secret values to an object
{{- $objectValues := .values -}}
{{- /* Determine and inject the serviceAccount name */ -}}
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
{{- if $objectValues.name -}}
{{- $objectName = $objectValues.name -}}
{{- $serviceAccountName := "" -}}
{{- $defaultServiceAccountName := "default" -}}
{{- if $objectValues.create -}}
{{- $defaultServiceAccountName = (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
{{- end -}}
{{- $_ := set $objectValues "name" $objectName -}}
{{- $serviceAccountName = default $defaultServiceAccountName $objectValues.name -}}
{{- $_ := set $objectValues "name" $serviceAccountName -}}
{{- $_ := set $objectValues "identifier" $identifier -}}
{{- /* Return the serviceAccount object */ -}}