Some CRs occasionally get stuck in a reconciling status and the source-controller logs
{"level":"error","ts":"2021-05-06T16:43:38.163Z","logger":"controller.gitrepository","msg":"Reconciler error","reconciler group":"source.toolkit.fluxcd.io","reconciler kind":"GitRepository","name":"myrepo-gitrepository","namespace":"myns","error":"Operation cannot be fulfilled on gitrepositories.source.toolkit.fluxcd.io \"myrepo-gitrepository\": the object has been modified; please apply your changes to the latest version and try again"}
The finalizer is added/removed via r.Update calls that fail if the object has been changed (we have another CI component that updates the spec fields). Changing these calls to use r.Patch (following the approach used in #202 ) appears to fix the problem.
Some CRs occasionally get stuck in a reconciling status and the source-controller logs
The finalizer is added/removed via
r.Updatecalls that fail if the object has been changed (we have another CI component that updates thespecfields). Changing these calls to user.Patch(following the approach used in #202 ) appears to fix the problem.