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

Merged
merged 1 commit into from May 8, 2018

Conversation

Projects
None yet
7 participants
@deads2k
Contributor

deads2k commented May 7, 2018

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.

`kubectl delete` with selection criteria defaults to ignoring not found errors

@kubernetes/sig-cli-maintainers

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented May 7, 2018

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -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 {

This comment has been minimized.

@liggitt

liggitt May 7, 2018

Member

these still belong in Validate()

@liggitt

This comment has been minimized.

Member

liggitt commented May 7, 2018

nit on validation move, and tests are red, lgtm otherwise

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 7, 2018

nit fixed

@deads2k deads2k added the lgtm label May 7, 2018

@fejta-bot

This comment has been minimized.

fejta-bot commented May 7, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@deads2k deads2k added lgtm and removed lgtm labels May 8, 2018

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 8, 2018

/retest

1 similar comment
@deads2k

This comment has been minimized.

Contributor

deads2k commented May 8, 2018

/retest

@soltysh

soltysh approved these changes May 8, 2018

@fejta-bot

This comment has been minimized.

fejta-bot commented May 8, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented May 8, 2018

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.

@k8s-merge-robot k8s-merge-robot merged commit f9fd3c8 into kubernetes:master May 8, 2018

16 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation deads2k authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@deads2k deads2k deleted the deads2k:cli-48-delete branch Jul 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment