fetch-images command #768
@ -73,7 +73,9 @@ def _get_tags_for_container(container: str, registry_info: RegistryInfo) -> List
|
||||
|
||||
def _find_latest(candidate_tags: List[str]):
|
||||
# Lex sort should give us the latest first
|
||||
sorted_candidates = candidate_tags.sort()
|
||||
sorted_candidates = sorted(candidate_tags)
|
||||
if opts.o.debug:
|
||||
print(f"sorted candidates: {sorted_candidates}")
|
||||
return sorted_candidates[0]
|
||||
|
||||
|
||||
@ -126,11 +128,6 @@ def _exists_locally(container: str):
|
||||
return docker.image.exists(_local_tag_for(container))
|
||||
|
||||
|
||||
def _remove_local_tag(container: str):
|
||||
# TODO Do we need this?
|
||||
pass
|
||||
|
||||
|
||||
def _add_local_tag(remote_tag: str, registry: str, local_tag: str):
|
||||
docker = DockerClient()
|
||||
docker.image.tag(f"{registry}/{remote_tag}", local_tag)
|
||||
@ -170,9 +167,8 @@ def command(ctx, include, exclude, force_local_overwrite, image_registry, regist
|
||||
if (force_local_overwrite):
|
||||
# In that case remove the existing :local tag
|
||||
if not opts.o.quiet:
|
||||
print(f"Warning: removing local tag from this image: {container} because "
|
||||
print(f"Warning: overwriting local tag from this image: {container} because "
|
||||
"--force-local-overwrite was specified")
|
||||
_remove_local_tag(local_tag)
|
||||
else:
|
||||
if not opts.o.quiet:
|
||||
print(f"Skipping local tagging for this image: {container} because that would "
|
||||
|
Loading…
Reference in New Issue
Block a user