diff --git a/helm-toolkit/templates/_funcs.tpl b/helm-toolkit/templates/_funcs.tpl index 85059c4c54..38c39cf1df 100644 --- a/helm-toolkit/templates/_funcs.tpl +++ b/helm-toolkit/templates/_funcs.tpl @@ -19,9 +19,7 @@ {{- define "helm-toolkit.template" -}} {{- $name := index . 0 -}} {{- $context := index . 1 -}} -{{- $v:= $context.Template.Name | split "/" -}} -{{- $n := len $v -}} -{{- $last := sub $n 1 | printf "_%d" | index $v -}} +{{- $last := base $context.Template.Name }} {{- $wtf := $context.Template.Name | replace $last $name -}} {{ include $wtf $context }} {{- end -}} @@ -29,9 +27,7 @@ {{- define "helm-toolkit.hash" -}} {{- $name := index . 0 -}} {{- $context := index . 1 -}} -{{- $v:= $context.Template.Name | split "/" -}} -{{- $n := len $v -}} -{{- $last := sub $n 1 | printf "_%d" | index $v -}} +{{- $last := base $context.Template.Name }} {{- $wtf := $context.Template.Name | replace $last $name -}} {{- include $wtf $context | sha256sum | quote -}} {{- end -}}