We have the requirement that modifying yaml belonging to the user must preserve their comments, since the output may still be read by humans. There is no existing library for Go which supports this behaviour, and as a result we manipulate yaml with a collection of regular expressions in cluster/kubernetes/update.go and cluster/kubernetes/policies.go.
This code is difficult to maintain, changes to it are difficult to review, and it's difficult to be sure it does the right thing for all possible inputs.
We should delete it all and offload the yaml-modification to kubeyaml, as is being done in #976.
As of #976 being merged, we don't modify YAMLs from the go code any more.
Awesome!
For the record: https://github.com/weaveworks/flux/issues/1120
No help wanted labels in sight
No help wanted labels in sight
Magic labeling machine waved!
Most helpful comment
Awesome!