summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorClement Verna <cverna@tutanota.com>2019-06-04 12:58:48 +0200
committerClement Verna <cverna@tutanota.com>2019-06-04 12:58:48 +0200
commit34421de5f05677022f79a69e02b7a3ddd638a757 (patch)
tree2476fc1effa68472b24d0d09e0cf3b1f740b83e4 /library
parent5acaa0fbc563ada407f9a19451615c4a5571c95d (diff)
downloadansible-34421de5f05677022f79a69e02b7a3ddd638a757.zip
ansible-34421de5f05677022f79a69e02b7a3ddd638a757.tar.gz
ansible-34421de5f05677022f79a69e02b7a3ddd638a757.tar.xz
delete_old_oci_images: manage repositories that don't have tags
Signed-off-by: Clement Verna <cverna@tutanota.com>
Diffstat (limited to 'library')
-rw-r--r--library/delete_old_oci_images.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/library/delete_old_oci_images.py b/library/delete_old_oci_images.py
index 8b9d125..c906797 100644
--- a/library/delete_old_oci_images.py
+++ b/library/delete_old_oci_images.py
@@ -112,8 +112,13 @@ def main():
if not resp.ok:
result["stdout_lines"].append("Failed to get the list of tags for {}".format(repo))
- # For each tag get the maninfest
+
image = resp.json()
+ # Log the repositories that don't have any tags
+ if image["tags"] is None:
+ result["stdout_lines"].append("{repo} does not have any tags".format(repo))
+ continue
+ # For each tag get the maninfest
for tag in image["tags"]:
resp = s.get("{}/v2/{}/manifests/{}".format(registry, repo, tag))
if not resp.ok: