From 8e43e69c5bc7bf0903dd880ed1bd87a2797ecf9b Mon Sep 17 00:00:00 2001 From: Muayyad Alsadi Date: Sat, 14 Sep 2019 00:32:00 +0300 Subject: [PATCH] FIX #41: compare original volume name --- podman_compose.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index 86cff62..eab5d51 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -370,6 +370,7 @@ def mount_dict_vol_to_bind(compose, mount_dict): proj_name = compose.project_name shared_vols = compose.shared_vols if mount_dict["type"]!="volume": return mount_dict + vol_name_orig = mount_dict.get("_source", None) vol_name = mount_dict["source"] 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' @@ -384,7 +385,7 @@ def mount_dict_vol_to_bind(compose, mount_dict): if "bind" not in ret: ret["bind"]={} # 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" else: ret["bind"]["propagation"]="Z"