From: Dan Mick Date: Thu, 17 Dec 2020 02:06:31 +0000 (+0000) Subject: qa/distros: configure podman to pull from docker-mirror X-Git-Tag: v16.1.0~191^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38650%2Fhead;p=ceph.git qa/distros: configure podman to pull from docker-mirror This also requires a change to cephadm.py to search for registry entries for docker.io by 'prefix' or 'location', and to only add the mirror if a mirror isn't already present Signed-off-by: Dan Mick --- diff --git a/qa/distros/all/ubuntu_18.04_podman.yaml b/qa/distros/all/ubuntu_18.04_podman.yaml index 3d3d99642596..214e964ac80a 100644 --- a/qa/distros/all/ubuntu_18.04_podman.yaml +++ b/qa/distros/all/ubuntu_18.04_podman.yaml @@ -9,4 +9,4 @@ tasks: - echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list - sudo apt update - sudo apt -y install podman - - echo -e "[registries.search]\nregistries = ['docker.io']" | sudo tee /etc/containers/registries.conf + - echo -e "[[registry]]\nlocation = 'docker.io'\n\n[[registry.mirror]]\nlocation='docker-mirror.front.sepia.ceph.com:5000'\n" | sudo tee /etc/containers/registries.conf diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 027b8dc7b3bc..0ff2acf925a5 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -1264,13 +1264,17 @@ def registries_add_mirror_to_docker_io(conf, mirror): } else: v2 = config # type: ignore - dockers = [r for r in v2['registry'] if r['prefix'] == 'docker.io'] + dockers = [ + r for r in v2['registry'] if + r.get('prefix') == 'docker.io' or r.get('location') == 'docker.io' + ] if dockers: docker = dockers[0] - docker['mirror'] = [{ - "location": mirror, - "insecure": True, - }] + if 'mirror' not in docker: + docker['mirror'] = [{ + "location": mirror, + "insecure": True, + }] return v2