Skip to content

Commit 31e5d09

Browse files
authored
Merge pull request #1945 from rgaiacs/1943-docker-hub
Append / to Docker Hub auth URL
2 parents c07d252 + 61bbc62 commit 31e5d09

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

binderhub/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from traitlets.config import LoggingConfigurable
1515

1616
DEFAULT_DOCKER_REGISTRY_URL = "https://registry-1.docker.io"
17-
DEFAULT_DOCKER_AUTH_URL = "https://index.docker.io/v1"
17+
DEFAULT_DOCKER_AUTH_URL = "https://index.docker.io/v1/"
1818

1919

2020
class DockerRegistry(LoggingConfigurable):
@@ -46,7 +46,7 @@ def _default_url(self):
4646
# which assumes https
4747
auth_config_url = "https://" + auth_config_url
4848

49-
if auth_config_url.rstrip("/") == DEFAULT_DOCKER_AUTH_URL:
49+
if auth_config_url == DEFAULT_DOCKER_AUTH_URL:
5050
# default docker config key is the v1 registry,
5151
# but we will talk to the v2 api
5252
return DEFAULT_DOCKER_REGISTRY_URL

binderhub/tests/test_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
def test_registry_defaults(tmpdir):
1616
registry = DockerRegistry(docker_config_path=str(tmpdir.join("doesntexist.json")))
1717
assert registry.url == "https://registry-1.docker.io"
18-
assert registry.auth_config_url == "https://index.docker.io/v1"
18+
assert registry.auth_config_url == "https://index.docker.io/v1/"
1919
assert (
2020
registry.token_url == "https://auth.docker.io/token?service=registry.docker.io"
2121
)
@@ -29,7 +29,7 @@ def test_registry_username_password(tmpdir):
2929
json.dump(
3030
{
3131
"auths": {
32-
"https://index.docker.io/v1": {
32+
"https://index.docker.io/v1/": {
3333
"auth": base64.encodebytes(b"user:pass").decode("ascii")
3434
}
3535
}

0 commit comments

Comments
 (0)