]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
prune-quay.py: avoid bug deleting -crimson tags
authorDan Mick <dan.mick@redhat.com>
Tue, 2 Jul 2024 22:18:37 +0000 (15:18 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 2 Jul 2024 22:24:38 +0000 (15:24 -0700)
<sha1>-crimson tags stand sort of alone.  Don't delete them when
looking for sha1 tags, unless their x86 counterpart (<sha1>) is
going to be deleted as well.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
quay-pruner/build/prune-quay.py

index 4c2614d530f52e076bd086137626ce2426ec1f8c..2f026a72538b98000dacc869e3f8750e5f3b3605 100755 (executable)
@@ -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)
+            # <sha1>-crimson tags don't have full or ref tags to go with.
+            # Delete them iff the default <sha1> 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))