nikhilsbhat / helm-drift

Helm plugin that identifies the configuration that has drifted from the Helm chart
https://artifacthub.io/packages/helm-plugin/helm-drift/drift
MIT License
68 stars 10 forks source link

Use the same yaml library that helm itself uses #23

Closed perryjrandall closed 6 months ago

perryjrandall commented 6 months ago

Helm appears to use a very specific opinionated library for yaml which among other differences allows for things like duplicate keys which are not actually valid yaml

This is because under the hood its basically using json which is more permissive then converting that to yaml

Source https://github.com/helm/helm/blob/c6beb169d26751efd8131a5d65abe75c81a334fb/pkg/chartutil/values.go#L26C1-L26C20

Fixes https://github.com/nikhilsbhat/helm-drift/issues/22

I tested this by adding a duplicate line in the test under k8s which is essentially the duplicate in our helm config that triggers this

I also then tested the locally built binary

make build.local
./helm-drift_v0.1.0 all