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

RFE: Let podman volume prune show the volumes that are going to be removed #8913

Closed
Tronde opened this issue Jan 8, 2021 · 9 comments · Fixed by #9116
Closed

RFE: Let podman volume prune show the volumes that are going to be removed #8913

Tronde opened this issue Jan 8, 2021 · 9 comments · Fixed by #9116
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Tronde
Copy link

Tronde commented Jan 8, 2021

/kind feature

Description

Running podman volume prune you have to confirm the operation but you don't see which volumes actually will be removed after you confirm the command:

$ podman volume prune
WARNING! This will remove all volumes not used by at least one container.
Are you sure you want to continue? [y/N]

I was trapped by the issue #7862. This could have been avoided by showing the volumes that are going to be removed before you confirm the removal. Because the user would have the chance that there is a volume going to be removed that's currently in use by a running container instance. Possible data loss could be prevented this way.

Or at least add an option to the command that will show the volumes that are going to be removed.

Steps to reproduce the issue:

  1. podman volume prune

  2. Hit 'y'

Describe the results you received:

$ podman volume prune
WARNING! This will remove all volumes not used by at least one container.
Are you sure you want to continue? [y/N]

Describe the results you expected:

$ podman volume prune
WARNING! This will remove all volumes not used by at least one container. The following volumes will be removed:
volume1
volume2
...
Are you sure you want to continue? [y/N]

Output of podman version:

podman version 3.0.0-dev

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 8, 2021
@rhatdan
Copy link
Member

rhatdan commented Jan 10, 2021

Good idea. Interested in opening a PR? I think this would make sense for a few of the tools. Note that this could be a bit racy.

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Jan 10, 2021
@Tronde
Copy link
Author

Tronde commented Jan 10, 2021

Thanks. Sad but true I'm not able to open a PR. Because I'm not a developer and most of the source code I don't understand. I don't know go.

So, I hope some Dev who is capable of implementing this would take over to get it done.

I would be able to help testing the implementation, though.

@rhatdan
Copy link
Member

rhatdan commented Jan 10, 2021

No problem, I set this as a good first issue, and we shall see if someone grabs it.

Thanks for your suggestion, and any help you give to the project is appreciated.

@iwita
Copy link

iwita commented Jan 16, 2021

Hello, I am quite a beginner in open-source and completely new to the Podman project.
Could I get this issue assigned?
I made the needed changes but I am not sure how could I test them.

@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Jan 16, 2021
@Luap99
Copy link
Member

Luap99 commented Jan 16, 2021

@iwita I assigned the issue to you. Volume prune tests can be found here https://github.com/containers/podman/blob/master/test/e2e/volume_prune_test.go

@iwita
Copy link

iwita commented Jan 26, 2021

Hello,
I am having some trouble creating tests for this newly added functionality because of the user interaction (yes/no stdin).
Any help would be greatly appreciated :)

@rhatdan
Copy link
Member

rhatdan commented Jan 27, 2021

How about

podman volume prune <<< n | grep VOLUMES

@rhatdan
Copy link
Member

rhatdan commented Jan 27, 2021

You can do that as a system tests. test/system/*.bats

@iwita
Copy link

iwita commented Jan 27, 2021

You can do that as a system tests. test/system/*.bats

@rhatdan Thank you very much for your help!

@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
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
5 participants