Commit a2ff53d8 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Bugfix in inferring image tag from image name.

parent 93f363c0
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -789,7 +789,13 @@ def get_or_create_container_from_repository(user, repository_url, repository_tag
    # Set image registry, name and tag. Use "strip()" as sometimes the newline chars might jump in.
    # Set image registry, name and tag. Use "strip()" as sometimes the newline chars might jump in.
    registry = get_platform_registry()
    registry = get_platform_registry()
    image_name = repository_name.lower().strip()
    image_name = repository_name.lower().strip()
    image_tag = repo2docker_image_name[-7:] # The last part of the image name generated by repo2docker is the git short hash
    if repo2docker_image_name.endswith(':latest'):
        # Not clear why sometimes this happens. maybe if an existent image gets reused?
        image_name_for_tag = repo2docker_image_name.replace(':latest','')
    else:
        image_name_for_tag = repo2docker_image_name
    
    image_tag = image_name_for_tag[-7:] # The last part of the image name generated by repo2docker is the git short hash


    # Re-tag image taking into account that if we are using the proxy as registry we use localhost or it won't work
    # Re-tag image taking into account that if we are using the proxy as registry we use localhost or it won't work
    if registry == 'proxy:5000':
    if registry == 'proxy:5000':