delete_old_oci_images: manage repositories that don't have tags
Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
parent
5acaa0fbc5
commit
34421de5f0
1 changed files with 6 additions and 1 deletions
|
@ -112,8 +112,13 @@ def main():
|
||||||
if not resp.ok:
|
if not resp.ok:
|
||||||
result["stdout_lines"].append("Failed to get the list of tags for {}".format(repo))
|
result["stdout_lines"].append("Failed to get the list of tags for {}".format(repo))
|
||||||
|
|
||||||
# For each tag get the maninfest
|
|
||||||
image = resp.json()
|
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"]:
|
for tag in image["tags"]:
|
||||||
resp = s.get("{}/v2/{}/manifests/{}".format(registry, repo, tag))
|
resp = s.get("{}/v2/{}/manifests/{}".format(registry, repo, tag))
|
||||||
if not resp.ok:
|
if not resp.ok:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue