Merge pull request #17 from aureleoules/develop

Handle container rename
This commit is contained in:
David Darias 2023-10-23 18:23:22 -04:00 committed by GitHub
commit 7a5eeb03e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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