Hacker News new | ask | show | jobs
by arkh 590 days ago
> Helm charts are a horrible example of text based templating.

Every time I see " | nindent whatever" I'm asking why the fuck the tool cannot manage indentation.

3 comments

And it breaks every time a variable gets a `:` inside of it and now you are producing invalid yaml everywhere you forgot to call `| toYaml`.
I once got a nil pointer exception when I updated a helm chart. I wondered why the hell am I getting a nil pointer exception for updating a YAML file. After some investigation I found an issue on GitHub where the maintainers said the Go team says this is an intended behavior for some case in Go templates.

Wasn't fun.

That isn't a typical nill/null exception, like in JavaScript, ruby, and python. That's in a language where a lot of values are non-nullable, and some of the ones that are have zero-values that can be used without getting a nil pointer exception. https://go.dev/tour/moretypes/12

So, there's a good chance was an error that was really unexpected and it's better to show the error than to risk producing bad output.

Never read anything more true in my life!