]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: normalize unqualified repo digests to docker.io
authorSage Weil <sage@newdream.net>
Sat, 3 Apr 2021 13:14:00 +0000 (09:14 -0400)
committerSage Weil <sage@newdream.net>
Sat, 10 Apr 2021 13:07:06 +0000 (08:07 -0500)
commit8d27b8fecbb80f7ed94ac7b70ba894b5af39ade7
treec83e452aa2db320388e070cdbe51e6c7c80ce777
parent1f7c13a11e3597edb88b50a9f23a352e83fb24a5
cephadm: normalize unqualified repo digests to docker.io

A RepoDigests returned by docker|podman image inspect can either include
the docker.io/ prefix or not.  For reasons that aren't entirely clear,
this may vary between hosts in a cluster.  However, ceph/ceph@sha256:abc...
is the same thing as docker.io/ceph/ceph@sha256:abc..., and should be
treated as such.  Otherwise, upgrade can get into a loop where it pulls
the image on a new host, finds the other variant of the repodigests,
sees no overlap, updates target_digests, and restarts.  (It will then
find the first variant again on the first host and loop.)

Avoid this by normalizing any docker.io digests by always including the
docker.io/ prefix.

Note that it is technically possible that this assumption is wrong: it
may be that the image that already exists on the local host is from a
different registry in registries.conf's unqualified-search-registries.
However, we don't know which, since this is a search list.  In practice,
it should be exceeding rare that an image that *we* are installing using
a fully-qualified image name will end up having an unqualified repodigest
in the local registry.  Hopefully!

Fixes: https://tracker.ceph.com/issues/50114
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit e07a73830436340e77180782216524f071a5a292)
src/cephadm/cephadm