From 9f07a74a6438136d20e58f67a8654abc8917cfaa Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Sat, 27 Jan 2024 15:59:19 +0100 Subject: [PATCH] reconciler/managed: keep trying to update critical annotation until ctx canceled Signed-off-by: Dr. Stefan Schimanski (cherry picked from commit 7d7a4e927336b3d601dc390d3e8f65358761e2c2) --- pkg/reconciler/managed/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/reconciler/managed/api.go b/pkg/reconciler/managed/api.go index 8ab4aeeaf..3a6a3df46 100644 --- a/pkg/reconciler/managed/api.go +++ b/pkg/reconciler/managed/api.go @@ -174,7 +174,9 @@ func NewRetryingCriticalAnnotationUpdater(c client.Client) *RetryingCriticalAnno // case of a conflict error. func (u *RetryingCriticalAnnotationUpdater) UpdateCriticalAnnotations(ctx context.Context, o client.Object) error { a := o.GetAnnotations() - err := retry.OnError(retry.DefaultRetry, resource.IsAPIError, func() error { + err := retry.OnError(retry.DefaultRetry, func(err error) bool { + return !errors.Is(err, context.Canceled) + }, func() error { err := u.client.Update(ctx, o) if kerrors.IsConflict(err) { if getErr := u.client.Get(ctx, types.NamespacedName{Name: o.GetName()}, o); getErr != nil {