Skip to content

tree: add labels.json and security OCI labels for Clair scanning#1919

Draft
jlebon wants to merge 2 commits intoopenshift:masterfrom
jlebon:pr/build-args-sec
Draft

tree: add labels.json and security OCI labels for Clair scanning#1919
jlebon wants to merge 2 commits intoopenshift:masterfrom
jlebon:pr/build-args-sec

Conversation

@jlebon
Copy link
Copy Markdown
Member

@jlebon jlebon commented Mar 30, 2026

As part of container-first reporting (KONFLUX-6210), security scanners like Clair expect metadata at the OCI level (as labels) and in the rootfs itself (as a JSON file at /usr/share/buildinfo/labels.json).

To accommodate this, each variant now has a build-args-*.conf file that specifies the image name and CPE, but also while we're here, the image FROM to use which nicely cleans up the building docs. For the architecture, we use buildah's built-in TARGETARCH.

This is only relevant on OCP, not OKD. So skip it there.

Closes: https://redhat.atlassian.net/browse/COS-4051
Assisted-by: OpenCode (Claude Opus 4.6)

jlebon added 2 commits March 30, 2026 15:23
OKD doesn't care about this anymore and we don't either. So this is
essentially dead code.

Nuke all c9s-related bits.

Assisted-by: OpenCode (Claude Opus 4.6)
As part of container-first reporting (KONFLUX-6210), security scanners
like Clair expect metadata at the OCI level (as labels) _and_ in the
rootfs itself (as a JSON file at `/usr/share/buildinfo/labels.json`).

To accommodate this, each variant now has a `build-args-*.conf` file
that specifies the image name and CPE, but also while we're here, the
image `FROM` to use which nicely cleans up the building docs. For the
architecture, we use buildah's built-in `TARGETARCH`.

This is only relevant on OCP, not OKD. So skip it there.

Closes: https://redhat.atlassian.net/browse/COS-4051
Assisted-by: OpenCode (Claude Opus 4.6)
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 30, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 30, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jlebon
Copy link
Copy Markdown
Member Author

jlebon commented Mar 30, 2026

Let's hold this until coreos/fedora-coreos-pipeline#1325 and coreos/coreos-assembler#4512 are merged.

Also, this does imply that for ART to build the node image in Konflux, AIUI doozer would have to learn about build arg files when calling out to Konflux. cc @joepvd in case you have concerns there.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlebon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2026
# instructions on how to build this, see `docs/building.md`.

FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev:c9s-coreos as build
ARG IMAGE_FROM=registry.ci.openshift.org/coreos/stream-coreos-base:10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make it explicit?

Suggested change
ARG IMAGE_FROM=registry.ci.openshift.org/coreos/stream-coreos-base:10
ARG IMAGE_FROM=overridden

target_arch = os.environ.get('TARGETARCH', '')

if not all([image_name, image_cpe, target_arch]):
return
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean it will just silently fail? would we want it to silently fail?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what we could do here is sanity-check whether we're in CentOS Stream or RHEL and only in the latter loudly fail.

@jlebon
Copy link
Copy Markdown
Member Author

jlebon commented Mar 31, 2026

OK filed https://redhat.atlassian.net/browse/ART-14812 for the ART side of this. I didn't hear a "no, we don't want to support this" from Joep. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants