Skip to content
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

ignoreDifferences for CustomerResource does not have any effect #21308

Open
dirkvdplas opened this issue Dec 24, 2024 · 0 comments
Open

ignoreDifferences for CustomerResource does not have any effect #21308

dirkvdplas opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dirkvdplas
Copy link

dirkvdplas commented Dec 24, 2024

Checklist:

  • [V ] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • [V] I've included steps to reproduce the bug.
  • [V] I've pasted the output of argocd version.

IgnoreDifferences for CustomResource objects is not working. What have I done:

  1. tested if I understood IgnoreDifferences syntax. I tested with standard builtin objects like replicas and this was working as expected
  2. tested with multiple helmcharts which use custom resource object, and always encountered same issue. I will provide an example based on a small project external-dns, which will make it easy to reproduce

ArgoCD reports outofsync condition despite the fact that the changed objects are defined under IgnoreDifferences

To Reproduce
It is assumed that ArGoCD server v2.13.2 is installed

  1. Create App in ArgoCD, with following settings (also provided in file: argocd-app.yaml). This will create namespace external-dns with external-dns application and the CRD dnsendpoints.externaldns.k8s.io
project: default
destination:
  server: https://kubernetes.default.svc
  namespace: external-dns
syncPolicy:
  syncOptions:
    - CreateNamespace=true
ignoreDifferences:
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
sources:
  - repoURL: https://github.com/dirkvdplas/argocd-externaldns-ignoredifferences.git
    path: manifests
    targetRevision: main
  - repoURL: registry-1.docker.io/bitnamicharts
    path: external-dns
    targetRevision: 8.7.1
    chart: external-dns
  1. Introduce a change in the external-dns custom resource. Change
    recordTTL to another value
    kubectl -n external-dns edit DNSEndpoint ns-record
  2. ArgoCD will now report outofSync, appearantly the "ignoreDifferences" did not have any effect

Expected behavior
I expect that ArgoCD does not report outofsync for objects which are defined under IgnoreDifferences

I expected Sync Status to be "Synced" because ArgoCD should have ignored any changes on the DNSendpoint
Screenshots

A screenshot has been added which shows the detected diff:
dnsendpoint-diff

Version

argocd: v2.13.1+af54ef8
  BuildDate: 2024-11-20T16:54:29Z
  GitCommit: af54ef8db5adfa77a08d4d05b1318a2198084c22
  GitTreeState: clean
  GoVersion: go1.22.9
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.13.2+dc43124
  BuildDate: 2024-12-11T18:37:15Z
  GitCommit: dc43124058130db9a747d141d86d7c2f4aac7bf9
  GitTreeState: clean
  GoVersion: go1.23.1
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.4.3 2024-07-19T16:40:33Z
  Helm Version: v3.15.4+gfa9efb0
  Kubectl Version: v0.31.0
  Jsonnet Version: v0.20.0

Logs
Attached are the logs which appeared after changing the dnsendpoint
The following command was used to gather the logs:
kubectl -n argocd logs -f argocd-application-controller-0 -c argocd-application-controller

time="2024-12-24T14:19:47Z" level=info msg="Refreshing app status (controller refresh requested), level (1)" app-namespace=argocd app-qualified-name=argocd/external-dns application=external-dns project=default
time="2024-12-24T14:19:47Z" level=info msg="Comparing app state (cluster: https://kubernetes.default.svc, namespace: external-dns)" application=argocd/external-dns
time="2024-12-24T14:19:47Z" level=info msg="GetRepoObjs stats" application=argocd/external-dns build_options_ms=0 manifests_ms=11 plugins_ms=0 repo_ms=0 time_ms=11
time="2024-12-24T14:19:47Z" level=info msg="Updated sync status: Synced -> OutOfSync" application=external-dns dest-namespace=external-dns dest-server="https://kubernetes.default.svc" reason=ResourceUpdated type=Normal
time="2024-12-24T14:19:47Z" level=info msg="Update successful" app-namespace=argocd app-qualified-name=argocd/external-dns application=external-dns project=default
time="2024-12-24T14:19:47Z" level=info msg="Reconciliation completed" app-namespace=argocd app-qualified-name=argocd/external-dns app_status_update_ms=0 application=external-dns auto_sync_ms=0 compare_app_state_ms=14 comparison-level=1 comparison_with_nothing_ms=0 dedup_ms=0 dest-name= dest-namespace=external-dns dest-server="https://kubernetes.default.svc" diff_ms=0 git_ms=11 health_ms=0 live_ms=0 normalize_application_ms=0 patch_ms=18 persist_app_status_ms=26 process_finalizers_ms=0 project=default refresh_app_conditions_ms=0 set_app_managed_resources_ms=8 setop_ms=0 settings_ms=0 sync_ms=0 time_ms=49
@dirkvdplas dirkvdplas added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant