Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Implement inspect assembly rhcos command
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreyd committed Jul 29, 2023
1 parent 4e740f6 commit a78b712
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions doozerlib/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from doozerlib.config import MetaDataConfig as mdc
from doozerlib.cli import cli, pass_runtime, validate_semver_major_minor_patch

from doozerlib.cli.release_gen_payload import assembly_rhcos_cli
from doozerlib.cli.release_gen_payload import release_gen_payload
from doozerlib.cli.get_nightlies import get_nightlies
from doozerlib.cli.detect_embargo import detect_embargo
Expand Down
17 changes: 17 additions & 0 deletions doozerlib/cli/release_gen_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@
from doozerlib.exceptions import DoozerFatalError
from doozerlib.util import find_manifest_list_sha

@cli.command("inspect-assembly:rhcos")
@pass_runtime
def inspect_assembly_rhcos_cli(runtime):
runtime.initialize(mode=None, clone_distgits=False, clone_source=False, prevent_cloning=True)
assembly_inspector = AssemblyInspector(runtime, runtime.build_retrying_koji_client(), lookup_mode=None)
rhcos_build_ids = set()
for arch in runtime.arches:
rhcos_members, issues = PayloadGenerator._find_rhcos_payload_entries(assembly_inspector, arch)
if issues:
runtime.logger.warning(issues)

# Almost all the time, all payload tags for an arch will have the same build
rhcos_build_ids.update({str(entry.rhcos_build) for tag, entry in rhcos_members.items()})

if len(rhcos_build_ids) > len(runtime.arches):
raise ValueError("Not all payload tags have the same rhcos build, command does not support that usecase")
click.echo(sorted(rhcos_build_ids))

@cli.command("release:gen-payload", short_help="Mirror release images to quay and release-controller")
@click.option("--is-name", metavar="NAME", required=False,
Expand Down

0 comments on commit a78b712

Please sign in to comment.