This commit is contained in:
2025-11-30 15:57:28 +01:00
parent cfb619f3c3
commit 3fbf904a6c
2 changed files with 11 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ def ensure_labels_as_string(labels):
def convert_compose_to_swarm(data):
services = data.get("services", {})
input(services)
#input(services)
for name, svc in services.items():
print(f"Converting service: {name} , svc: {svc}")
if name in ["container_name", "restart", "depends_on"]:
@@ -85,7 +85,7 @@ def convert_compose_to_swarm(data):
# 6) Convert ports to long format
if "ports" in svc:
input(svc)
#input(svc)
svc["ports"] = convert_ports(svc["ports"])
# 7) Remove container_name (not allowed in Swarm)
@@ -96,7 +96,7 @@ def convert_compose_to_swarm(data):
def main():
with open(INPUT_FILE, "r") as f:
compose = yaml.safe_load(f)
input(compose)
#input(compose)
swarm = convert_compose_to_swarm(compose)
with open(OUTPUT_FILE, "w") as f: