Skip to content

Commit 2ed984f

Browse files
committed
fixes to make local registry (unauthenticated) usable
1 parent cd25b41 commit 2ed984f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

binderhub/builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ async def get(self, provider_prefix, _unescaped_spec):
291291
if self.settings['use_registry']:
292292
for _ in range(3):
293293
try:
294-
image_manifest = await self.registry.get_image_manifest(*'/'.join(image_name.split('/')[-2:]).split(':', 1))
294+
image_manifest = await self.registry.get_image_manifest(*'/'.join(image_name.split('/')[-2:]).rsplit(':', 1))
295295
image_found = bool(image_manifest)
296296
break
297297
except HTTPClientError:

binderhub/health.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async def check_docker_registry(self):
133133
# don't care if the image actually exists or not
134134
image_name = self.settings["image_prefix"] + "some-image-name:12345"
135135
await registry.get_image_manifest(
136-
*'/'.join(image_name.split('/')[-2:]).split(':', 1)
136+
*'/'.join(image_name.split('/')[-2:]).rsplit(':', 1)
137137
)
138138
return True
139139

binderhub/registry.py

+4
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ def _default_password(self):
188188
@gen.coroutine
189189
def get_image_manifest(self, image, tag):
190190
client = httpclient.AsyncHTTPClient()
191+
if '/' in image:
192+
# this handles the case of the image name including the registry
193+
# e.g. localhost:32000/my-image
194+
registry_prefix, image = image.split('/', 1)
191195
url = "{}/v2/{}/manifests/{}".format(self.url, image, tag)
192196
# first, get a token to perform the manifest request
193197
if self.token_url:

0 commit comments

Comments
 (0)