diff --git a/controller/api/models.py b/controller/api/models.py index 16facf5b4a..dc9b41b062 100644 --- a/controller/api/models.py +++ b/controller/api/models.py @@ -482,6 +482,11 @@ def new(self, user, config=None, build=None, summary=None, source_version='lates tasks.import_repository.delay(build.image, self.app.id).get() # update the source image to the repository we just imported source_image = self.app.id + # if the image imported had a tag specified, use that tag as the source + if ':' in build.image: + if '/' not in build.image[build.image.rfind(':') + 1:]: + source_image += build.image[build.image.rfind(':'):] + publish_release(source_image, config.values, release_image,) diff --git a/controller/registry/private.py b/controller/registry/private.py index be71b16fc8..446e41739a 100644 --- a/controller/registry/private.py +++ b/controller/registry/private.py @@ -23,9 +23,11 @@ def publish_release(source, config, target): contains the new configuration as ENV entries. """ try: - if source.count(':') == 2: - src_image = source.rsplit(':', 1)[0].split('/', 1)[1] - src_tag = source.split(':')[2] + # parse for the tag and the repository + if ':' in source: + if '/' not in source[source.rfind(':') + 1:]: + src_tag = source[source.rfind(':') + 1:] + src_image = source[:source.rfind(':')] else: src_image = source src_tag = 'latest' diff --git a/registry/Dockerfile b/registry/Dockerfile index f56c4a46de..4d8765bff8 100644 --- a/registry/Dockerfile +++ b/registry/Dockerfile @@ -15,7 +15,7 @@ RUN useradd -s /bin/bash registry # add the docker registry source from github RUN git clone https://github.com/deis/docker-registry /docker-registry && \ cd /docker-registry && \ - git checkout 3a192af && \ + git checkout 3ab454d && \ chown -R registry:registry /docker-registry # install boto configuration