]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
prune-quay.py: remove short_sha1_cache
authorDan Mick <dan.mick@redhat.com>
Tue, 2 Jul 2024 06:49:17 +0000 (23:49 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 2 Jul 2024 22:24:38 +0000 (15:24 -0700)
Not only is it no longer necessary now that we're caching the
entire shaman result, it actually can lead to missing deletions
if the same sha1 validly exists for different builds (like for
centos8 vs centos9, or crimson vs default, etc.)

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

index f470706d06bb2f71103b748c474bc6c5279324a3..d190d7710a1e8f60dfbb5917c1fc416b8b25f35a 100755 (executable)
@@ -10,7 +10,6 @@ QUAYBASE = "https://quay.ceph.io/api/v1"
 REPO = "ceph-ci/ceph"
 
 # cache shaman search results so we only have to ask once
-short_sha1_cache = set()
 sha1_cache = set()
 
 # quay page ranges to fetch; hackable for testing
@@ -123,11 +122,6 @@ def ref_present_in_shaman(ref, short_sha1, el, arch, verbose):
     if ref is None:
         return False
 
-    if short_sha1 in short_sha1_cache:
-        if verbose:
-            print('Found %s in shaman short_sha1_cache' % short_sha1)
-        return True
-
     error, matches = query_shaman(ref, None, el)
     if error:
         print('Shaman request failed')
@@ -141,7 +135,6 @@ def ref_present_in_shaman(ref, short_sha1, el, arch, verbose):
         if match['sha1'][0:7] == short_sha1:
             if verbose:
                 print('Found %s in shaman: sha1 %s' % (ref, match['sha1']))
-            short_sha1_cache.add(short_sha1)
             return True
     return False