mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Carry #21567
Use `LabeledVolume` interface type instead of manual interface. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
1a72934cd5
commit
6d787dae1a
1 changed files with 5 additions and 11 deletions
|
@ -589,18 +589,12 @@ func (daemon *Daemon) filterVolumes(vols []volume.Volume, filter filters.Args) (
|
|||
}
|
||||
}
|
||||
if filter.Include("label") {
|
||||
v, err := daemon.volumes.Get(vol.Name())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
v, ok := vol.(volume.LabeledVolume)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if v, ok := v.(interface {
|
||||
Labels() map[string]string
|
||||
}); ok {
|
||||
labels := v.Labels()
|
||||
|
||||
if !filter.MatchKVList("label", labels) {
|
||||
continue
|
||||
}
|
||||
if !filter.MatchKVList("label", v.Labels()) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
retVols = append(retVols, vol)
|
||||
|
|
Loading…
Reference in a new issue