argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.53k stars 5.34k forks source link

ArgoCD history tab shows latest values in all recent releases #13006

Open dhirajsittu781 opened 1 year ago

dhirajsittu781 commented 1 year ago

The history page shows the latest values in all the releases instead of the ones that were applied after doing a hard-refresh then sync using the same Helm Chart version from a helm repo. All entries in the page display the same chart params.

This bug can be reproduced by following the following steps:

  1. Update any value(s) in values.yaml in a Helm Chart without updating the Chart Version.
  2. Package and Push the Helm Chart to a Chart Repo (JFrog in my case), overwriting the existing one with the same chart version.
  3. Open the app using this Helm Chart repo as the source, click on "hard refresh" and app diff shows the new changes.
  4. Even without syncing the app, all the entries in history page displays the same old version of the chart and all the recent releases show the latest version of parameter values.

Needless to say, the rollback too isn't working.

I'm using ArgoCD app v2.6.3 and a sample of my application manifest is provided here:

apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: payoutmerchantsvc-dev namespace: argocd spec: project: default source: repoURL: <JFROG_HELM_REPO_URL> chart: payoutmerchantsvc-dev targetRevision: 1.0.1005 helm: releaseName: payoutmerchantsvc-dev destination: server: "https://kubernetes.default.svc" namespace: payoutmerchantsvc

There's another issue where this bug was mentioned https://github.com/argoproj/argo-cd/issues/2848, event though it was closed after a bug fix https://github.com/argoproj/argo-cd/issues/3082 I'm still facing it even after upgrading the app version to 2.6.3.

jannfis commented 1 year ago

without updating the Chart Version

I think this is the main culprit here. People should really not do that, imho.

But I agree that the values of the time at installation should be recorded in the history. I suspect (but haven't validated) that Argo CD takes the default values.yaml stored in that specific version of the Chart to be recorded in the history, instead of copying them to the history.

Needless to say, the rollback too isn't working.

This is expected when you don't update the chart's version. I mean, even if you would have the previously used values in the history, to what would you want to roll back? To the same version of the chart? The previous contents of this chart don't exist in the repository anymore, so a rollback isn't possible. For a rollback to work, the previous source must also exist. This might work if you had only updated the values, but there would be no guarantee that some template or other asset in the chart hasn't also changed.

dhirajsittu781 commented 1 year ago

@jannfis Shouldn't we update the chart version only if the template has changed? If i'm only updating a label or config value or any other existing parameter, then updating chart version seems like an overkill. Best way to implement this is to use multiple sources (chart and values from separate repos) but ArgoCD doesn't support history/rollback with multiple sources yet, so I have to keep the values.yaml in the chart itself.

Chandan-SS commented 8 months ago

Do you have any updates on this issue? In my situation, even when the chart version is changed, ArgoCD fails to capture the changes in the History at times. This is a critical issue because missing certain deployment history can lead to confusion and make it difficult to pass deployment audits.

ArgoCD: 2.7.8

dhirajsittu781 commented 8 months ago

@Chandan-SS We resolved this issue by moving to a git repository for keeping our helm charts. With this, ArgoCD syncs the changes for each new commit instead of the chart version.