ArgoCD and Openshift, application out of sync
In a setup I have I wanted to bootstrap the Openshift cluster as much as I could from git. So I started on the journey, and created an openshift-gitops subscription and an application.
Initially everything worked out perfectly, but once I started changing the certificates or add OAuth settings suddenly my ArgoCD application was always out of sync.
The problem was that Openshift copies certain secrets/configmaps and puts them in a different namespace when you make changes.While copying it also takes in the ArgoCD annotations and labels, meaning that as of that instance ArgoCD sees the resource as managed by itself. However, there is no git resource for that!
While trying to go around that issue I found the solution by adding an annotation on the resource:
argocd.argoproj.io/compare-options: IgnoreExtraneous
However this did not fix my issue and the app was still out of sync.
After searching and testing and talking to ArgoCD developers, it turns out one needs to set that annotation on the ArgoCD Application itself.
Once I did that, my application stayed in sync even though it showed the extra created resources out of sync.
Succes!!!