-
Notifications
You must be signed in to change notification settings - Fork 39.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default the ignorenotfound for delete when selecting objects #63490
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/kubectl/cmd/delete.go
Outdated
@@ -185,40 +211,10 @@ func (o *DeleteOptions) Complete(f cmdutil.Factory, out, errOut io.Writer, args | |||
} | |||
|
|||
func (o *DeleteOptions) Validate(cmd *cobra.Command) error { | |||
if o.DeleteAll && len(o.LabelSelector) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these still belong in Validate()
nit on validation move, and tests are red, lgtm otherwise |
nit fixed |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
1 similar comment
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). If you want to cherry-pick this change to another branch, please follow the instructions here. |
When selecting resources and then deleting them (as opposed to specifically indicating a resource to delete) we should default to not failing if something disappeared partway through. This is quite common when label selecting deletes and GC runs before you get to a dependent object.
I also took the liberty of doing complete work in complete instead of validate.
@kubernetes/sig-cli-maintainers