Skip to content

Commit b8629ef

Browse files
author
Matthew Fisher
committed
refactor(controller): remove urlparse logic
The logic has been moved over to the registry, so it's not needed any more.
1 parent 10a57fc commit b8629ef

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

controller/api/tasks.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,8 @@ def deploy_release(app, release):
4141
def import_repository(source, target_repository):
4242
"""Imports an image from a remote into our own private registry"""
4343

44-
url = urlparse(source)
45-
scheme = url.scheme if url.scheme else 'http'
46-
# strip the leading slash
47-
src_repository = url.path[1:]
48-
49-
if url.hostname and url.port:
50-
src_index = '{}://{}:{}'.format(scheme, url.hostname, url.port)
51-
elif url.hostname:
52-
src_index = '{}://{}'.format(scheme, url.hostname)
53-
else:
54-
# assume just the repository name was given, therefore it came from
55-
# the public index
56-
src_index = settings.PUBLIC_INDEX_URL
57-
src_repository = source
5844
data = {
59-
'src_index': src_index,
60-
'src_repository': src_repository,
45+
'src': source,
6146
}
6247
response = requests.post(
6348
'{}/v1/repositories/{}/tags'.format(settings.REGISTRY_URL,

0 commit comments

Comments
 (0)