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

Commit

Permalink
syscontainers: drop sha256 only if prefix
Browse files Browse the repository at this point in the history
After this fix, we can install a system container by the image sha256 ID:

atomic install --system busybox@sha256:817a12c32a39bbe394944ba49de563e085f1d3c5266eb8e9723256bc4448680e

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #890
Approved by: baude
  • Loading branch information
giuseppe authored and rh-atomic-bot committed Feb 17, 2017
1 parent b649d9d commit 1a67206
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Atomic/syscontainers.py
Expand Up @@ -1287,7 +1287,9 @@ def _get_ostree_image_branch(img):
if "ostree:" in img:
imagebranch = img.replace("ostree:", "")
else: # assume "oci:" image
imagebranch = "%s%s" % (OSTREE_OCIIMAGE_PREFIX, SystemContainers._encode_to_ostree_ref(img.replace("sha256:", "")))
if img.startswith("sha256:"):
img = img.replace("sha256:", "", 1)
imagebranch = "%s%s" % (OSTREE_OCIIMAGE_PREFIX, SystemContainers._encode_to_ostree_ref(img))
return imagebranch

def has_image(self, img):
Expand Down

0 comments on commit 1a67206

Please sign in to comment.