Skip to content

Failure to apply finalizer on GitRepository CRs #357

@cjnosal

Description

@cjnosal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions