Why are template names "global", and how does that bite you with subcharts?
AdvancedConceptTemplating: Go Templates & Sprig
Answer
All templates from the parent and every subchart are loaded into one namespace before rendering. If both the parent and a subchart define "fullname" or "labels", one definition wins (the last loaded), and the other chart renders with the wrong helper, producing wrong names or labels with no error.
That is why every define is prefixed with the chart name (shop.fullname, postgres.fullname), and why library charts use a distinct prefix (shacklib.deployment). It is also what makes library charts possible: the parent can call a subchart's helpers directly.
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