Skip to content

Commit 01c4b0b

Browse files
author
Matthew Fisher
committed
fix(controller): correct image name parsing
1 parent 2ff233b commit 01c4b0b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

controller/registry/private.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ def publish_release(source, config, target):
1616
Given a source image and dictionary of last-mile configuration,
1717
create a target Docker image on the registry.
1818
19-
For example publish_release('registry.local:5000/gabrtv/myapp',
19+
For example publish_release('registry.local:5000/gabrtv/myapp:v22',
2020
{'ENVVAR': 'values'},
21-
'registry.local:5000/gabrtv/myapp',)
21+
'registry.local:5000/gabrtv/myapp:v23',)
2222
results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
2323
contains the new configuration as ENV entries.
2424
"""
2525
try:
26-
src_image = source.rsplit(':', 1)[0]
27-
src_tag = source.rsplit(':', 1)[1]
26+
if source.count(':') == 2:
27+
src_image = source.rsplit(':', 1)[0].split('/', 1)[1]
28+
src_tag = source.split(':')[2]
29+
else:
30+
src_image = source
31+
src_tag = 'latest'
2832
target_image = target.rsplit(':', 1)[0]
2933
target_tag = target.rsplit(':', 1)[1]
3034
image_id = _get_tag(src_image, src_tag)

0 commit comments

Comments
 (0)