Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Do not assume that util.skopeo_copy can't fail #1147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Atomic/backends/_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ def pull_image(self, image, remote_image_obj, **kwargs):
trust = Trust()
trust.discover_sigstore(fq_name)
util.write_out("Pulling {} ...".format(fq_name))
util.skopeo_copy("docker://{}".format(fq_name), image, debug=debug, insecure=insecure,
return util.skopeo_copy("docker://{}".format(fq_name), image, debug=debug, insecure=insecure,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't it raise a CalledProcessError exception when skopeo_copy fails?

policy_filename=trust.policy_filename, src_creds=src_creds)
return 0

def delete_container(self, container, force=False):
return self.d.remove_container(container, force=force)
Expand Down
4 changes: 3 additions & 1 deletion Atomic/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def run(self):
if self.args.display:
return 0
try:
db.pull_image(self.image, remote_image_obj)
err = db.pull_image(self.image, remote_image_obj)
if err:
raise ValueError("Unable to pull image {}".format(self.image))
img_object = db.has_image(self.image)
except RegistryInspectError:
raise ValueError("Unable to find image {}".format(self.image))
Expand Down