argoproj / argo-cd

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

Syncing an Application with RespectIgnoreDifferences empties everything inside the ignore within the Applicationset #17949

Open DJGizmof opened 7 months ago

DJGizmof commented 7 months ago

We have an Application with an ignoreDifferences:

apiVersion: argoproj.io/v1alpha1
kind: Application
...
spec:
  ignoreDifferences:
      - group: argoproj.io
        jsonPointers:
          - /spec/generators
        kind: ApplicationSet
        name: appset-name
...

We also have an applicationSet holding the data:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
spec:
  generators:
    - list:
        elements:
          - branch: a-branch
            sanitized_branch: a_branch
          - branch: another-branch
            sanitized_branch: another-branch

When the sync on the application is run, we end up with the following data inside the ApplicationSet:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
spec:
  generators:
    - list: {}

In previous version(s) of ArgoCD we ended up with the same data as before the sync. The expected behavior would be that the whole generator-list remains untouched.

We experienced this bug with Argocd Version: { "Version": "v2.10.5+335875d", "BuildDate": "2024-04-04T12:32:14Z", "GitCommit": "335875d13e018bed6e03873f4742582582964745", "GitTreeState": "clean", "GoVersion": "go1.21.7 (Red Hat 1.21.7-1.module+el8.10.0+21318+5ea197f8)", "Compiler": "gc", "Platform": "linux/amd64", "KustomizeVersion": "v5.2.1 unknown", "HelmVersion": "v3.14.0+g2a2fb3b", "KubectlVersion": "v0.26.11", "JsonnetVersion": "v0.20.0", "ExtraBuildInfo": "{Vendor Information: Red Hat OpenShift GitOps version: v1.12.1}" }

andrii-korotkov-verkada commented 2 weeks ago

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and tell us if the issue is still present, please?