Skip to content

Commit e96ebf8

Browse files
author
Marko Mikulicic
committed
Fix pinging an unauthenticated v2 registry
1 parent be73aaf commit e96ebf8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docker/utils/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def ping(url):
129129
except Exception:
130130
return False
131131
else:
132-
return res.status_code < 400
132+
# We don't send yet auth headers
133+
# and a v2 registry will respond with status 401
134+
return res.status_code == 401 or res.status_code < 400
133135

134136

135137
def _convert_port_binding(binding):

0 commit comments

Comments
 (0)