Interview Prep/Helm/Templating: Go Templates & Sprig

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.

All Helm questions Roadmap: Helm

More on Templating: Go Templates & Sprig