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

Commit

Permalink
gen-payload: Fix an issue with assembly issue reporting
Browse files Browse the repository at this point in the history
When run gen-payload for 4.12.0-ec.2, we got the following assembly
issues:

```
  reference-releases:
  - code: IMPERMISSIBLE
    msg: '4.12.0-0.nightly-arm64-2022-08-24-034137 contains rhel-coreos-8 sha sha256:15aa3c7c678611df0d72eb9b4fa3a94c9f5e5c3664c029b126c4e98a5aaf533f
      but assembly computed rhcos: RHCOSBuild:aarch64:412.86.202208231642-0 and sha256:c9e219621c27463a430696162e1205efdec8e10df02b6cdf9f3b5bfda29ce2a9'
    permitted: false
  - code: IMPERMISSIBLE
    msg: '4.12.0-0.nightly-ppc64le-2022-08-24-033937 contains rhel-coreos-8 sha sha256:b47da0fa4451d11cb3d259a06f9651eac49ffeceb1787892dcf886bc276552c5
      but assembly computed rhcos: RHCOSBuild:ppc64le:412.86.202208231209-0 and sha256:d6028d18530df9bf056f8d00a0c50a2e742ba4934ccfb5503f41f483403c022f'
    permitted: false
  - code: IMPERMISSIBLE
    msg: '4.12.0-0.nightly-s390x-2022-08-24-034122 contains rhel-coreos-8 sha sha256:0a2be279d5fb687296d7901069063ce696bf9709b785216ca576a1b4cea4399f
      but assembly computed rhcos: RHCOSBuild:s390x:412.86.202208231711-0 and sha256:ce301be2b711336684a1596128fe8e867eb2b46767ea406914799eacc108ae3f'
    permitted: false
  - code: IMPERMISSIBLE
    msg: '4.12.0-0.nightly-2022-08-24-053339 contains rhel-coreos-8 sha sha256:7d39d0f5fe33754167376915ef74c0bd2e8fef6b4584515b3bb91aead8c78904
      but assembly computed rhcos: RHCOSBuild:x86_64:412.86.202208222005-0 and sha256:824955c49b3f4778682df94c85d9b44c17810542ac3132a85a49016ae0851b69'
    permitted: false
```

When checking for RHCOS consistency, Doozer confused by seeing multiple
RHCOS tags in a payload. It compares the digest of one tag with the one
for another tag.
  • Loading branch information
vfreex committed Aug 26, 2022
1 parent 0e4c1de commit 48efe39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doozerlib/cli/release_gen_payload.py
Expand Up @@ -8,6 +8,7 @@

import click
import yaml
from doozerlib import rhcos
import openshift as oc
from doozerlib.rpm_utils import parse_nvr

Expand Down Expand Up @@ -1132,6 +1133,7 @@ def terminal_issue(msg: str) -> List[AssemblyIssue]:
payload_entries: Dict[str, PayloadGenerator.PayloadEntry]
issues: List[AssemblyIssue]
payload_entries, issues = PayloadGenerator.find_payload_entries(assembly_inspector, arch, '')
rhcos_container_configs = {tag.name: tag for tag in rhcos.get_container_configs(runtime)}
for component_tag in release_info.references.spec.tags: # For each tag in the imagestream
payload_tag_name: str = component_tag.name # e.g. "aws-ebs-csi-driver"
payload_tag_pullspec: str = component_tag['from'].name # quay pullspec
Expand All @@ -1151,9 +1153,10 @@ def terminal_issue(msg: str) -> List[AssemblyIssue]:
issues.append(AssemblyIssue(f'{nightly} contains {payload_tag_name} sha {pullspec_sha} but assembly computed archive: {entry.archive_inspector.get_archive_id()} and {entry.archive_inspector.get_archive_pullspec()}',
component='reference-releases'))
elif entry.rhcos_build:
if entry.rhcos_build.get_container_digest() != pullspec_sha:
actual_digest = entry.rhcos_build.get_container_digest(rhcos_container_configs[payload_tag_name])
if actual_digest != pullspec_sha:
# Impermissible because the artist should remove the reference nightlies from the assembly definition
issues.append(AssemblyIssue(f'{nightly} contains {payload_tag_name} sha {pullspec_sha} but assembly computed rhcos: {entry.rhcos_build} and {entry.rhcos_build.get_container_digest()}',
issues.append(AssemblyIssue(f'{nightly} contains {payload_tag_name} sha {pullspec_sha} but assembly computed rhcos: {entry.rhcos_build} and {actual_digest}',
component='reference-releases'))
else:
raise IOError(f'Unsupported payload entry {entry}')
Expand Down

0 comments on commit 48efe39

Please sign in to comment.