What is the `.Template` object good for?
AdvancedConceptTemplating: Go Templates & Sprig
Answer
.Template.Name is the path of the current file (shop/templates/api-deployment.yaml) and .Template.BasePath is the chart's templates directory (shop/templates). Uses:
checksum/config: {{ include (print $.Template.BasePath "/api-configmap.yaml") . | sha256sum }}
{{- fail (printf "%s: image.repository is required" .Template.Name) }}
Inside subcharts, BasePath points at the subchart's templates directory.
More on Templating: Go Templates & Sprig
What template language does Helm use?BeginnerWhat does the dot (`.`) mean in a Helm template?BeginnerWhat is `$` and when do you need it?IntermediateHow does whitespace control (`{{-` and `-}}`) work?BeginnerHow do `if`, `else if` and `else` evaluate truthiness?BeginnerWhat do `and`, `or`, `not`, `eq`, `ne`, `lt`, `gt` look like in Helm?Beginner