X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7865723dc5eee129e7ac269f3495274a13ff70ae..540b72d62a94015f116ba077e279a5f10d666778:/sdk/python/arvados/commands/keepdocker.py diff --git a/sdk/python/arvados/commands/keepdocker.py b/sdk/python/arvados/commands/keepdocker.py index db4edd2dfa..922256a27e 100644 --- a/sdk/python/arvados/commands/keepdocker.py +++ b/sdk/python/arvados/commands/keepdocker.py @@ -326,7 +326,7 @@ def list_images_in_arv(api_client, num_retries, image_name=None, image_tag=None, dockerhash = hash_link_map[collection_uuid]['name'] except KeyError: dockerhash = '' - name_parts = link['name'].split(':', 1) + name_parts = link['name'].rsplit(':', 1) images.append(_new_image_listing(link, dockerhash, *name_parts)) # Find any image hash links that did not have a corresponding name link, @@ -359,7 +359,7 @@ def _uuid2pdh(api, uuid): def main(arguments=None, stdout=sys.stdout, install_sig_handlers=True, api=None): args = arg_parser.parse_args(arguments) if api is None: - api = arvados.api('v1') + api = arvados.api('v1', num_retries=args.retries) if args.image is None or args.image == 'images': fmt = "{:30} {:10} {:12} {:29} {:20}\n" @@ -386,6 +386,16 @@ def main(arguments=None, stdout=sys.stdout, install_sig_handlers=True, api=None) elif args.tag is None: args.tag = 'latest' + if '/' in args.image: + hostport, path = args.image.split('/', 1) + if hostport.endswith(':443'): + # "docker pull host:443/asdf" transparently removes the + # :443 (which is redundant because https is implied) and + # after it succeeds "docker images" will list "host/asdf", + # not "host:443/asdf". If we strip the :443 then the name + # doesn't change underneath us. + args.image = '/'.join([hostport[:-4], path]) + # Pull the image if requested, unless the image is specified as a hash # that we already have. if args.pull and not find_image_hashes(args.image):