-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some charts having diffs where there are no changes #305
Comments
This seems to only occur when the previous upgrade on a chart was from a different computer. |
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 |
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? |
@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? |
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 |
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. |
@mumoshu I've done a diff on the manifest and template using |
@mahgo Assuming |
@mahgo Would you mind checking how the result looks like when you used |
@mumoshu Yes they are in the template and not the manifest. And the dry-run result is the same as the template. |
@mahgo Thanks- Gotcha. How did you prepare the chart? I thought any templates in a chart will get carriage-returns added if you use certain tool on Windows, which is affecting helm's rendering output. I'm also wondering if how helm is handling carriage-returns in a fetched chart and a new chart. |
This chart was originally created by a 3rd party. Here's how the pdb yaml file looks via cat -e pdb.yaml
This doesn't seem to exist on a new chart though (both if created in powershell or under WSL2):
|
@mahgo Thanks for the response!
How did you fetched the chart exactly? |
@mumoshu Was given access to their git repository, to collaborate with them. |
@mahgo Thanks. You used |
@mumoshu Yes that is correct. Should helm-diff ignore this character by default maybe? Or is there a reason not to? |
@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. |
@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. |
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? |
@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. |
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? |
@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 |
Also, we're going to enable helm-diff to toggle |
Potentially related, but i'm using ansible to run my helm-charts which has 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 ansible snippet---
# Get linkerd charts
- name: Add linkerd chart repo
kubernetes.core.helm_repository:
name: linkerd
repo_url: "https://helm.linkerd.io/stable"
- name: Deploy linkerd2 chart
kubernetes.core.helm:
name: linkerd2
chart_ref: linkerd/linkerd2
chart_version: 2.11.1
release_namespace: linkerd
wait: true
release_values:
installNamespace: false
# ca.crt
identityTrustAnchorsPEM: "{{ lookup('file', 'ca.crt') }}"
identity:
issuer:
tls:
# issuer.crt
crtPEM: "{{ lookup('file', 'issuer.crt') }}"
# issuer.key
keyPEM: "{{ lookup('file', 'issuer.key') }}" 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 Happy to attempt any debugging |
@jack1902 To be extra sure what's going on- are you running ansible on Windows/WSL/cygwin/etc? |
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. |
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:The text was updated successfully, but these errors were encountered: