You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this project in custom tooling and I wanted to ask if there are plans to add a feature which would show the whole state that is about to be removed before executing helm uninstall
I'm not sure I understand what is requested. Can't you just do a helm get manifest to learn about all the resources that are about to be removed? How would this be different?
When you build a custom tool around helm-diff, it can produce diff not only on helm install/upgrade but also on uninstall.
Instead of doing helm get manifest followed by a difflib call, one wants something like helm diff uninstall that exactly does that for you. It makes integration with helm-diff from the custom tooling easier, as it does not need to directly depend on the version of difflib that helm-diff depends on and does not need to care about how helm-diff produces diffs.
...Well, thinking more and more about this seems to tell me that this isn't strictly needed, a nice-to-have feature to helm-diff 😺
When you build a custom tool around helm-diff, it can produce diff not only on helm install/upgrade but also uninstall.
Yep, that's right. And yes, it's more of a nice-to-have feature
I did not consider the idea of running helm get manifest and performing a little bit of magic to make it seem like a removal diff but that would solve my issue
We basically build a map of manifest names to manifest contents, for the desired and the current state, and compare them one by one using difflib.
Your solution could be much simpler because you can just parse the helm get manifest output and run difflib diff against the empty string for each parsed manifest.
Activity
yxxhero commentedon Jan 17, 2024
@mumoshu @databus23 WDTY?
mumoshu commentedon Jan 17, 2024
Sounds like a good idea to me!
databus23 commentedon Jan 17, 2024
I'm not sure I understand what is requested. Can't you just do a
helm get manifestto learn about all the resources that are about to be removed? How would this be different?mumoshu commentedon Jan 22, 2024
@databus23 @yxxhero I'd love clarification from @gytis-ivaskevicius, but my understanding is this-
When you build a custom tool around helm-diff, it can produce diff not only on helm install/upgrade but also on uninstall.
Instead of doing
helm get manifestfollowed by a difflib call, one wants something likehelm diff uninstallthat exactly does that for you. It makes integration with helm-diff from the custom tooling easier, as it does not need to directly depend on the version of difflib that helm-diff depends on and does not need to care about how helm-diff produces diffs....Well, thinking more and more about this seems to tell me that this isn't strictly needed, a nice-to-have feature to helm-diff 😺
@databus23 @yxxhero What are your thoughts? We'd better NOT add this?
gytis-ivaskevicius commentedon Jan 29, 2024
Yep, that's right. And yes, it's more of a nice-to-have feature
I did not consider the idea of running
helm get manifestand performing a little bit of magic to make it seem like a removal diff but that would solve my issuemumoshu commentedon Jan 29, 2024
@gytis-ivaskevicius Thanks for confirming! Ok then! FYI, here's how we compare current and desired manifests one by one:
helm-diff/diff/diff.go
Line 313 in adb33d2
We basically build a map of manifest names to manifest contents, for the desired and the current state, and compare them one by one using difflib.
Your solution could be much simpler because you can just parse the
helm get manifestoutput and run difflib diff against the empty string for each parsed manifest.