mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 10:19:16 -03:00
feat(common): allow tpl for env expandObjectName, configmap-name and secret-name
This commit is contained in:
@@ -15,4 +15,4 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 12.2.12
|
||||
version: 12.2.13
|
||||
|
||||
@@ -38,8 +38,11 @@ objectData: The object data to be used to render the container.
|
||||
key: {{ $obj.key | quote }}
|
||||
|
||||
{{- $name = tpl $obj.name $rootCtx -}}
|
||||
|
||||
{{- if kindIs "bool" $obj.expandObjectName -}}
|
||||
{{- $expandName = $obj.expandObjectName -}}
|
||||
{{- else if eq $obj.expandObjectName "false" -}}
|
||||
{{- $expandName = false -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $expandName -}}
|
||||
|
||||
@@ -26,10 +26,11 @@ objectData: The object data to be used to render the container.
|
||||
|
||||
{{- $objectName := tpl .name $rootCtx -}}
|
||||
|
||||
{{- $expandName := true -}}
|
||||
{{- if kindIs "bool" .expandObjectName -}}
|
||||
{{- $expandName = .expandObjectName -}}
|
||||
{{- end -}}
|
||||
{{- if kindIs "bool" .expandObjectName -}}
|
||||
{{- $expandName = .expandObjectName -}}
|
||||
{{- else if eq .expandObjectName "false" -}}
|
||||
{{- $expandName = false -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $expandName -}}
|
||||
{{- $object := dict -}}
|
||||
|
||||
@@ -7,7 +7,15 @@
|
||||
|
||||
{{- range $name, $configmap := .Values.configmap -}}
|
||||
|
||||
{{- if $configmap.enabled -}}
|
||||
{{- $enabled := false -}}
|
||||
|
||||
{{- if kindIs "bool" $configmap.enabled -}}
|
||||
{{- $enabled = $configmap.enabled -}}
|
||||
{{- else if eq $configmap.enabled "true" -}}
|
||||
{{- $enabled = true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $enabled -}}
|
||||
|
||||
{{/* Create a copy of the configmap */}}
|
||||
{{- $objectData := (mustDeepCopy $configmap) -}}
|
||||
|
||||
@@ -7,7 +7,15 @@
|
||||
|
||||
{{- range $name, $secret := .Values.secret -}}
|
||||
|
||||
{{- if $secret.enabled -}}
|
||||
{{- $enabled := false -}}
|
||||
|
||||
{{- if kindIs "bool" $secret.enabled -}}
|
||||
{{- $enabled = $secret.enabled -}}
|
||||
{{- else if eq $secret.enabled "true" -}}
|
||||
{{- $enabled = true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $enabled -}}
|
||||
|
||||
{{/* Create a copy of the secret */}}
|
||||
{{- $objectData := (mustDeepCopy $secret) -}}
|
||||
|
||||
Reference in New Issue
Block a user