Argocd Application does not pick the changes in its own annotations/labels and sync options.
Checklist:
- [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [x] I've included steps to reproduce the bug.
- [x] I've pasted the output of
argocd version.
Describe the bug Below are the 2 issues I face,
- When you add/modify the annotations of the argocd application, sync happens successfully to that commit but the change never gets updated to the application itself.
- When you add/modify the sync Options of the argocd application, sync happens successfully to that commit but the change never gets updated to the application itself.
Attached below screenshot.
NOTE : The annotations are only created when the very first deployment of the application itself afterwards we have manually add the annotations in the application.
To Reproduce
Deploy a sample argocd application for your first deployment. Then add a new annotations/labels in the application and push it to the repository. Argocd application will get synced to the latest commit but annotation/labels wont be added.
Same goes for syncOption.
Expected behavior
Screenshots
Annotation change in Argocd Application is not getting updated in the argo application.
Sync Options changes not getting updated in the argo application.
Version
argocd: v2.10.7+b060053.dirty
BuildDate: 2024-04-15T12:31:39Z
GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
GitTreeState: dirty
GoVersion: go1.22.2
Compiler: gc
Platform: darwin/arm64
Hi Arun, thanks for raising the issue.
Annotation change in Argocd Application is not getting updated in the argo application.
Argo CD will be monitoring your GitHub Repository where your application manifests have been deployed. If your Argo CD manifest is not getting monitored by the Argo CD, you can use the kubectl apply command to reflect those changes to the Argo CD UI. If you want Argo CD to update the annotations automatically, you need to make sure that Argo CD monitors your Argo CD application manifest (pass the correct path and see if a resource of kind Application gets created). Generally, you'd let Argo CD monitor your application manifests stored in the GitHub Repository. Any changes to those manifests (deployment, svc...) on the github repo will automatically sync the state. The similar things goes for Sync Options too.
I'd recommend using kubectl apply command to reflect those changes to the Argo CD instead of expecting to changes to get automatically reflected from the github repository when your Argo CD is not monitoring the correct path where the Argo CD manifest is located. Looking at your configuration and resources created, i don't see any resource of kind Application being created which means Argo CD is monitoring the path where your Argo CD manifest has been created.
Let me know if it makes sense to you.
@nitishfy - My k8s manifest like deploy, svc etc, are present inside the folder nginx and my Argocd Application is present in the root directory of the repo. So you mean to say since my argocd application manifest is configured to monitor nginx folder, it does not pick the changes made to argocd app manifest. Is that right ?
I will try adding root directory in the path and revert back if the issue persist, thanks for replying.
yep, try adding the manifest in the path which Argo CD is monitoring and then check if a resource of kind Application gets created.
@ArunKumarT1995 did you try this? If you are facing any doubts, don't hesitate to reach out to us on slack.
Are we good enough to close this issue?
@nitishfy - sorry for late reply, I did try adding root directory in the path but the application nginx is creating another application nginx inside it (state is out of sync always) which is not what I was looking for.
My expectation is, change the application/applicationset annotation and I should be able to see the changes in argocd UI. I need this feature because based on few annotation, I would send notification to certain email id. The value of the annotation is mutable and I want to make sure only change in git should change the configuration and no manual intervention.
If this feature is not available, I think this will be good feature request. What do you think ?
can you share your application manifest?
@nitishfy - PFB the screenshot for app manifest.
Below is the Screenshot from UI
Please correct me if i am wrong - Suppose you remove an annotation from the application manifest and apply the changes, you mean that the argo cd does not get in sync with the git repository although the status in the UI shows as Synced. Correct?
No. I dont want to do kubectl apply whenever I make changes in application manifest annotation. I would rather expect argocd to pick it from git commit as part of sync operation.
@nitishfy - any update ? is this possible with git commit ? or can this be added as feature request ?
2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?
We use v2.13.1+af54ef8 and still see this issue