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

Commit

Permalink
fix(controller): more image parsing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Jul 17, 2014
1 parent 383ce56 commit 7756f8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controller/registry/private.py
Expand Up @@ -23,10 +23,16 @@ def publish_release(source, config, target):
contains the new configuration as ENV entries.
"""
try:
if source.count(':') == 2:
if source.count('/') == 2:
# image comes from private registry
src_image = source.rsplit(':', 1)[0].split('/', 1)[1]
src_tag = source.split(':')[2]
elif source.count('/') == 1 and source.count(':') == 1:
# image comes from dockerhub, includes tag
src_image = source.split(':')[0]
src_tag = source.split(':')[1]
else:
# image comes from dockerhub, no tag
src_image = source
src_tag = 'latest'
target_image = target.rsplit(':', 1)[0]
Expand Down

0 comments on commit 7756f8a

Please sign in to comment.