argoproj / argo-cd

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

Server-side diff fails when syncing ExternalSecret resource #18980

Open karlschriek opened 2 months ago

karlschriek commented 2 months ago

Checklist:

Describe the bug

Whenever ArgoCD attempts to sync an ExternalSecret resource, we get errors such as these:

Failed to compare desired state to live state: failed to calculate diff from cache: error calculating server side diff: serverSideDiff error: error running server side apply in dryrun mode for resource ExternalSecret/mysecret: ExternalSecret.external-secrets.io "mysecret" is invalid: [spec.data[0].remoteRef: Required value, spec.data[1].remoteRef: Required value, spec.data[2].remoteRef: Required value, spec.data[3].remoteRef: Required value]

And the app goes into a sync status of "Unknown". The strange thing is if we manually do a sync via the UI, the status will resolve to "synced", but a few minutes later the same error will occur and status will go back to "Unknown".

To Reproduce

With an ArgoCD distro deployed with controller.diff.server.side: "true", create an Application that deploys an ExternalSecret. After a while, the above error will start popping up.

Expected behavior

The sync should succeed.

Screenshots

image

Version

2.11.4

Logs

Paste any relevant application logs here.
christianh814 commented 2 months ago

Do you know if this is for a specific ESO provider or does it happen with all providers?

ChristianCiach commented 2 months ago

Are you using ignoreDifferences? Looks related to

karlschriek commented 2 months ago

I have not noticed it on any resources other than ExternalSecrets.

There are some global "ignoreDifferences" set, yes, in particular this one, which I presume might play a role here:

  resource.customizations.ignoreDifferences.external-secrets.io_ExternalSecret: |
      jqPathExpressions:
        - '.spec.data[]?.remoteRef'