Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Make docker registry check smarter #911

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions binderhub/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,18 @@ async def check_jupyterhub_api(self, hub_url):
@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
# should return a 401 status when everything is well
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 = []
Expand Down