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

Commit

Permalink
syscontainers: change $ORIGIN: prefix
Browse files Browse the repository at this point in the history
allow the $ORIGIN: prefix only when the branch is specified, otherwise it
is not decidable if $ORIGIN is the source to pull the image from or the
name of the image itself.

Signed-off-by: Giuseppe Scrivano <[email protected]>

Closes: #767
Approved by: rhatdan
  • Loading branch information
giuseppe authored and rh-atomic-bot committed Mar 22, 2017
1 parent b393d4b commit 4cb0b1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Atomic/syscontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ def _split_set_args(setvalues):
def _pull_image_to_ostree(self, repo, image, upgrade):
if not repo:
raise ValueError("Cannot find a configured OSTree repo")
if image.startswith("ostree:"):
if image.startswith("ostree:") and image.count(':') > 1:
self._check_system_ostree_image(repo, image, upgrade)
elif image.startswith("docker:"):
elif image.startswith("docker:") and image.count(':') > 1:
image = self._pull_docker_image(repo, image.replace("docker:", "", 1))
elif image.startswith("dockertar:"):
tarpath = image.replace("dockertar:", "", 1)
elif image.startswith("dockertar:/"):
tarpath = image.replace("dockertar:/", "", 1)
image = self._pull_docker_tar(repo, tarpath, os.path.basename(tarpath).replace(".tar", ""))
else: # Assume "oci:"
self._check_system_oci_image(repo, image, upgrade)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_system_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}
test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.0
test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.1

${ATOMIC} pull --storage ostree docker:atomic-test-secret
${ATOMIC} pull --storage ostree docker:atomic-test-secret:latest
# Move directly the OSTree reference to a new one, so that we have different names and info doesn't error out
mv ${ATOMIC_OSTREE_REPO}/refs/heads/ociimage/atomic-test-secret_3Alatest ${ATOMIC_OSTREE_REPO}/refs/heads/ociimage/atomic-test-secret-ostree_3Alatest
${ATOMIC} info atomic-test-secret-ostree > version.out
Expand Down Expand Up @@ -332,7 +332,7 @@ teardown

# Install from a docker local docker image
export NAME="test-docker-system-container-$$"
${ATOMIC} install --name=${NAME} --set=RECEIVER=${SECRET} --system docker:atomic-test-system
${ATOMIC} install --name=${NAME} --set=RECEIVER=${SECRET} --system docker:atomic-test-system:latest
test -e /etc/tmpfiles.d/${NAME}.conf

test -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.0/${NAME}.service
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class TestAtomicPull(unittest.TestCase):
class Args():
def __init__(self):
self.image = "docker:centos"
self.image = "docker:centos:latest"
self.user = False

def test_pull_as_privileged_user(self):
Expand Down

0 comments on commit 4cb0b1e

Please sign in to comment.