diff --git a/dockerhub.py b/dockerhub.py index 435ce2d..990dc16 100644 --- a/dockerhub.py +++ b/dockerhub.py @@ -81,6 +81,16 @@ def get_remote_image_id(self, namespace, image, tag): ) metadata = json.loads(resp.content.decode("utf-8")) + try: + print(f"DEBUG: remote image last pushed: {metadata['images'][0]['last-pushed']}") + print(f"DEBUG: remote image status: {metadata['images'][0]['status']}") + print(f"DEBUG: repository tag status: {metadata['status']}") + print(f"DEBUG: repository tag last updated: {metadata['last_updated']}") + print(f"DEBUG: repository tag last pushed: {metadata['tag_last_pushed']}") + except KeyError as e: + print(f"KeyError encountered while accessing metadata: {e}") + except IndexError as e: + print(f"IndexError encountered while accessing metadata: {e}") return metadata["images"][0]["digest"] except Exception as e: print("Can't get remote image id: {}".format(e)) diff --git a/registry.py b/registry.py index 9963f97..4b5d69d 100644 --- a/registry.py +++ b/registry.py @@ -105,4 +105,8 @@ def correctly_pushed(self, namespace, repo, tag): remote_id = self.get_remote_image_id(namespace, repo, tag) if remote_id is None: return True + try: + print(f"DEBUG: Comparing local_id and remote_id, local_id: {local_id}, remote_id: {remote_id}") + except NameError as e: + print(f"Error: {e}. Ensure 'local_id' and 'remote_id' are defined before comparing.") return local_id == remote_id