You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a way to force ArgoCD (>=2.0) to use manifests generated from the repository (again) after a --local sync was performed without starting a synchronization.
For example:
an APP is configured to use sources from a master branch of some repository
local synchronization is done (argocd app sync APP --local path/to/some/repository)
a change in the repository which affects APP is committed to the master branch
now
it's possible to call argocd app diff APP --revision master, the diff will show expected things
but application sync status is Synced (which is expected, since ArgoCD uses manifests persisted in APP's Application object state instead of generating them from the repository)
If I call argocd app sync APP --revision master ArgoCD will forgot local manifests and start tracking repository again (but it will also trigger a synchronization which might be undesirable)
I understand that this is expected behavior and I'm looking for a way to force ArgoCD to start looking at repository again without starting a synchronization. E.g. some automatic mechanism that will forget persisted manifests after a certain amount of time, or an API request that will force ArgoCD to do so (such a request could be called from an external periodic job).
The best solution I found so far is to manually patch state of Application object to remove persisted manifests and force APP's state refresh, using ArgoCD CLI:
and it seems to work (although I'm not 100% sure what will happen if someone else starts another local synchronization at the same time). But maybe there is some better solution (that doesn't look so hacky)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm looking for a way to force ArgoCD (>=2.0) to use manifests generated from the repository (again) after a --local sync was performed without starting a synchronization.
For example:
argocd app sync APP --local path/to/some/repository
)argocd app diff APP --revision master
, the diff will show expected thingsargocd app sync APP --revision master
ArgoCD will forgot local manifests and start tracking repository again (but it will also trigger a synchronization which might be undesirable)I understand that this is expected behavior and I'm looking for a way to force ArgoCD to start looking at repository again without starting a synchronization. E.g. some automatic mechanism that will forget persisted manifests after a certain amount of time, or an API request that will force ArgoCD to do so (such a request could be called from an external periodic job).
The best solution I found so far is to manually patch state of Application object to remove persisted manifests and force APP's state refresh, using ArgoCD CLI:
argocd app patch-resource APP-PARENT-META-APP \ --kind Application \ --resource-name APP \ --patch '{"status": {"operationState": {"operation": {"sync": {"manifests": []}}}}}' argocd app get APP --hard-refresh
and it seems to work (although I'm not 100% sure what will happen if someone else starts another local synchronization at the same time). But maybe there is some better solution (that doesn't look so hacky)?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions