-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add volume prune --filter support #8689
Add volume prune --filter support #8689
Conversation
// VolumePruneOptions describes the options needed | ||
// to prune a volume from the CLI | ||
type VolumePruneOptions struct { | ||
Filters url.Values `json:"filters" schema:"filters"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was conflicted whether to use url.Values
or the underlying type of map[string][]string
for the filters. I saw it both ways throughout the codebase. I settled on url.Values
but I don't feel strongly either way. I thought I remember seeing some mention of a refactor for filters so hopefully the inconsistency can be fixed then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keep it for now. It will be reworked soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @bblenard.
This looks really good.
You still have to document the --filter
flag in docs/source/markdown/podman-volume-prune.1.md
and fix the bindings test in pkg/bindings/test/volumes_test.go
.
- scope | ||
- label | ||
- opt | ||
- dangling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetize this list please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: c8a7b9a
Should I squash my feedback commits so the CI pipeline goes? (I think that is the issue) |
Yes, please
…On Fri, Dec 11, 2020, 21:07 Baron Lenardson ***@***.***> wrote:
Should I squash my feedback commits so the CI pipeline goes? (I think that
is the issue)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8689 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCC4GWRR4AW37V7V5H3SULF6BANCNFSM4UV6SJOA>
.
|
0a39fda
to
6e8217d
Compare
This change adds support for the `--filter` / `?filters` arguments on the `podman volume prune` subcommand. * Adds ParseFilterArgumentsIntoFilters helper for consistent Filter string slice handling * Adds `--filter` support to podman volume prune cli * Adds `?filters...` support to podman volume prune api * Updates apiv2 / e2e tests Closes containers#8672 Signed-off-by: Baron Lenardson <[email protected]>
6e8217d
to
a0204ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bblenard, Luap99 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 |
/lgtm |
@@ -214,7 +214,7 @@ func (ic *ContainerEngine) SystemPrune(ctx context.Context, options entities.Sys | |||
systemPruneReport.ImagePruneReport.Report.Id = append(systemPruneReport.ImagePruneReport.Report.Id, results...) | |||
} | |||
if options.Volume { | |||
volumePruneReport, err := ic.pruneVolumesHelper(ctx) | |||
volumePruneReport, err := ic.pruneVolumesHelper(ctx, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be passing down the prune filters.
podman system prune --filter should be passed down to volume helper as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was my mistake. I can open a PR for that tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks,
BTW great job on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change adds support for the
--filter
/?filters
arguments onthe
podman volume prune
subcommand.Filter string slice handling
--filter
support to podman volume prune cli?filters...
support to podman volume prune apiCloses #8672
Signed-off-by: Baron Lenardson [email protected]