Skip to content

Commit

Permalink
docker_node_images: inventory uses digest to determine repo if no tags
Browse files Browse the repository at this point in the history
are set

Change-Id: I652f16af96c9424306203705b2c573f79ebb8948
  • Loading branch information
mo-ki committed Sep 10, 2019
1 parent 5957293 commit f85be57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inventory/docker_node_images
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ def inv_docker_node_images(info, inventory_tree, status_data_tree):
status_node = status_data_tree.get_list(path)

for image_id, image in sorted(images.iteritems()):
repodigests = ", ".join(image.get("RepoDigests", []))
fallback_repotag = repodigests.split('@', 1)[:1] if '@' in repodigests else []
inv_node.append({
"repotags": ", ".join(image.get("RepoTags", [])),
"repodigests": ", ".join(image.get("RepoDigests", [])),
"repotags": ", ".join(image.get("RepoTags", fallback_repotag)),
"repodigests": repodigests,
"id": docker_get_short_id(image_id), # pylint: disable=undefined-variable
"creation": image["Created"],
"size": image["VirtualSize"],
Expand Down

0 comments on commit f85be57

Please sign in to comment.