Skip to content

Commit 1d24ed6

Browse files
committed
fix(registry): Use proper hostname for dockerhub images
1 parent 8bcaff3 commit 1d24ed6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

rootfs/scheduler/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,15 +655,16 @@ def _set_image_secret(self, data, namespace, **kwargs):
655655
hostname = registry.get('hostname', None)
656656
if not hostname:
657657
hostname, _ = docker_auth.split_repo_name(kwargs.get('image'))
658+
if hostname == docker_auth.INDEX_NAME:
659+
hostname = "https://index.docker.io/v1/"
658660

659661
# create / update private registry secret
660662
auth = bytes('{}:{}'.format(registry.get('username'), registry.get('password')), 'UTF-8')
661663
# value has to be a base64 encoded JSON
662664
docker_config = json.dumps({
663665
"auths": {
664666
hostname: {
665-
"auth": base64.b64encode(auth).decode(encoding='UTF-8'),
666-
"email": 'not@valid.id'
667+
"auth": base64.b64encode(auth).decode(encoding='UTF-8')
667668
}
668669
}
669670
})

0 commit comments

Comments
 (0)