mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-22 16:03:16 +01:00
FIX #41: compare original volume name
This commit is contained in:
parent
4c07e875a0
commit
8e43e69c5b
@ -370,6 +370,7 @@ def mount_dict_vol_to_bind(compose, mount_dict):
|
|||||||
proj_name = compose.project_name
|
proj_name = compose.project_name
|
||||||
shared_vols = compose.shared_vols
|
shared_vols = compose.shared_vols
|
||||||
if mount_dict["type"]!="volume": return mount_dict
|
if mount_dict["type"]!="volume": return mount_dict
|
||||||
|
vol_name_orig = mount_dict.get("_source", None)
|
||||||
vol_name = mount_dict["source"]
|
vol_name = mount_dict["source"]
|
||||||
print("podman volume inspect {vol_name} || podman volume create {vol_name}".format(vol_name=vol_name))
|
print("podman volume inspect {vol_name} || podman volume create {vol_name}".format(vol_name=vol_name))
|
||||||
# podman volume list --format '{{.Name}}\t{{.MountPoint}}' -f 'label=io.podman.compose.project=HERE'
|
# podman volume list --format '{{.Name}}\t{{.MountPoint}}' -f 'label=io.podman.compose.project=HERE'
|
||||||
@ -384,7 +385,7 @@ def mount_dict_vol_to_bind(compose, mount_dict):
|
|||||||
if "bind" not in ret:
|
if "bind" not in ret:
|
||||||
ret["bind"]={}
|
ret["bind"]={}
|
||||||
# if in top level volumes then it's shared bind-propagation=z
|
# if in top level volumes then it's shared bind-propagation=z
|
||||||
if vol_name in shared_vols:
|
if vol_name_orig and vol_name_orig in shared_vols:
|
||||||
ret["bind"]["propagation"]="z"
|
ret["bind"]["propagation"]="z"
|
||||||
else:
|
else:
|
||||||
ret["bind"]["propagation"]="Z"
|
ret["bind"]["propagation"]="Z"
|
||||||
|
Loading…
Reference in New Issue
Block a user