mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
don't delete existing Docker volume if driver unspecified
Before, if the driver parameter wasn't specified, the dockerng state module's volume_present() function would try to delete the volume and recreate it. Now it simply ignores the existing volume's driver setting and returns success. Note that this change assumes that if the driver is unspecified then the user means "I don't care what the driver is", not "I care that the driver matches the Docker default".
This commit is contained in:
parent
d323ad9704
commit
069864d8cb
@ -2145,7 +2145,7 @@ def volume_present(name, driver=None, driver_opts=None):
|
||||
return ret
|
||||
# volume exits, check if driver is the same.
|
||||
volume = volumes[0]
|
||||
if volume['Driver'] != driver:
|
||||
if driver is not None and volume['Driver'] != driver:
|
||||
try:
|
||||
ret['changes']['removed'] = __salt__['dockerng.remove_volume'](name)
|
||||
except Exception as exc:
|
||||
|
Loading…
Reference in New Issue
Block a user