Skip to content

Commit

Permalink
reconciler/managed: keep trying to update critical annotation until c…
Browse files Browse the repository at this point in the history
…tx canceled

Signed-off-by: Dr. Stefan Schimanski <[email protected]>
(cherry picked from commit 7d7a4e9)
  • Loading branch information
sttts authored and github-actions[bot] committed Jan 29, 2024
1 parent f4932e3 commit 9f07a74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/reconciler/managed/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9f07a74

Please sign in to comment.