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

list the volumes to be deleted without forcing #8990

Closed
wants to merge 61 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
223bdb7
list the volumes to be deleted without forcing
Jan 16, 2021
c180fd5
lists filtered unused volumes in non-force mode
Jan 17, 2021
08279ef
list the volumes to be deleted without forcing
Jan 16, 2021
64aa5d5
Merge branch 'ls-before-deleting' of github.com:iwita/podman into ls-…
Jan 26, 2021
3e36bd3
Rename AutocompletePortCommand func
Jan 16, 2021
4b8fdfe
Allow podman push to push manifest lists
rhatdan Jan 15, 2021
e890150
Create release notes for V3.0.0
rhatdan Jan 17, 2021
7e03a79
make: generate bindings: use vendor
vrothberg Jan 17, 2021
0307600
simplify bindings generation
vrothberg Jan 17, 2021
6381fa6
golangci-lint: install to ./bin
vrothberg Jan 17, 2021
aa03f51
hack/install_golangci.sh: smarter install
vrothberg Jan 17, 2021
cf4712c
[CI:DOCS]Do not run compose tests with CI:DOCS
baude Jan 18, 2021
5b1a867
ginkgo: install on demand via `go get -u`
vrothberg Jan 18, 2021
4569861
Add binding options for container|pod exists
baude Jan 18, 2021
790ef83
runner.sh : deal with bash 'set -e'
edsantiago Jan 18, 2021
f439358
[CI:DOCS] fix go-md2man HTMLSpan warnings
edsantiago Jan 19, 2021
d78c671
podman network exists
Jan 18, 2021
21472b8
CI: smoke test: insist on adding tests on PRs
edsantiago Jan 7, 2021
a6264d9
Revert "ginkgo: install on demand via `go get -u`"
vrothberg Jan 20, 2021
d2ee661
make bindings generation more robuts
vrothberg Jan 19, 2021
4b676a6
make bindings generation explicit
vrothberg Jan 19, 2021
feca19a
Cirrus: add bindings checks
vrothberg Jan 19, 2021
98a9493
Make generate systemd --new robust against double curly braces
Jan 20, 2021
25c1cc8
Fix handling of container remove
rhatdan Jan 18, 2021
997f374
Set log driver for compatability containers
baude Jan 19, 2021
77ad5e7
[CI:DOCS] Update project name in Code of Conduct
TomSweeneyRedHat Jan 20, 2021
adc42d9
Use random network names in the e2e tests
Jan 20, 2021
659f44c
Move the cni lock file into the cni config dir
Jan 20, 2021
f507565
[CI:DOCS] Cirrus: Skip smoke task on branch-push
cevich Jan 20, 2021
b5bd462
podman volume exists
Jan 19, 2021
e3dc193
vendor: update rootlesskit to v0.12.0
giuseppe Jan 21, 2021
be778de
rootlessport: set source IP to slirp4netns device
giuseppe Jan 21, 2021
6caa4d0
libpod: move slirp magic IPs to consts
giuseppe Jan 21, 2021
6d0cdf8
Add a notice to remove pod before starting service
cognition9144 Jan 21, 2021
01e62c7
Turn on some remote test
rhatdan Jan 22, 2021
496180d
podman manifest exists
Jan 22, 2021
d89174a
Accept and ignore 'null' as value for X-Registry-Auth
mlegenovic Jan 19, 2021
7cc8112
Small API test improvement for compatibility search endpoint
mlegenovic Jan 23, 2021
32030d4
Bump golang.org/x/crypto
invalid-email-address Jan 23, 2021
cecf844
networking: lookup child IP in networks
giuseppe Jan 22, 2021
6ddae76
swagger.go: Fix compilation error
siretart Jan 24, 2021
adc4fb4
disable dnsname when --internal
baude Jan 21, 2021
cad6584
Fix fish completion issue if the command is prefixed with a space
Jan 24, 2021
c5e2da6
Fix typo
ChaosEx Jan 23, 2021
43438d7
Bump github.com/google/uuid from 1.1.5 to 1.2.0
dependabot-preview[bot] Jan 25, 2021
1519217
System tests: cover gaps from the last month
edsantiago Jan 25, 2021
9bf0dc1
Ensure shutdown handler access is syncronized
mheon Jan 25, 2021
b69fac0
Pass DefaultMountsFile to podman build
rhatdan Jan 25, 2021
7d81bd0
Fix --arch and --os flags to work correctly
rhatdan Jan 25, 2021
29d4c1c
Fixup search
rhatdan Jan 22, 2021
04df39c
Fix man page for fuse-overlayfs config in rootless mode
Dec 17, 2020
12057fc
Cirrus: Upload swagger YAML in every context
cevich Jan 19, 2021
cba57e7
libpod: add (*Container).ResolvePath()
vrothberg Jan 22, 2021
8bb5421
workdir presence checks
vrothberg Jan 21, 2021
8cb5496
api: fix import image swagger definition
Jan 20, 2021
be4d0f7
[CI:DOCS]update state of restful service
baude Jan 26, 2021
9d940c5
list the volumes to be deleted without forcing
Jan 16, 2021
d47ba6b
tests
Jan 26, 2021
9e46e50
Merge branch 'ls-before-deleting' of github.com:iwita/podman into ls-…
Jan 26, 2021
e449cc4
Merge branch 'master' of github.com:iwita/podman
Jan 26, 2021
8d3496d
Merge branch 'master' of github.com:iwita/podman into ls-before-deleting
Jan 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cmd/podman/volumes/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func init() {
func prune(cmd *cobra.Command, args []string) error {
var (
pruneOptions = entities.VolumePruneOptions{}
listOptions = entities.VolumeListOptions{}
)
// Prompt for confirmation if --force is not set
force, err := cmd.Flags().GetBool("force")
Expand All @@ -58,7 +59,18 @@ func prune(cmd *cobra.Command, args []string) error {
}
if !force {
reader := bufio.NewReader(os.Stdin)
fmt.Println("WARNING! This will remove all volumes not used by at least one container.")
fmt.Println("WARNING! This will remove all volumes not used by at least one container. The following volumes will be removed:")
listOptions.Filter, err = filters.ParseFilterArgumentsIntoFilters(filter)
Copy link
Member

Choose a reason for hiding this comment

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

This would list all volumes, not just the ones that would be removed. podman volume prune is going to prune the volumes that are not in use.

I believe you would need to have a filter to show volumes that are not in use.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @rhatdan.
Yes, you are right. Didn't consider the actual use of the prune command.
Now I added a function in cmd/podman/volumes/prune.go in order to get the used volumes and remove them from the available ones for pruning.

if err != nil {
return err
}
filteredVolumes, err := registry.ContainerEngine().VolumeList(context.Background(), listOptions)
if err != nil {
return err
}
for _, fv := range filteredVolumes {
fmt.Println(fv.Name)
}
fmt.Print("Are you sure you want to continue? [y/N] ")
answer, err := reader.ReadString('\n')
if err != nil {
Expand Down