-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Sync not working on every subsequent attempt when using PreSync or Sync Resource Hooks #20119
Comments
Hi, we are talking about full syncs only, right? (Selective syncs do not trigger hooks) |
@reggie-k yes, this is happening for full syncs |
Copy/Pasting a similar issue referenced in #16835 Also facing a similar issue. The helm chart version is the same between releases, however updating the container images inside is not properly triggering the Helm hooks as expected. In order for the helm hooks to actually run, we have to manually execute the sync despite having autosync enabled. Greatly appreciate if anyone has additional information on how to overcome this issue. Thanks! |
In our case we observe the issue only with PreSync Hooks and when using "argocd.argoproj.io/hook-delete-policy": "BeforeHookCreation"
|
I am interested in exploring the workaround you mentioned. This sounds like there is some logic in ArgoCD that is associating a previous job with a current sync and skipping over. To address the shortcomings of that workaround: Definitely not ideal user experience but something I'll be checking out. |
I got a similar issue with PreSync Job and ExternalSecret. In addition, ArgoCD keeps deleting the job pod, before it is finished. |
ArgoCD Version: v2.9.3+6eba5be (we have also tries this with v2.11.4+e1284e1)
Templating: Helm
This issue occurs for me when i am using PreSync Hooks.
I have an internal helm repository which is being used with ArgoCD to deploy my applications. We have a requirement where we want to run some init steps(these include updates to db, grafana dashboards, etc.) prior to running the deployment
Hence PreSync Hooks lfor ArgoCD seemed to be the clear choice for us.
Here are the manifests for resources we want to create with Pre-Sync Hook:
Here are the defination for both the objects:-
SecretProviderClass:
PreSync Job:
The application.yaml looks like this:
Now for the first time i run a sync the application syncs correctly and all the resources are created.

SecretProviderClass Object:

we haven't specified hook deletion policy, hence it should default to BeforeHookCreation as specified in the documentation.

For the second time when sync is run, the first pre-sync object gets deleted, and sync gets stuck.
At this moment, the last sync window shows sync successful, while sync status shows out of sync.
SecretProviderClass Object:

So the first pre-sync object is never recreated on the second run and the entire workflow comes to a hung state
This is happening to us every alternative sync.
Expected behavior
Sync Should work every time. All objects with annotation pre-sync should be recreated and deployment should not hang.
Version
The text was updated successfully, but these errors were encountered: