Use `LabeledVolume` interface type instead of manual interface.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-08-11 13:47:01 -04:00
parent 1a72934cd5
commit 6d787dae1a
1 changed files with 5 additions and 11 deletions

View File

@ -589,18 +589,12 @@ func (daemon *Daemon) filterVolumes(vols []volume.Volume, filter filters.Args) (
} }
} }
if filter.Include("label") { if filter.Include("label") {
v, err := daemon.volumes.Get(vol.Name()) v, ok := vol.(volume.LabeledVolume)
if err != nil { if !ok {
return nil, err continue
} }
if v, ok := v.(interface { if !filter.MatchKVList("label", v.Labels()) {
Labels() map[string]string continue
}); ok {
labels := v.Labels()
if !filter.MatchKVList("label", labels) {
continue
}
} }
} }
retVols = append(retVols, vol) retVols = append(retVols, vol)