mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Merge pull request #42031 from sebastian-philipp/normalize_image_digest_local-registry
cephadm: Fix normalize_image_digest for local registries Reviewed-by: Adam King <adking@redhat.com>
This commit is contained in:
commit
135b6dde5e
@ -3371,7 +3371,7 @@ def normalize_image_digest(digest):
|
||||
# quay.ceph.io/ceph/ceph -> ceph
|
||||
# docker.io/ubuntu -> no change
|
||||
bits = digest.split('/')
|
||||
if '.' not in bits[0] or len(bits) < 3:
|
||||
if '.' not in bits[0] and len(bits) < 3:
|
||||
digest = DEFAULT_REGISTRY + '/' + digest
|
||||
return digest
|
||||
|
||||
|
@ -535,6 +535,12 @@ docker.io/ceph/daemon-base:octopus
|
||||
ctx.container_engine = mock_docker()
|
||||
assert not cd.should_log_to_journald(ctx)
|
||||
|
||||
def test_normalize_image_digest(self):
|
||||
s = 'myhostname:5000/ceph/ceph@sha256:753886ad9049004395ae990fbb9b096923b5a518b819283141ee8716ddf55ad1'
|
||||
assert cd.normalize_image_digest(s) == s
|
||||
|
||||
s = 'ceph/ceph:latest'
|
||||
assert cd.normalize_image_digest(s) == f'{cd.DEFAULT_REGISTRY}/{s}'
|
||||
|
||||
class TestCustomContainer(unittest.TestCase):
|
||||
cc: cd.CustomContainer
|
||||
|
Loading…
Reference in New Issue
Block a user