From a4cf1831141ef0047fafce074e5cf191b4c53d6f Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sat, 15 Apr 2023 13:59:00 -0400 Subject: [PATCH] cosalib/kubevirt: drop container pushing code We already have `cosa push-container-manifest` that handles container pushes and the release job in our pipeline already knows how to use it. Let's drop the code here that tries to do the same thing. --- src/cosalib/kubevirt.py | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/cosalib/kubevirt.py b/src/cosalib/kubevirt.py index 5296f75af6..7712e31b01 100644 --- a/src/cosalib/kubevirt.py +++ b/src/cosalib/kubevirt.py @@ -1,5 +1,4 @@ import os -import subprocess import logging as log from cosalib.cmdlib import ( @@ -42,41 +41,22 @@ def write_oci(self, image_name): def kubevirt_run_ore(build, args): - if not args.repository: - raise Exception("--repository must not be empty") - - name = f"{build.build_name}" - if args.name is not None: - name = args.name - tags = [f"{build.build_id}-{build.basearch}"] - if args.tag is not None: - tags.extend(args.tag) - full_name = os.path.join(args.repository, name) - - digest = runcmd(["skopeo", "inspect", f"oci-archive:{build.image_path}", "-f", "{{.Digest}}"], - stdout=subprocess.PIPE).stdout.decode("utf-8").strip() - for tag in tags: - log.info(f"pushing {full_name}:{tag} with digest {digest}") - runcmd(["skopeo", "copy", f"oci-archive:{build.image_path}", f"docker://{full_name}:{tag}"]) - - build.meta['kubevirt'] = { - 'image': f"{full_name}@{digest}", - } - build.meta_write() + """ + This function is not necessary for Kubevirt. We'll push the ociarchive + files using cosa push-container-manifest in the release job. + """ + raise Exception("not implemented") def kubevirt_run_ore_replicate(*args, **kwargs): - print(""" -KubeVirt does not require regional replication. This command is a -placeholder. -""") + """ + This function is not necessary for Kubevirt. We'll push the ociarchive + files using cosa push-container-manifest in the release job. + """ + raise Exception("not implemented") def kubevirt_cli(parser): - parser.add_argument("--name", - help="Name to append to the repository (e.g. fedora-coreos). Defaults to the build name.") - parser.add_argument("--repository", help="Repository to push to (e.g. quay.io or quay.io/myorg)") - parser.add_argument("--tag", action="append", help="Additional image tag. Can be provided multiple times.") return parser