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 <dmick@redhat.com>
- 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
}
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