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

system: Adds support for removing all named destination via --all #12213

Merged

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Nov 8, 2021

Adds support of dropping all named destination from system connections via --all.

Closes: #12018

@flouthoc
Copy link
Collaborator Author

flouthoc commented Nov 8, 2021

@edsantiago PTAL

@flouthoc flouthoc force-pushed the system-connection-rm-all branch 2 times, most recently from 31527af to 9c87157 Compare November 8, 2021 11:14

if len(args) < 1 {
return errors.New("accepts 1 arg(s), received 0")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also need to check for >1 args

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes fixed

@edsantiago
Copy link
Collaborator

LGTM once the more-than-one-arg bug is fixed. Friendly suggestion:

diff --git a/test/system/272-system-connection.bats b/test/system/272-system-connection.bats
index 5a90d9398..14c4f6664 100644
--- a/test/system/272-system-connection.bats
+++ b/test/system/272-system-connection.bats
@@ -34,10 +34,7 @@ function teardown() {
         | xargs -l1 --no-run-if-empty umount

     # Remove all system connections
-    run_podman system connection ls --format json
-    while read name; do
-        run_podman system connection rm "$name"
-    done < <(jq -r '.[].Name' <<<"$output")
+    run_podman system connection rm --all

     basic_teardown
 }

cfg, err := config.ReadCustomConfig()
if err != nil {
return err
}

if cmd.Flags().Changed("all") {
Copy link
Member

Choose a reason for hiding this comment

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

No reason to check Changed. If All is set we should do it, admittedly this would be a strange default to set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan ah yes not needed. Removed in last commit :)

Adds support of dropping all named destination from system connections via `--all`.

Closes: containers#12018

Signed-off-by: Aditya Rajan <arajan@redhat.com>
@mheon
Copy link
Member

mheon commented Nov 8, 2021

LGTM once tests go green

@flouthoc
Copy link
Collaborator Author

flouthoc commented Nov 8, 2021

@mheon @edsantiago @rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Nov 8, 2021

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 8, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, rhatdan

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2021
@openshift-merge-robot openshift-merge-robot merged commit 22ef488 into containers:main Nov 8, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: podman system connection rm --all
5 participants