Skip to content

add --all-namespaces to kubectl delete #73716

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

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Feb 4, 2019

kubectl delete should support --all-namespaces. Since we now have CRDs, wanting to delete all of a particular type is a more reasonable use-case to support. There are also edges where I want this today.

@kubernetes/sig-cli-maintainers

`kubectl delete --all-namespaces` is a recognized flag.

@enj since you hit it.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 4, 2019
@k8s-ci-robot k8s-ci-robot requested review from dims and eparis February 4, 2019 20:28
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 4, 2019
set -o pipefail

# Runs tests related to kubectl delete --all-namespaces.
run_kubectl_delete_allnamespaces_tests() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to call this from somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to call this from somewhere?

Ah, I guess I did half the refactoring to match openshift.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to call this from somewhere?

fixed

@liggitt
Copy link
Member

liggitt commented Feb 4, 2019

one question on the test, lgtm otherwise

@deads2k deads2k force-pushed the delete-all branch 2 times, most recently from c0c63e1 to e004aa7 Compare February 4, 2019 20:58
@enj
Copy link
Member

enj commented Feb 5, 2019

hack/make-rules/../../hack/verify-gofmt.sh
hack/make-rules/../../hack/verify-shellcheck.sh
/go/src/k8s.io/kubernetes/test/cmd/../../third_party/forked/shell2junit/sh2ju.sh: line 47: run_kubectl_delete_allnamespaces_tests: command not found

@RA489
Copy link

RA489 commented Feb 5, 2019

@deads2k as an helper please run these:
./hack/update-gofmt.sh
./hack/verify-golint.sh
./hack/verify-shellcheck.sh

@deads2k deads2k force-pushed the delete-all branch 4 times, most recently from fd749cf to b2e7201 Compare February 5, 2019 14:13
@k8s-ci-robot
Copy link
Contributor

[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

@deads2k deads2k added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Feb 5, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Feb 5, 2019
@deads2k deads2k removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Feb 5, 2019
@dims
Copy link
Member

dims commented Feb 6, 2019

@liggitt looks like your comment was addressed.

LGTM 👍

@liggitt
Copy link
Member

liggitt commented Feb 6, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2019
@fejta-bot
Copy link

/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 or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit fcb0d60 into kubernetes:master Feb 6, 2019
@@ -177,6 +177,7 @@
./test/cmd/core.sh
./test/cmd/crd.sh
./test/cmd/create.sh
./test/cmd/delete.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this pass lint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants