Skip to content

Commit 6f06154

Browse files
authored
Merge pull request #10787 from troy0820/troy0820/patch-ignore-option
🐛Check errors for IsNotFound after patching spec and status
2 parents afe7338 + c8ae301 commit 6f06154

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util/patch/patch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ func (h *Helper) Patch(ctx context.Context, obj client.Object, opts ...Option) e
146146
if err := h.patch(ctx, obj); err != nil {
147147
errs = append(errs, err)
148148
}
149+
149150
if err := h.patchStatus(ctx, obj); err != nil {
150-
errs = append(errs, err)
151+
if !(apierrors.IsNotFound(err) && !obj.GetDeletionTimestamp().IsZero() && len(obj.GetFinalizers()) == 0) {
152+
errs = append(errs, err)
153+
}
151154
}
152155

153156
if len(errs) > 0 {

0 commit comments

Comments
 (0)