Skip to content

Commit

Permalink
check errors for IsNotFound after patching status/spec
Browse files Browse the repository at this point in the history
Signed-off-by: Troy Connor <[email protected]>
  • Loading branch information
troy0820 committed Jul 12, 2024
1 parent 075517f commit 120874b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ func (h *Helper) Patch(ctx context.Context, obj client.Object, opts ...Option) e
if err := h.patch(ctx, obj); err != nil {
errs = append(errs, err)
}

if err := h.patchStatus(ctx, obj); err != nil {
errs = append(errs, err)
if !apierrors.IsNotFound(err) && !obj.GetDeletionTimestamp().IsZero() && len(obj.GetFinalizers()) == 0 {
errs = append(errs, err)
}
}

if len(errs) > 0 {
Expand Down

0 comments on commit 120874b

Please sign in to comment.