From f5b68dc2a1397935d092340450653863c62a5be5 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Wed, 16 Oct 2024 09:56:54 -0400 Subject: [PATCH] Improve container provider syncs When a user syncs a Container provider with at least one container that is missing from their local inventory, it breaks their local executions of `broker inventory`. With this change, we reconstruct the "_broker_args" with what limited information is available from the synced container instance. --- broker/providers/container.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/broker/providers/container.py b/broker/providers/container.py index 08749a4..151924f 100644 --- a/broker/providers/container.py +++ b/broker/providers/container.py @@ -17,8 +17,10 @@ def container_info(container_inst): """Return a dict of container information.""" + attr_dict = {"container_host": "Image", "_broker_origin": "Labels/broker.origin"} info = { "_broker_provider": "Container", + "_broker_args": helpers.dict_from_paths(container_inst.attrs, attr_dict), "name": container_inst.name, "hostname": container_inst.id[:12], "image": container_inst.image.tags,