Skip to content

Commit

Permalink
Don't unnecessary fail to parse reply when pulling images
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marusak committed Jan 4, 2021
1 parent 928d1ba commit 5833d52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

0 comments on commit 5833d52

Please sign in to comment.