From 6d787dae1ae3cd4f2ca062b67592158597f9d40e Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Thu, 11 Aug 2016 13:47:01 -0400 Subject: [PATCH] Carry #21567 Use `LabeledVolume` interface type instead of manual interface. Signed-off-by: Brian Goff --- daemon/list.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/daemon/list.go b/daemon/list.go index 0f1cf33a35..46d7eb18b8 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -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)