headers = {'Accept': 'application/json'}
url = f'https://{self.api_domain}/v2/{image}/tags/list'
while True:
- r = requests.get(url, headers=headers)
+ try:
+ r = requests.get(url, headers=headers)
+ except requests.exceptions.ConnectionError as e:
+ msg = f"Cannot get tags from url '{url}': {e}"
+ raise ValueError(msg) from e
if r.status_code == 401:
if 'Authorization' in headers:
raise ValueError('failed authentication')
"registry": reg_name,
"bare_image": bare_image,
}
- ls = reg.get_tags(bare_image)
+
+ try:
+ ls = reg.get_tags(bare_image)
+ except ValueError as e:
+ raise OrchestratorError(f'{e}')
if not tags:
for t in ls:
if t[0] != 'v':