]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix 'inspect' and 'pull'
authorSage Weil <sage@newdream.net>
Mon, 25 Jan 2021 22:32:45 +0000 (16:32 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 10 Feb 2021 12:26:25 +0000 (13:26 +0100)
With podman 2.2.1 I would get

ERRO[0000] Error printing inspect output: template: all inspect:1: function "json" not defined

Removing the 'json' portion of the query resolves it.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit d31bed79411ca493ec48eeed4e9cbb7ad92295c3)

src/cephadm/cephadm

index 96ab0550fa7d2dec8001f3e91ae442c2c2093e21..9d7bd2c5d53b512198173fa2c403903ecc0febad 100755 (executable)
@@ -3157,7 +3157,7 @@ def command_inspect_image(ctx):
     # type: (CephadmContext) -> int
     out, err, ret = call_throws(ctx, [
         ctx.container_path, 'inspect',
-        '--format', '{{.ID}},{{json .RepoDigests}}',
+        '--format', '{{.ID}},{{.RepoDigests}}',
         ctx.image])
     if ret:
         return errno.ENOENT
@@ -3179,7 +3179,7 @@ def get_image_info_from_inspect(out, image):
         'image_id': normalize_container_id(image_id)
     }
     if digests:
-        json_digests = json.loads(digests)
+        json_digests = digests[1:-1].split(' ')
         if json_digests:
             r['repo_digest'] = json_digests[0]
     return r