Last active
June 8, 2021 19:36
-
-
Save droopy4096/309b20baa86a9d2ed7c80588edee3753 to your computer and use it in GitHub Desktop.
Helm execute a template in a subchart's scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# idea from https://github.com/helm/helm/issues/4535#issuecomment-477778391 | |
{{- define "call-nested" }} | |
{{- $dot := index . 0 }} | |
{{- $subchart := index . 1 | splitList "." }} | |
{{- $template := index . 2 }} | |
{{- $values := $dot.Values }} | |
{{- range $subchart }} | |
{{- $values = index $values . }} | |
{{- end }} | |
{{- include $template (dict "Chart" (dict "Name" (last $subchart)) "Values" $values "Release" $dot.Release "Capabilities" $dot.Capabilities) }} | |
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ include "call-nested" (list . "redis" "redis.fullname") }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment