Make docker registry check smarter
@@ -68,7 +68,10 @@ class HealthHandler(BaseHandler):
@retry
async def check_docker_registry(self):
"""Check docker registry health"""
- registry = self.settings["registry"]
+ registry = self.settings["registry"].url
+
+ if not registry.endswith("/"):
+ registry += "/"
# docker registries don't have an explicit health check endpoint.
# Instead the recommendation is to query the "root" endpoint which
@@ -76,7 +79,7 @@ class HealthHandler(BaseHandler):
r = await AsyncHTTPClient().fetch(
registry, request_timeout=3, raise_error=False
)
- return r.code == 401
+ return r.code in (200, 401)
async def get(self):
checks = []
