fix volume driver deletions prevents recreation of volume issue

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: 64d0592d41e96ac5c522c21d9270485e72c80231
Component: engine
This commit is contained in:
Wentao Zhang
2016-07-01 14:46:41 +00:00
committed by Brian Goff
parent 5c99e2a951
commit 2f34129ae0

View File

@ -269,7 +269,10 @@ func (s *VolumeStore) create(name, driverName string, opts, labels map[string]st
if v.DriverName() != driverName && driverName != "" && driverName != volume.DefaultDriverName {
return nil, errNameConflict
}
return v, nil
// check exist in driver
if driverName == "" || driverName == volume.DefaultDriverName {
return v, nil
}
}
// Since there isn't a specified driver name, let's see if any of the existing drivers have this volume name