Skip to content

Commit

Permalink
Check for absence of repository
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteinberg committed Aug 10, 2023
1 parent 750f46a commit 962cc12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion update_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ def remote_tag_exists(tag):

# can we assume https?
r = requests.get(f'https://{host}/v2/{repository}/tags/list')
return version in r.json()['tags']
if r.status_code == 404:
# this repository doesn't exist yet; there may be other conditions
# we should check here
return False
else:
return version in r.json()['tags']


def main(docker_compose_path='docker-compose.yml', action='load'):
Expand Down

0 comments on commit 962cc12

Please sign in to comment.