Skip to content

Commit

Permalink
Improve container provider syncs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JacobCallahan committed Oct 17, 2024
1 parent 03456dc commit f5b68dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions broker/providers/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f5b68dc

Please sign in to comment.