]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: fix 'inspect' and 'pull'
authorSage Weil <sage@newdream.net>
Mon, 25 Jan 2021 22:32:45 +0000 (16:32 -0600)
committerSage Weil <sage@newdream.net>
Mon, 1 Feb 2021 22:23:02 +0000 (16:23 -0600)
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>
src/cephadm/cephadm

index 5f7d4cb7e90667323482980285e05a93a0c79260..6a723d9bb8ec1c66b31cc6d310c1ebeccea8cf68 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