From eb55a805b4532cd65b14f6d2953a2d8da4f3bf81 Mon Sep 17 00:00:00 2001 From: Aurele Oules Date: Mon, 23 Oct 2023 23:27:47 +0200 Subject: [PATCH] Handle container rename --- hoster.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hoster.py b/hoster.py index d87448a..ae6c47e 100644 --- a/hoster.py +++ b/hoster.py @@ -55,6 +55,13 @@ def main(): hosts.pop(container_id) update_hosts_file() + if status=="rename": + container_id = e["id"] + if container_id in hosts: + container = get_container_data(dockerClient, container_id) + hosts[container_id] = container + update_hosts_file() + def get_container_data(dockerClient, container_id): #extract all the info with the docker api