summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2020-11-14 20:10:57 +0100
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2020-11-14 20:18:52 +0100
commit0dad2499a33e3d76eb4508a52c7449224ee1e10b (patch)
tree1e70b1a1ff898cfa4f72bbc2b83bfda1a10aade3 /cmd/podman
parent738d62ea960af439bd545820e1853cbd73464493 (diff)
downloadpodman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.tar.gz
podman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.tar.bz2
podman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.zip
Add support for volume ls --filter label=key=value
Supposed to be able to search for labels with a given value. Previously it meant searching for label key and label value: --filter label=key --filter label=value Add some documentation and integration tests for it as well. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/volumes/list.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/volumes/list.go b/cmd/podman/volumes/list.go
index 5548c9c1b..b0d999765 100644
--- a/cmd/podman/volumes/list.go
+++ b/cmd/podman/volumes/list.go
@@ -73,11 +73,11 @@ func list(cmd *cobra.Command, args []string) error {
lsOpts.Filter = make(map[string][]string)
}
for _, f := range cliOpts.Filter {
- filterSplit := strings.Split(f, "=")
+ filterSplit := strings.SplitN(f, "=", 2)
if len(filterSplit) < 2 {
return errors.Errorf("filter input must be in the form of filter=value: %s is invalid", f)
}
- lsOpts.Filter[filterSplit[0]] = append(lsOpts.Filter[filterSplit[0]], filterSplit[1:]...)
+ lsOpts.Filter[filterSplit[0]] = append(lsOpts.Filter[filterSplit[0]], filterSplit[1])
}
responses, err := registry.ContainerEngine().VolumeList(context.Background(), lsOpts)
if err != nil {