Skip to content

Commit 71047e5

Browse files
author
Matthew Fisher
committed
fix(controller): clean up publish_release params
Publishing a release should only know about a source, a dictionary of configuration, and a target.
1 parent c6bb251 commit 71047e5

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

controller/registry/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
def publish_release(src_image, src_tag, config, target_image, target_tag):
2+
def publish_release(source, config, target):
33
"""
44
Publish a new release as a Docker image
55

controller/registry/private.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@
99
from django.conf import settings
1010

1111

12-
def publish_release(src_image, src_tag, config, target_image, target_tag):
12+
def publish_release(source, config, target):
1313
"""
1414
Publish a new release as a Docker image
1515
1616
Given a source image and dictionary of last-mile configuration,
1717
create a target Docker image on the registry.
1818
1919
For example publish_release('registry.local:5000/gabrtv/myapp',
20-
'<sha>'
2120
{'ENVVAR': 'values'},
22-
'registry.local:5000/gabrtv/myapp',
23-
'v23',)
21+
'registry.local:5000/gabrtv/myapp',)
2422
results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
2523
contains the new configuration as ENV entries.
2624
"""
2725
try:
26+
src_image = source.rsplit(':', 1)[0]
27+
src_tag = source.rsplit(':', 1)[1]
28+
target_image = target.rsplit(':', 1)[0]
29+
target_tag = target.rsplit(':', 1)[1]
2830
image_id = _get_tag(src_image, src_tag)
2931
except RuntimeError:
3032
if src_tag == 'latest':

0 commit comments

Comments
 (0)