Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd-push-container: fix --name-suffix semantics #2925

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cmd-push-container
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ 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("--name-suffix", metavar='SUFFIX', help="Append SUFFIX to container name")
parser.add_argument("name", help="destination image reference")
parser.add_argument("--tag-suffix", metavar='SUFFIX', help="Append SUFFIX to container tag")
parser.add_argument("name", metavar='NAME[:TAG]', help="destination image reference")

args = parser.parse_args()

Expand Down Expand Up @@ -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.name_suffix:
container_name = f"{container_name}-{args.name_suffix}"
if args.tag_suffix:
container_tag = f"{container_tag}-{args.tag_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}"])
Expand Down