Interview Prep/Helm/Templating & Rendering Errors

Rendered YAML has two keys glued on one line, e.g. `app.kubernetes.io/name: shopapp.kubernetes.io/instance: shop`.

IntermediateTroubleshootingTemplating & Rendering Errors
Answer

Likely causes → Over-aggressive whitespace trimming: -}} at the end of a line inside a define, or {{- on an include without a following nindent.

Diagnose → Look at the helper's define block and the call site.

Fix → Inside helpers, trim on define/end lines only; at call sites use {{- include "shop.labels" . | nindent 4 }}.

Prevent → Unit tests asserting labels as a map rather than as raw text.

All Helm questions Roadmap: Helm

More on Templating & Rendering Errors