Skip to content

feat: add --ignore flag to network rm#28391

Open
kyounghunJang wants to merge 1 commit intocontainers:mainfrom
kyounghunJang:feat/add-rm-ignore
Open

feat: add --ignore flag to network rm#28391
kyounghunJang wants to merge 1 commit intocontainers:mainfrom
kyounghunJang:feat/add-rm-ignore

Conversation

@kyounghunJang
Copy link
Copy Markdown
Contributor

@kyounghunJang kyounghunJang commented Mar 27, 2026

Add --ignore to podman network rm so removing a missing network returns success instead of exit code 1.

Keep existing error behavior for networks in use and other failures.

Example result on macOS:

$ podman network rm bogus-net
Error: unable to find network with name or ID bogus: network not found
$ podman network rm --ignore bogus-net

This PR was translated from Korean to English using an LLM.

Fixes: #28363

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

Add --ignore to podman network rm to ignore missing networks.

@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Mar 27, 2026
@packit-as-a-service
Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

Thanks, I have some comments. Also, please fill release note.

Copy link
Copy Markdown
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

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

could you please add a system test to test/system/500-networking.bats ? See the pre-existing tests in that file for network rm .

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

LGTM once @lsm5 and @Honny1 's comments are addressed.

@kyounghunJang
Copy link
Copy Markdown
Contributor Author

@lsm5 @Honny1
Thanks for the feedback. I’ve addressed all of the comments.

Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM

@Honny1
Copy link
Copy Markdown
Member

Honny1 commented Mar 30, 2026

I think CI failure is unrelated.

Copy link
Copy Markdown
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

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

test name should mention --ignore.

}

# bats test_tags=ci:parallel
@test "podman network rm -- bogus" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@test "podman network rm -- bogus" {
@test "podman network rm --ignore bogus" {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lsm5
Thank you for catching my mistake!

Add `--ignore` to `podman network rm` so removing a missing
network returns success instead of exit code 1.

Keep existing error behavior for networks in use and other failures.

This commit message was translated from Korean to English using an LLM.

Fixes: containers#28363
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
@kyounghunJang kyounghunJang requested a review from lsm5 April 7, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change Change to remote API; merits scrutiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --ignore flag to podman network rm

4 participants