From 5833d525d4e833958da72b4e31d06f83bba09733 Mon Sep 17 00:00:00 2001 From: Matej Marusak Date: Mon, 4 Jan 2021 09:21:08 +0100 Subject: [PATCH] Don't unnecessary fail to parse reply when pulling images Reply from podman is somewhat like this: ``` $ sudo curl -X POST --unix-socket /run/podman/podman.sock http://d/v1.24/libpod/images/pull?reference=fedora {"stream":"Resolved short name \"fedora\" to a recorded short-name alias (origin: /etc/containers/registries.conf.d/shortnames.conf)\n"} {"stream":"Trying to pull registry.fedoraproject.org/fedora:latest...\n"} {"stream":"Getting image source signatures\n"} {"stream":"Copying blob sha256:8fde7942e775327f2d6ddaf08f45fda74201a7769951b0413860e21b59b4bf82\n"} {"stream":"Copying config sha256:79fd58dc76113dac76a120f22cadecc3b2d1794b414f90ea368cf66096700053\n"} {"stream":"Writing manifest to image destination\n"} {"stream":"Storing signatures\n"} {"images":["79fd58dc76113dac76a120f22cadecc3b2d1794b414f90ea368cf66096700053"]} {"id":"79fd58dc76113dac76a120f22cadecc3b2d1794b414f90ea368cf66096700053"} ``` Since it is not a single JSON object we fail to parse it. But we don't really care about any of it, so let's not parse it. Fixes #640 --- src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index ef03d1503..f9198eef3 100644 --- a/src/client.js +++ b/src/client.js @@ -256,7 +256,7 @@ export function pullImage(system, reference) { reference: reference, }; podmanCall("libpod/images/pull", "POST", options, system) - .then(reply => resolve(JSON.parse(reply))) + .then(resolve) .catch(reject); }); }