From: Dan Mick Date: Tue, 2 Jul 2024 22:18:37 +0000 (-0700) Subject: prune-quay.py: avoid bug deleting -crimson tags X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=740dcfbd7e33b97a226c6c55f02cddd841ca1d8d;p=ceph-build.git prune-quay.py: avoid bug deleting -crimson tags -crimson tags stand sort of alone. Don't delete them when looking for sha1 tags, unless their x86 counterpart () is going to be deleted as well. Signed-off-by: Dan Mick --- diff --git a/quay-pruner/build/prune-quay.py b/quay-pruner/build/prune-quay.py index 4c2614d5..2f026a72 100755 --- a/quay-pruner/build/prune-quay.py +++ b/quay-pruner/build/prune-quay.py @@ -289,11 +289,14 @@ def main(): if args.verbose: print('Skipping %s, present in shaman' % name) continue - if args.verbose: - print( - 'Marking %s for deletion: orphaned sha1 tag' % name - ) - tags_to_delete.add(name) + # -crimson tags don't have full or ref tags to go with. + # Delete them iff the default tag is to be deleted + if (match[2] == '-crimson') and (sha1 in tags_to_delete): + if args.verbose: + print( + 'Marking %s for deletion: orphaned sha1 tag' % name + ) + tags_to_delete.add(name) if args.verbose: print('\nDeleting tags:', sorted(tags_to_delete))