From: Sebastian Wagner Date: Wed, 27 May 2020 11:17:58 +0000 (+0200) Subject: qa/cephadm: Docker doesn't ship a registries.conf X-Git-Tag: v15.2.4~83^2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3255c3c812e6200afe46d45043a9e4ccb6e8bf32;p=ceph.git 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 (cherry picked from commit 9310b6e278c78bdf3d4a6f46e3b17f6837f828ef) --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index ee2e4ee6f6c..879461170cf 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -1150,14 +1150,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))