Merge pull request #11591 from ruanxin/use_wrapped_error

Use wrapped error so that ErrNoObjectsVisited can be compared
pull/12272/head
Joe Julian 1 year ago committed by GitHub
commit 02ef594a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -493,10 +493,8 @@ func delete(c *Client, resources ResourceList, propagation metav1.DeletionPropag
return nil return nil
}) })
if err != nil { if err != nil {
// Rewrite the message from "no objects visited" if that is what we got if errors.Is(err, ErrNoObjectsVisited) {
// back err = fmt.Errorf("object not found, skipping delete: %w", err)
if err == ErrNoObjectsVisited {
err = errors.New("object not found, skipping delete")
} }
errs = append(errs, err) errs = append(errs, err)
} }

Loading…
Cancel
Save