Skip to content

Commit cb6d328

Browse files
committed
Make registry_credentials a Dict
1 parent f381eb3 commit cb6d328

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

binderhub/build.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ class BuildExecutor(LoggingConfigurable):
9191
config=True,
9292
)
9393

94-
registry_credentials = Unicode(
95-
"",
94+
registry_credentials = Dict(
95+
{},
9696
help=(
9797
"Implementation dependent credentials for pushing image to a registry. "
9898
"For example, if push tokens are temporary this could be used to pass "
99-
"dynamically created credentials as an encoded JSON blob "
100-
'`{"registry": "docker.io", "username":"user", "password":"password"}` '
101-
"in the environment variable `CONTAINER_ENGINE_REGISTRY_CREDENTIALS` to "
102-
"repo2docker. "
103-
"If provided this will be used instead of push_secret. "
99+
"dynamically created credentials "
100+
'`{"registry": "docker.io", "username":"user", "password":"password"}`. '
101+
"This will be JSON encoded and passed in the environment variable "
102+
"CONTAINER_ENGINE_REGISTRY_CREDENTIALS` to repo2docker. "
103+
"If provided this will be used instead of push_secret."
104104
),
105105
config=True,
106106
)
@@ -252,17 +252,17 @@ def _default_api(self):
252252
config=True,
253253
)
254254

255-
registry_credentials = Unicode(
256-
"",
255+
registry_credentials = Dict(
256+
{},
257257
help=(
258258
"Implementation dependent credentials for pushing image to a registry. "
259259
"For example, if push tokens are temporary this could be used to pass "
260-
"dynamically created credentials as an encoded JSON blob "
261-
'`{"registry": "docker.io", "username":"user", "password":"password"}` '
262-
"in the environment variable `CONTAINER_ENGINE_REGISTRY_CREDENTIALS` to "
263-
"repo2docker. "
260+
"dynamically created credentials "
261+
'`{"registry": "docker.io", "username":"user", "password":"password"}`. '
262+
"This will be JSON encoded and passed in the environment variable "
263+
"CONTAINER_ENGINE_REGISTRY_CREDENTIALS` to repo2docker. "
264264
"If provided this will be used instead of push_secret. "
265-
"Currently this is passed to the build pod as a plan text environment "
265+
"Currently this is passed to the build pod as a plain text environment "
266266
"variable, though future implementations may use a Kubernetes secret."
267267
),
268268
config=True,
@@ -440,7 +440,7 @@ def submit(self):
440440
env.append(
441441
client.V1EnvVar(
442442
name="CONTAINER_ENGINE_REGISTRY_CREDENTIALS",
443-
value=self.registry_credentials,
443+
value=json.dumps(self.registry_credentials),
444444
)
445445
)
446446
elif self.push_secret:

binderhub/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ async def get(self, provider_prefix, _unescaped_spec):
463463
image_without_tag, image_tag
464464
)
465465
if push_token:
466-
build.registry_credentials = json.dumps(push_token)
466+
build.registry_credentials = push_token
467467
else:
468468
build.push_secret = ""
469469

0 commit comments

Comments
 (0)