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
62 stars 8 forks source link

Helm drift fails because of duplicate keys #22

Closed perryjrandall closed 4 months ago

perryjrandall commented 5 months ago

Helm very annoyingly allows duplicate keys

This breaks the yaml parsing in helm-drift

helm drift all
2024/04/30 11:58:57 from_template.go:153: yaml: unmarshal errors:
  line 14: mapping key "app.kubernetes.io/managed-by" already defined at line 12
Error: plugin "drift" exited with error

We can fix the chart, but the plugin should also be more resilient to match the behavior of helm itself

perryjrandall commented 5 months ago

I added a PR for review when you have a chance to review @nikhilsbhat

nikhilsbhat commented 4 months ago

@perryjrandall , I've also observed this behavior, but I encountered it while using two different versions of the Helm CLI. The version used during deployment differed from the one used with this plugin. However, when I used the same version on both sides, I didn't encounter this issue, so I somewhat overlooked it.

Now that I understand the reason, I'll review the PR and merge it.