From 4582286ed104a45f187b71f11979b3d22a2a5dff Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Fri, 7 Oct 2022 13:29:14 +0100 Subject: [PATCH] Use docker registry API v2 --- check_stable.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/check_stable.py b/check_stable.py index 0e042cd..0a525a4 100755 --- a/check_stable.py +++ b/check_stable.py @@ -25,11 +25,12 @@ def rust_stable_version(): def tag_exists(tag): """Retrieve our built tags and check we have built a given one""" - url = f'https://registry.hub.docker.com/v1/repositories/{DOCKERHUB_REPO}/tags' + (namespace, repo) = DOCKERHUB_REPO.split("/") + url = f'https://registry.hub.docker.com/v2/namespaces/{namespace}/repositories/{repo}/tags' req = urllib.urlopen(url) data = json.loads(req.read()) req.close() - for x in data: + for x in data['results']: if x['name'] == tag: return True return False