Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/controller/imagepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ func (r *ImagePolicyReconciler) reconcile(ctx context.Context, sp *patch.SerialP
defer func() {
rs := pkgreconcile.NewResultFinalizer(isSuccess, readyMsg)
retErr = rs.Finalize(obj, result, retErr)
// controller-runtime logs a warning and ignores Result when Reconcile
// returns both a non-zero Result and a non-nil error. Clear the Result
// whenever there is an error so the log stays clean.
if retErr != nil {
result = ctrl.Result{}
}

// Presence of reconciling means that the reconciliation didn't succeed.
// Set the Reconciling reason to ProgressingWithRetry to indicate a
Expand Down
6 changes: 6 additions & 0 deletions internal/controller/imagerepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ func (r *ImageRepositoryReconciler) reconcile(ctx context.Context, sp *patch.Ser
readyMsg := fmt.Sprintf("successful scan: found %d tags with checksum %s", numFoundTags, tagsChecksum)
rs := reconcile.NewResultFinalizer(isSuccess, readyMsg)
retErr = rs.Finalize(obj, result, retErr)
// controller-runtime logs a warning and ignores Result when Reconcile
// returns both a non-zero Result and a non-nil error. Clear the Result
// whenever there is an error so the log stays clean.
if retErr != nil {
result = ctrl.Result{}
}

// Presence of reconciling means that the reconciliation didn't succeed.
// Set the Reconciling reason to ProgressingWithRetry to indicate a
Expand Down