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

Commit

Permalink
fix(controller): correct image name parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Jul 21, 2014
1 parent 2ff233b commit 01c4b0b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions controller/registry/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ def publish_release(source, config, target):
Given a source image and dictionary of last-mile configuration,
create a target Docker image on the registry.
For example publish_release('registry.local:5000/gabrtv/myapp',
For example publish_release('registry.local:5000/gabrtv/myapp:v22',
{'ENVVAR': 'values'},
'registry.local:5000/gabrtv/myapp',)
'registry.local:5000/gabrtv/myapp:v23',)
results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
contains the new configuration as ENV entries.
"""
try:
src_image = source.rsplit(':', 1)[0]
src_tag = source.rsplit(':', 1)[1]
if source.count(':') == 2:
src_image = source.rsplit(':', 1)[0].split('/', 1)[1]
src_tag = source.split(':')[2]
else:
src_image = source
src_tag = 'latest'
target_image = target.rsplit(':', 1)[0]
target_tag = target.rsplit(':', 1)[1]
image_id = _get_tag(src_image, src_tag)
Expand Down

0 comments on commit 01c4b0b

Please sign in to comment.