feat(common)!: Release v3.0.0-beta2 (#280)

This commit is contained in:
Bernd Schorgers 2024-03-08 08:51:40 +01:00 committed by GitHub
parent 23ae8131da
commit 21e751bc16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 419 additions and 368 deletions

View file

@ -0,0 +1,23 @@
{{/*
Return the enabled controllers.
*/}}
{{- define "bjw-s.common.lib.controller.enabledControllers" -}}
{{- $rootContext := .rootContext -}}
{{- $enabledControllers := dict -}}
{{- range $name, $controller := $rootContext.Values.controllers -}}
{{- if kindIs "map" $controller -}}
{{- /* Enable by default, but allow override */ -}}
{{- $controllerEnabled := true -}}
{{- if hasKey $controller "enabled" -}}
{{- $controllerEnabled = $controller.enabled -}}
{{- end -}}
{{- if $controllerEnabled -}}
{{- $_ := set $enabledControllers $name . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $enabledControllers | toYaml -}}
{{- end -}}

View file

@ -17,7 +17,8 @@ Convert controller values to an object
{{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}}
{{- if ne $identifier "main" -}}
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if gt (len $enabledControllers) 1 -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}}
{{- end -}}