qa/cephadm: Docker doesn't ship a registries.conf

I guess not using the mirror for docker based tests is ok for now.

For adding docker support, we need to:

1. change the docker config
2. restart the docker daemon

Note that Docker's config only supports to mirror the docker.io registry.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
Sebastian Wagner 2020-05-27 13:17:58 +02:00
parent 9e1e02508f
commit 9310b6e278

View File

@ -1173,14 +1173,18 @@ def add_mirror_to_cluster(ctx, mirror):
registries_conf = '/etc/containers/registries.conf'
for remote in ctx.cluster.remotes.keys():
config = teuthology.get_file(
remote=remote,
path=registries_conf
)
new_config = toml.dumps(registries_add_mirror_to_docker_io(config.decode('utf-8'), mirror))
try:
config = teuthology.get_file(
remote=remote,
path=registries_conf
)
new_config = toml.dumps(registries_add_mirror_to_docker_io(config.decode('utf-8'), mirror))
teuthology.sudo_write_file(
remote=remote,
path=registries_conf,
data=new_config,
)
teuthology.sudo_write_file(
remote=remote,
path=registries_conf,
data=new_config,
)
except FileNotFoundError as e:
# Docker doesn't ship a registries.conf
log.info('Failed to add mirror: %s' % str(e))