diff --git a/podman_hpc/podman_hpc.py b/podman_hpc/podman_hpc.py index 38b7ae3..091ab5e 100755 --- a/podman_hpc/podman_hpc.py +++ b/podman_hpc/podman_hpc.py @@ -194,6 +194,14 @@ def images(ctx, siteconf, image, podman_args, **site_opts): cmd.extend(podman_args) cmd.extend(siteconf.get_cmd_extensions("images", site_opts)) +PODMAN_TRANSPORT_PREFIXES = [ + "docker://", + "dir:", + "docker-archive:", + "docker-daemon:", + "oci-archive:", +] + # podman-hpc pull subcommand (modified) #################################### @podhpc.command( context_settings=dict( @@ -213,6 +221,18 @@ def pull(ctx, siteconf, image, podman_args, **site_opts): cmd.append(image) proc = Popen(cmd) proc.communicate() + + # Check for transport_prefix + for prefix in PODMAN_TRANSPORT_PREFIXES: + if image.startswith(prefix): + if prefix != "docker://": + sys.stderr.write( + f"""WARNING: Transport prefix '{prefix}' is + incompatible with podman-hpc.\n""" + ) + image = image[len(prefix):] # Remove the prefix + break + if proc.returncode == 0: sys.stdout.write(f"INFO: Migrating image to {siteconf.squash_dir}\n") mu = MigrateUtils(conf=siteconf)