Skip to content

Commit a61c052

Browse files
committed
Assisted-by: claude-sonnet-4-6
1 parent 4b7a59b commit a61c052

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

internal/controller/imagepolicy_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ func (r *ImagePolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
241241

242242
// Call subreconciler.
243243
result, retErr = r.reconcile(ctx, serialPatcher, obj)
244+
// controller-runtime logs a warning when a Reconcile call returns both
245+
// a non-zero Result and a non-nil error; the Result is ignored in that
246+
// case. Drop the Result when we have an error to keep the log clean.
247+
if retErr != nil {
248+
result = ctrl.Result{}
249+
}
244250
return
245251
}
246252

internal/controller/imagerepository_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ func (r *ImageRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Requ
193193

194194
// Call subreconciler.
195195
result, retErr = r.reconcile(ctx, serialPatcher, obj, start)
196+
// controller-runtime logs a warning when a Reconcile call returns both
197+
// a non-zero Result and a non-nil error; the Result is ignored in that
198+
// case. Drop the Result when we have an error to keep the log clean.
199+
if retErr != nil {
200+
result = ctrl.Result{}
201+
}
196202
return
197203
}
198204

0 commit comments

Comments
 (0)