Skip to content

small reconciler bug (result + error returned) when error occurred #661

@applike-ss

Description

@applike-ss

Hello,

It seems that the image-reflector-controllers reconciler is always returning the result and error object without checking whether the error is not nil.
I do see these messages upon error:

Warning: Reconciler returned both a non-zero result and a non-nil error. The result will always be ignored if the error is non-nil and the non-nil error causes reqeueuing with exponential backoff. For more details, see: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile#Reconciler

I suggest to change this:

to something like this:

if retErr != nil {
  return nil, retErr
}

return result, nil

Same can be applied for the imagepolicy controller:

There might be other flux components doing the same, but I didn't check them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions