]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: drop 'sha256:' prefix on container id
authorSage Weil <sage@redhat.com>
Tue, 17 Dec 2019 14:05:04 +0000 (08:05 -0600)
committerSage Weil <sage@redhat.com>
Tue, 17 Dec 2019 15:59:46 +0000 (09:59 -0600)
Podman doesn't include the prefix--only the (bionic) docker as far as I
can tell.

Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 9fea0b3add05e476a34f1b00823d903059a7d65d..3511b13acca9134543a59d6e539d99937938fffc 100755 (executable)
@@ -1786,6 +1786,13 @@ def list_daemons(detail=True, legacy_dir=None):
                             verbose_on_failure=False)
                         if not code:
                             (container_id, image_name, image_id) = out.strip().split(',')
+                            # docker adds the sha256: prefix, but AFAICS both
+                            # docker (18.09.7 in bionic at least) and podman
+                            # both always use sha256, so leave off the prefix
+                            # for consistency.
+                            prefix = 'sha256:'
+                            if image_name.startswith(prefix):
+                                image_name = image_name[len(prefix):]
                             out, err, code = call(
                                 [container_path, 'exec', container_id,
                                  'ceph', '-v'])