Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
feat(controller): allow tags for deis pull
Browse files Browse the repository at this point in the history
if the source Build object specifies a tag to be pulled, it will use
that tag as the source rather than `latest`.
  • Loading branch information
Matthew Fisher committed Aug 4, 2014
1 parent 02d7b41 commit 40b2929
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions controller/api/models.py
Expand Up @@ -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,)
Expand Down
8 changes: 5 additions & 3 deletions controller/registry/private.py
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion registry/Dockerfile
Expand Up @@ -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
Expand Down

0 comments on commit 40b2929

Please sign in to comment.