Skip to content

Commit

Permalink
cosalib/kubevirt: drop container pushing code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dustymabe authored and jlebon committed Apr 17, 2023
1 parent 91f478e commit a4cf183
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions src/cosalib/kubevirt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import subprocess
import logging as log

from cosalib.cmdlib import (
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit a4cf183

Please sign in to comment.