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: v16.1.0~2222^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35273%2Fhead;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 --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 98f5e35f1975..0256cdbc247e 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -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))