Description
We are using ArgoCD to manage both the kube-arangodb operator install as well as a number of ArangoDB deployment objects. I noticed today that some backups that are being scheduled by our BackupPolicy are simply missing. Looking through the event logs, it looks like those backups were indeed created, and then subsequently deleted by ArgoCD.
I believe that what has been happening is that the backup is created on the schedule without an ownerReference object by the policy handler without an ownerReference but it does do a copy of the annotations from the deployment such as argocd.argoproj.io/instance
. Then some job is coming along and adding that ownerReference to the backup object. However, if ArgoCD tries to sync with prune
set to true
on the application in the meantime, it deletes the backup object. This happens because at that moment the object says it's managed by an ArgoCD project (argocd.argoproj.io/instance
is set), but the application doesn't have that resource and there's no ownerReference to follow so ArgoCD can know that it's owned by the cluster.
I think that ArgoCD is behaving correctly in this case, and that the ownerReference should be added to the object by the policy handler at creation time.