From 0ce11572bb6d76ac4dad46fd8b24a12d0b7a3a3f Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 1 Jul 2024 23:49:17 -0700 Subject: [PATCH] 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 --- quay-pruner/build/prune-quay.py | 7 ------- 1 file changed, 7 deletions(-) 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 -- 2.47.3