-
Notifications
You must be signed in to change notification settings - Fork 466
MCO-2120: Rework OS Image Stream label classification #5650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@pablintino: This pull request references MCO-2120 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pablintino The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/osimagestream/image_data.go
Outdated
| // coreOSLabelOSTree is the container image label present on ostree-based OS images. | ||
| coreOSLabelOSTree = "ostree.bootable" | ||
| coreOSLabelOSTreeValue = "true" | ||
| // coreOSLabelBootc is the container image label present on bootc-based OS images. | ||
| coreOSLabelBootc = "containers.bootc" | ||
| coreOSLabelBootcValue = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So. I think we can just use a single label here because containers.bootc is already present even on older (say 4.20) images:
$ skopeo inspect -n docker://quay.io/openshift-release-dev/ocp-v4.0-art-dev:9.6.20260112-0-coreos | jq .Labels
{
"com.coreos.osname": "rhcos",
"containers.bootc": "1",
"coreos-assembler.image-config-checksum": "b444a32e2801642f1e41777fd51fa53304496c58a3a6b15e5964a1f86f866507",
"io.openshift.build.version-display-names": "machine-os=Red Hat Enterprise Linux CoreOS",
"io.openshift.build.versions": "machine-os=9.6.20260112-0",
"org.opencontainers.image.revision": "1fe200e9dd4262baee4947248a91e26b20c37e1a",
"org.opencontainers.image.source": "https://github.com/coreos/rhel-coreos-config.git",
"org.opencontainers.image.version": "9.6.20260112-0",
"ostree.bootable": "true",
"ostree.commit": "06cf91269a29db6c9f0a27d9dad53efaee790f7231495fe78c4bbec9400504b2",
"ostree.final-diffid": "sha256:12787d84fa137cd5649a9005efe98ec9d05ea46245fdc50aecb7dd007f2035b1",
"ostree.linux": "5.14.0-570.78.1.el9_6.x86_64",
"rpmostree.inputhash": "fe655ed136272c3559660c6d9892ea13d90fb6b435dc6893ab759bc60432d451"
}
and we probably also need to accept multiple values because today I see "containers.bootc": "1" but if they ever change it to true we might want to just be safe:
| // coreOSLabelOSTree is the container image label present on ostree-based OS images. | |
| coreOSLabelOSTree = "ostree.bootable" | |
| coreOSLabelOSTreeValue = "true" | |
| // coreOSLabelBootc is the container image label present on bootc-based OS images. | |
| coreOSLabelBootc = "containers.bootc" | |
| coreOSLabelBootcValue = "true" | |
| // coreOSLabelBootc is the container image label present on OS images. | |
| coreOSLabelBootc = "containers.bootc" | |
| coreOSLabelBootcValues = ["true", "1"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I've addresed both comments.
Replace the single ostree.linux discriminator with configurable label matchers that explicitly classify OS images (ostree.bootable, containers.bootc) and extensions images (io.openshift.os.extensions). Images that match no discriminator now return nil instead of defaulting to extensions. Signed-off-by: Pablo Rodriguez Nava <[email protected]>
- What I did
Replace the single ostree.linux discriminator with configurable label matchers that explicitly classify OS images ostree.bootable, containers.bootc) and extensions images (io.openshift.os.extensions).
Images that match no discriminator now return nil instead of defaulting to extensions.
- How to verify it
Regular CI tests are enough to verify this change.
- Description for the changelog
OS image streams now use explicit label matchers (ostree.bootable, containers.bootc, io.openshift.os.extensions) instead of a single ostree.linux discriminator to classify OS and extensions images