Skip to content

Commit fd19508

Browse files
committed
Do not assume that util.skopeo_copy can't fail
If the disk is full (projectatomic#1146), atomic will continue and show errors later, which is puzzling and hard to debug.
1 parent 3e641a0 commit fd19508

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Atomic/backends/_docker.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,8 @@ def pull_image(self, image, remote_image_obj, **kwargs):
343343
trust = Trust()
344344
trust.discover_sigstore(fq_name)
345345
util.write_out("Pulling {} ...".format(fq_name))
346-
util.skopeo_copy("docker://{}".format(fq_name), image, debug=debug, insecure=insecure,
346+
return util.skopeo_copy("docker://{}".format(fq_name), image, debug=debug, insecure=insecure,
347347
policy_filename=trust.policy_filename, src_creds=src_creds)
348-
return 0
349348

350349
def delete_container(self, container, force=False):
351350
return self.d.remove_container(container, force=force)

Atomic/run.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def run(self):
108108
if self.args.display:
109109
return 0
110110
try:
111-
db.pull_image(self.image, remote_image_obj)
111+
err = db.pull_image(self.image, remote_image_obj)
112+
if err:
113+
raise ValueError("Unable to pull image {}".format(self.image))
112114
img_object = db.has_image(self.image)
113115
except RegistryInspectError:
114116
raise ValueError("Unable to find image {}".format(self.image))

0 commit comments

Comments
 (0)