From 6c78edaf7f22bfe3bd731855f767b9fa3c7d8549 Mon Sep 17 00:00:00 2001 From: "Kai Qiang Wu(Kennan)" Date: Thu, 3 Mar 2016 07:23:49 +0000 Subject: [PATCH] Fix the driver name empty case As drivername maybe "" in hostconfig, so we should not directly print dirvername with var drivername, instead, we use the real driver name property to print it. Fixes: #20900 Signed-off-by: Kai Qiang Wu(Kennan) --- volume/store/store.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/volume/store/store.go b/volume/store/store.go index 041c1346bb..8e023df45b 100644 --- a/volume/store/store.go +++ b/volume/store/store.go @@ -194,12 +194,14 @@ func (s *VolumeStore) create(name, driverName string, opts map[string]string) (v } } - logrus.Debugf("Registering new volume reference: driver %q, name %q", driverName, name) vd, err := volumedrivers.GetDriver(driverName) + if err != nil { return nil, &OpErr{Op: "create", Name: name, Err: err} } + logrus.Debugf("Registering new volume reference: driver %q, name %q", vd.Name(), name) + if v, _ := vd.Get(name); v != nil { return v, nil }