Interview Prep/Helm/Values & Precedence

What is a typical "type coercion" bug with values, and how do you avoid it?

IntermediateConceptValues & Precedence
Answer

Examples:

  • tag: 1.10 in YAML becomes 1.1.
  • --set enabled=false is a boolean, but --set-string enabled=false is the string "false", which is truthy in if.
  • port: "3000" in values renders a quoted string into containerPort, causing invalid type ... got "string", expected "integer".

Avoid with quoted strings for identifiers in values, int/toString conversions in templates, and values.schema.json declaring types so wrong types fail at install time.

All Helm questions Roadmap: Helm

More on Values & Precedence