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
{{ message }}
Repository navigation
Some charts having diffs where there are no changes #305
I'm having a problem with some charts when calling helm diff upgrade; it is detecting changes but when viewing the outputted diff, it appears to be the same. For example:
Using --normalize-manifests (not yet in a release) seems to fix this issue. But is this something that you should need to use a parameter on or should this be the sort of thing that is fixed by default?
Send the output of helm template to a file and have a look at it. And then try to see what's bee written in the helm secret in your cluster. Kubectl get secrets and have a look around to find it
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Could anyone buy me a Windows laptop for testing or contribute a fix? 😃
Anyway, if it's a line-ending issue, it would have something to do with the fact that we call helm get manifest RELEASE and helm template to get the current and the desired manifests to be diffed. Maybe normalize line-endings by default there ould fix it.
I can test this in the next few days. I'd definitely be up for normalizing the line endings by default though. Are there any use cases for not wanting to normalize line endings?
@mahgo Thanks. The point here is that helm-diff should be normalizing line-endings already. --normalize-manifests isn't intended for normalizing line-endings only so enabling it by default isn't an option imho.
@mumoshu I've done a diff on the manifest and template using git diff --no-index --word-diff=color --word-diff-regex=. manifest.txt template.txt. Here's a snippet of the output:
@mahgo Hmmm, maybe..? Honestly, I'm not yet sure why helm-diff needs to that even though helm doesn't do it (in helm-template and helm-upgrade-dry-run)
A workaround would be to set your git config correctly, so that it won't automatically add carriage-returns.
Does it sound too terrible?
Maybe make --normalize-manifests default but give an option to turn it off? Is there anyone that has a use case in which using --normalize-manifests is a problem?
anyone that has a use case in which using --normalize-manifests is a problem?
@mahgo AFAIK, no. But that doesn't mean it is battle-tested to work for every use case. That's why I'm not eager to turn it on by default. Flipping a big feature flag just to resolve one issue that happens only on Windows might not be a great idea in terms of reliability.
@mahgo Sounds like a nice-to-have from the user's perspective, but as a maintainer, I would prefer a mechanism like that to be implemented outside of helm-diff.
We use aryann/difflib for taking diff between two inputs so probably anyone could contribute to the library for the addition? 🤔
Also, we're going to enable helm-diff to toggle --normalize-manifests via an envvar. See #358.
If your issue can be rephrased to be concern about repeating --normalize-manifests for every helm-diff run, would the ability to toggle it via the envvar helps?
Potentially related, but i'm using ansible to run my helm-charts which has helm diff installed for better detection of changes.
For some of the charts, it all works perfectly but for one in particular its behaving as if there is a change on every run, even when nothing on the file system has changed. To elaborate, the helm-chart consumes values which I am reading in from a file on disk using lookup('file', 'FILEPATH') to get the value of the file into helm as an example:
The files being read-in are certificate files which are strings over multiple lines. No matter what I do, I constantly have ansible re-install the chart which is wholly unnecessary. Would --nomalize-manifests work in this use-case since the values are set as secrets.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
mahgo commentedon Sep 17, 2021
This seems to only occur when the previous upgrade on a chart was from a different computer.
jonerer commentedon Oct 5, 2021
Could it be a difference in newlines? Like windows vs linux \r\n and \n? If you could check the content of the secrets, that would be interesting
mahgo commentedon Oct 8, 2021
Using --normalize-manifests (not yet in a release) seems to fix this issue. But is this something that you should need to use a parameter on or should this be the sort of thing that is fixed by default?
mahgo commentedon Oct 8, 2021
@jonerer I have mainly been using Linux and WSL2 Linux, which probably shouldn't be different. What would be the best way to check this?
jonerer commentedon Oct 8, 2021
Send the output of helm template to a file and have a look at it. And then try to see what's bee written in the helm secret in your cluster. Kubectl get secrets and have a look around to find it
stale commentedon Jan 8, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
mumoshu commentedon Jan 9, 2022
Could anyone buy me a Windows laptop for testing or contribute a fix? 😃
Anyway, if it's a line-ending issue, it would have something to do with the fact that we call
helm get manifest RELEASEandhelm templateto get the current and the desired manifests to bediffed. Maybe normalize line-endings by default there ould fix it.mahgo commentedon Jan 10, 2022
I can test this in the next few days. I'd definitely be up for normalizing the line endings by default though. Are there any use cases for not wanting to normalize line endings?
mumoshu commentedon Jan 10, 2022
@mahgo Thanks. The point here is that helm-diff should be normalizing line-endings already.
--normalize-manifestsisn't intended for normalizing line-endings only so enabling it by default isn't an option imho.mahgo commentedon Jan 11, 2022
@mumoshu I've done a diff on the manifest and template using

git diff --no-index --word-diff=color --word-diff-regex=. manifest.txt template.txt. Here's a snippet of the output:mumoshu commentedon Jan 11, 2022
@mahgo Assuming
^Mrepresents a carriage-return, does it mean that you have carriage-returns in the result only in the output of helm-template, right?mumoshu commentedon Jan 11, 2022
@mahgo Would you mind checking how the result looks like when you used
helm upgrade --dry-runinstead ofhelm templateto generatetemplate.txt?4 remaining items
mahgo commentedon Jan 11, 2022
@mumoshu Was given access to their git repository, to collaborate with them.
mumoshu commentedon Jan 11, 2022
@mahgo Thanks. You used
git cloneto fetched the chart, right?mahgo commentedon Jan 11, 2022
@mumoshu Yes that is correct.
Should helm-diff ignore this character by default maybe? Or is there a reason not to?
mumoshu commentedon Jan 11, 2022
@mahgo Hmmm, maybe..? Honestly, I'm not yet sure why helm-diff needs to that even though helm doesn't do it (in helm-template and helm-upgrade-dry-run)
A workaround would be to set your git config correctly, so that it won't automatically add carriage-returns.
Does it sound too terrible?
mahgo commentedon Jan 11, 2022
@mumoshu I think it would be good for helm-diff to ignore this by default. Would be keen to hear what others think.
Looking into why git adds these carraige-returns too is probably not a bad idea as well, thanks.
mahgo commentedon Jan 11, 2022
Maybe make --normalize-manifests default but give an option to turn it off? Is there anyone that has a use case in which using --normalize-manifests is a problem?
mumoshu commentedon Jan 19, 2022
@mahgo AFAIK, no. But that doesn't mean it is battle-tested to work for every use case. That's why I'm not eager to turn it on by default. Flipping a big feature flag just to resolve one issue that happens only on Windows might not be a great idea in terms of reliability.
mahgo commentedon Jan 19, 2022
That's fair enough. What do you think about showing these hidden characters in the diff, when they are the cause of the diff line?
mumoshu commentedon Jan 23, 2022
@mahgo Sounds like a nice-to-have from the user's perspective, but as a maintainer, I would prefer a mechanism like that to be implemented outside of helm-diff.
We use
aryann/difflibfor taking diff between two inputs so probably anyone could contribute to the library for the addition? 🤔mumoshu commentedon Jan 23, 2022
Also, we're going to enable helm-diff to toggle
--normalize-manifestsvia an envvar. See #358.If your issue can be rephrased to be concern about repeating
--normalize-manifestsfor every helm-diff run, would the ability to toggle it via the envvar helps?jack1902 commentedon Jan 25, 2022
Potentially related, but i'm using ansible to run my helm-charts which has
helm diffinstalled for better detection of changes.For some of the charts, it all works perfectly but for one in particular its behaving as if there is a change on every run, even when nothing on the file system has changed. To elaborate, the helm-chart consumes values which I am reading in from a file on disk using
lookup('file', 'FILEPATH')to get the value of the file into helm as an example:ansible snippet
The files being read-in are certificate files which are strings over multiple lines. No matter what I do, I constantly have ansible re-install the chart which is wholly unnecessary. Would
--nomalize-manifestswork in this use-case since the values are set as secrets.Happy to attempt any debugging
mumoshu commentedon Jan 26, 2022
@jack1902 To be extra sure what's going on- are you running ansible on Windows/WSL/cygwin/etc?
stale commentedon Apr 27, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.