0

When calling helm template ... I get this error:

Error: YAML parse error on `myfile.yaml`: error converting YAML to JSON: `yaml`: line 60: mapping values are not allowed in this context

I would like to know, if I can set debug options to analyze this problem. Because myfile.yaml is valid in another context with other values, it would be helpful, if I could print out the generated invalid yaml before helm tries to convert it to json.

There are options --debug and -v but these don't help.

Remarks

There is another question with the same title. But that question is about a specific problem. My question is not about a specific problem. Instead I would like to get general hints, how to analyze such problems.

Matthias M
  • 12,906
  • 17
  • 87
  • 116
  • as far as I remember 'helm template --dry-run --debug' does not validate the template/yaml. This should print out the yaml as proposed to the kubernetes api. Why exactly is that not enough to server your use case? ps a way to ignore parse errors is to comment out the affected section in the template and rendert it – kgorskowski Oct 06 '20 at 07:05
  • That's the solution! Now I see directly the error in the generated yaml. When you post this as an answer, I will accept it then. Thanks! – Matthias M Oct 06 '20 at 10:55
  • I've stripped down your answer to the actual solution. hope that's ok. – Matthias M Oct 06 '20 at 12:53
  • Answer to your questions: I didn't expect, that --dry-run had this effect on helm template, because I thought, helm template is already a dry-run without install. But obviously I was wrong here. Commenting out the affected section does not always help, if the error is connected to indenting errors for example. So thanks again. – Matthias M Oct 06 '20 at 12:56

1 Answers1

2

helm template --dry-run --debug does not validate the template/yaml.

This should print out the yaml as proposed to the kubernetes api.

Matthias M
  • 12,906
  • 17
  • 87
  • 116
kgorskowski
  • 745
  • 5
  • 12