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

podman system prune support prune unused networks #14556

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

sstosh
Copy link
Contributor

@sstosh sstosh commented Jun 10, 2022

This is an enhancement for the podman system prune feature.

In this issue, it is mentioned that 'network prune' should be
wired into 'podman system prune'
#8673

Therefore, I add the function to remove unused networks.

Signed-off-by: Toshiki Sonoda [email protected]

Does this PR introduce a user-facing change?

User enables to remove unused networks using podman system prune command.

@rhatdan
Copy link
Member

rhatdan commented Jun 10, 2022

I thought there was some hesitation with doing this.
@mheon @Luap99 WDYT?

Removing CNI networks was frowned upon since other tools like CRI-O could be using them, as I recall.

@Luap99
Copy link
Member

Luap99 commented Jun 10, 2022

Yeah it could remove external cni networks. However for netavark it should not be a problem. Also we already changed podman system reset to delete all networks so I think it is just logical to do it for prune as well.

cmd/podman/system/prune.go Outdated Show resolved Hide resolved
@sstosh sstosh force-pushed the system-prune-network branch 3 times, most recently from 245fee7 to c169680 Compare June 13, 2022 07:13
@sstosh
Copy link
Contributor Author

sstosh commented Jun 13, 2022

Thank you for reviewing.
I fixed the source code.

pkg/domain/infra/abi/system.go Outdated Show resolved Hide resolved

// Remove all unused netavark networks.
// Does not remove cni networks because it could remove external cni networks.
if ic.Libpod.GetNetworkBackend() == "netavark" {
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to differ here? As said before system reset already removes all cni networks so I see no reason why prune should not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for reviewing. I removed network backend branch.
On the other hand, I think there is a option to remove all CNI networks pruning function from "system reset".
If this options is better, I will try to fix "system reset".

@sstosh sstosh force-pushed the system-prune-network branch 2 times, most recently from dfac865 to 4811cb1 Compare June 14, 2022 05:02
This is an enhancement for the podman system prune feature.

In this issue, it is mentioned that 'network prune' should be
wired into 'podman system prune'
containers#8673

Therefore, I add the function to remove unused networks.

Signed-off-by: Toshiki Sonoda <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jun 14, 2022

@Luap99 @mheon PTAL

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 20, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, sstosh

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 Jun 20, 2022
@Luap99
Copy link
Member

Luap99 commented Jun 20, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2022
@openshift-ci openshift-ci bot merged commit fe8e536 into containers:main Jun 20, 2022
@sstosh sstosh deleted the system-prune-network branch June 21, 2022 01:41
@sstosh sstosh restored the system-prune-network branch July 21, 2022 05:22
@sstosh sstosh deleted the system-prune-network branch July 25, 2022 10:33
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants