cmd-push-container: replace --base-image-name by --name-suffix
The latter takes the suffix as a parameter so that we don't have to
hardcode any suffix in the codebase itself.
Addresses review comment:
@@ -21,7 +21,7 @@ parser = argparse.ArgumentParser()
parser.add_argument("--authfile", help="Authentication file",
action='store')
parser.add_argument("--format", help="Image format for destination", choices=['oci', 'v2s2'], action='store')
-parser.add_argument("--base-image-name", help="Append extra 'base-image' to the name of the container image", action='store_true')
+parser.add_argument("--name-suffix", metavar='SUFFIX', help="Append SUFFIX to container name")
parser.add_argument("name", help="destination image reference")
args = parser.parse_args()
@@ -54,8 +54,8 @@ else:
# Strip the tag out, as we will be injecting the digest below
# Note this implicitly errors out if there's more than one ':'
container_name, container_tag = args.name.rsplit(':')
-if args.base_image_name:
- container_name = f"{container_name}-base-image"
+if args.name_suffix:
+ container_name = f"{container_name}-{args.name_suffix}"
with tempfile.NamedTemporaryFile(dir='tmp', prefix='push-container-digestfile') as df:
skopeoargs.append(f"--digestfile={df.name}")
skopeoargs.extend([f"oci-archive:{ociarchive}", f"docker://{container_name}:{container_tag}"])
