From: Dan Mick Date: Tue, 2 Jul 2024 06:49:17 +0000 (-0700) Subject: prune-quay.py: remove short_sha1_cache X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ce11572bb6d76ac4dad46fd8b24a12d0b7a3a3f;p=ceph-build.git prune-quay.py: remove short_sha1_cache 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 --- diff --git a/quay-pruner/build/prune-quay.py b/quay-pruner/build/prune-quay.py index f470706d..d190d771 100755 --- a/quay-pruner/build/prune-quay.py +++ b/quay-pruner/build/prune-quay.py @@ -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