This assumption was discovered deep within some templated YAML generated by templated something else three levels down and resulted in a complete k8s cluster failure for us, but only the 08 cluster! It worked in the first 7.
Damn! I’m guessing most developers today wouldn’t even know octal or how octal numeric literals are written with a “0” prefix. I actually laughed when I read this comment, but this behavior (and assumption) is ridiculous considering the fact that almost nobody would be using octal in some configuration file in 2023. Hexadecimal? Maybe. Decimal? Yes. Octal? C’mon!
Which - seeing like that, were the Linux file permissions originally octal? When thinking about permissions and permutations... and old magic numbers, that seems like the bits might fit.
Exactly there I was hit so many times by not using quotes around file permissions, because 0644 is interpreted as 420 and Ansible sets the permissions to '-r---w----' instead of '-rw-r--r--'.
For those used to /usr/bin/chmod remember that modes are actually octal numbers. You must give Ansible enough information to parse them correctly. For consistent results, quote octal numbers (for example, '644' or '1777') so Ansible receives a string and can do its own conversion from string into number. Adding a leading zero (for example, 0755) works sometimes, but can fail in loops and some other circumstances.
Despite this, I still think YAML is a nice configuration language. The problem is not with YAML, it's with the whole complexity we're trying to represent there. Whatever configuration language you use, the outcome will be the same. Reduce the complexity, and it will shine.
> Whatever generated that clearly wasn't serializing its data using a library
Wow, you couldn't ask for a stronger condemnation than that for YAML as a configuration language. "You clearly weren't using a library to write your config file".
In the world I live in, config file formats exist to be written and read by humans. Serialization formats exist to be generated by libraries.
Yeah, helm is...interesting. it's just a gnarly yaml -> template -> yaml cycle. it's better than nothing for the problem it solves....but god, there's gotta be a better way.
Just use JSON for everything that is supposed to accept YAML, and rely on the fact that the entirety of JSON is somehow a subset of YAML and that most YAML never actually needs the "features" of YAML.
At least with JSON, tooling can help you find invalid syntax in the middle of your file.
And JSON tooling/libraries (compared to YAML tooling/libraries) are usually faster, easier to use, have less bugs and present less incompatibilities between themselves most of the time.
This assumption was discovered deep within some templated YAML generated by templated something else three levels down and resulted in a complete k8s cluster failure for us, but only the 08 cluster! It worked in the first 7.