Skip to content
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

Do not display help when deleting all pods/containers #1147

Merged
merged 4 commits into from
May 2, 2023

Conversation

champtar
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Running crictl rmp -a or crictl rm -a with nothing to delete was displaying the help text instead of saying that there was nothing to delete.

Which issue(s) this PR fixes:

Fixes #1144

Special notes for your reviewer:

Does this PR introduce a user-facing change?

'crictl rm(p) -a' now properly says when there is no containers/pods to delete instead of displaying help text

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 28, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 28, 2023
cmd/crictl/container.go Show resolved Hide resolved
cmd/crictl/container.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 28, 2023
@champtar champtar force-pushed the fix-empty-rm branch 3 times, most recently from cda696a to 33f097a Compare April 29, 2023 14:46
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 29, 2023
@champtar champtar force-pushed the fix-empty-rm branch 2 times, most recently from e39441a to c35a217 Compare April 29, 2023 17:33
@champtar
Copy link
Contributor Author

@SergeyKanzhelev CI is good now, tell me if the tests changes are too intrusive

Running `crictl rmp -a` or `crictl rm -a` with nothing
to delete was displaying the help text instead of saying
that there was nothing to delete.

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
'crictl rmi' can take multiple IMAGE-ID, -a and/or -p
If we pass nothing, display help text

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
This is a generic version of the CrictlExpect* allowing
tests such as Exit(0), empty stdout, specific stderr.
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2023
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Thank you!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: champtar, saschagrunert, SergeyKanzhelev

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2023
@k8s-ci-robot k8s-ci-robot merged commit fc063ec into kubernetes-sigs:master May 2, 2023
17 checks passed
@champtar champtar deleted the fix-empty-rm branch June 16, 2023 11:42
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. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'crictl rm(p) -af' display help when there is nothing to delete
5 participants