Skip to content

MCO-1961: Allow multiple machine-os versions - #2157

Merged
sdodson merged 1 commit into
openshift:mainfrom
sdodson:main
Mar 24, 2026
Merged

sdodson merged 1 commit into
openshift:mainfrom
sdodson:main

Conversation

@sdodson

@sdodson sdodson commented Dec 1, 2025

Copy link
Copy Markdown
Member

No description provided.

@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 Dec 1, 2025
@openshift-ci

openshift-ci Bot commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

Walkthrough

Allow the "machine-os" component to differ across tags: loadImageStreamTransforms now ignores version conflicts for the machine-os component when merging component version annotations, and readComponentVersions excludes machine-os from the "multiple versions" tracking in both construction and enrichment passes.

Changes

Cohort / File(s) Summary
machine-os exception (merge + read)
pkg/cli/admin/release/image_mapper.go, pkg/cli/admin/release/info.go
image_mapper.go:loadImageStreamTransforms skips the single-version conflict error for component key "machine-os" when merging annotations. info.go:readComponentVersions omits "machine-os" from the multiples set in both the initial build and enrichment passes, preventing it from triggering "multiple versions/display names" handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@sdodson

sdodson commented Dec 2, 2025

Copy link
Copy Markdown
Member Author

/test images unit

@sdodson sdodson changed the title Allow multiple machine-os versions MCO-1961: Allow multiple machine-os versions Dec 3, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 3, 2025
@openshift-ci-robot

openshift-ci-robot commented Dec 3, 2025 •

Copy link
Copy Markdown

@sdodson: This pull request references MCO-1961 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.21.0" version, but no target version was set.

Details

In 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.

@sdodson
sdodson marked this pull request as ready for review December 3, 2025 03:36
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2025
@openshift-ci
openshift-ci Bot requested review from ardaguclu and tchap December 3, 2025 03:37
if ok {
if existing.Version != v.Version {
// we allow multiple machine-os versions due to dual stream efforts
if existing.Version != v.Version && k != "machine-os" {

@ardaguclu ardaguclu Dec 3, 2025 •

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.

This disables component version skew check entirely for machine-os component. Would it be better if we only allow 2 different machine-os versions and fail if there are 3 (to prevent any divergence) as we did #1662 (and #1656).

Additionally, same changes need to go Hypershift https://github.com/openshift/hypershift/blob/02f528cd5364b03168500ada33c9a0d9d0593025/support/releaseinfo/releaseinfo.go#L185

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.

Thanks for pointing out the hypershift use case. For the time being we're simply dropping the machine-os version from the rhel-coreos-10 images but I think we need to figure out how to effectively re-introduce this. Ideally for 4.22 but perhaps deferred to the next release after 4.22. I'm going to close this for the time being but open up a ticket for the RHCOS team to dive into this across the problem space.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Limiting to two values here will probably backfire later because we may have more streams coming up : the nvidia kernel, confidential clusters.. Now that this can of worms is open, more may even be added

@tchap

tchap commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

We should also add some tests BTW.

@sdodson

sdodson commented Dec 5, 2025

Copy link
Copy Markdown
Member Author

/close
for now, RHCOS team to take a ticket to chase this across the problem space to ensure that we can have multiple unique versions for RHCOS in the release payload.

@openshift-ci openshift-ci Bot closed this Dec 5, 2025
@openshift-ci

openshift-ci Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

@sdodson: Closed this PR.

Details

In response to this:

/close
for now, RHCOS team to take a ticket to chase this across the problem space to ensure that we can have multiple unique versions for RHCOS in the release payload.

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 kubernetes-sigs/prow repository.

@jbtrystram

Copy link
Copy Markdown

Picking that up.
So i did build a payload with two machine-os images, and with this patch, oc does not complain.

oc adm release info quay.io:443/jbtrystramtestimages/rhel-coreos:4.22.0-ec.3-full-payload                                
Name:           4.22.0-ec.3
Digest:         sha256:d6514d0ec05b7e09e8f0dedcc68fe23d3afdd3a899dba391258210cc5399efa2
Created:        2026-03-11T20:08:31Z
OS/Arch:        linux/amd64
Manifests:      859
Metadata files: 2

Pull From: quay.io:443/jbtrystramtestimages/rhel-coreos@sha256:d6514d0ec05b7e09e8f0dedcc68fe23d3afdd3a899dba391258210cc5399efa2

Release Metadata:
  Version:  4.22.0-ec.3
  Upgrades: 4.21.0, 4.21.1, 4.21.2, 4.21.3, 4.21.4, 4.22.0-ec.0, 4.22.0-ec.1, 4.22.0-ec.2
  Metadata:

Component Versions:
  kubectl          1.34.1        
  kubernetes       1.34.2        
  kubernetes-tests 1.34.1        
  machine-os       10.2.20260311 Red Hat Enterprise Linux CoreOS

Images:
  NAME                                           DIGEST
  agent-installer-api-server               
<...> 
  rhel-coreos                                    sha256:42e2e4d11674c603398469770700ef5a30432294ffa245ed1c67852e93fc380e
  rhel-coreos-10                                 quay.io:443/jbtrystramtestimages/rhel-coreos:4.22-10.2-tagged
  rhel-coreos-10-extensions                      sha256:ee90288a9dfc801da76f890438957d38702c09c94ecaaaeef0f56b5cd2eb19a9
  rhel-coreos-extensions                         sha256:b7d9bb1dee4383e0e64baaabb915c194deebf9cbe19726aaea7e3498eaa2c59e
<...>

Warnings:
* multiple versions or display names reported for the following component(s): machine-os

@sdodson

sdodson commented Mar 17, 2026

Copy link
Copy Markdown
Member Author

/reopen
@ardaguclu We're now looking at potentially having multiple streams which means we'll have N number of images labeled with machine-os version. Can you think of any issues that will arise in product if we allow that?

Thanks @jbtrystram for testing this out, I was never able to get to that point.

@openshift-ci openshift-ci Bot reopened this Mar 17, 2026
@openshift-ci

openshift-ci Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@sdodson: Reopened this PR.

Details

In response to this:

/reopen
@ardaguclu We're now looking at potentially having multiple streams which means we'll have N number of images labeled with machine-os version. Can you think of any issues that will arise in product if we allow that?

Thanks @jbtrystram for testing this out, I was never able to get to that point.

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 kubernetes-sigs/prow repository.

@openshift-ci-robot

openshift-ci-robot commented Mar 17, 2026 •

Copy link
Copy Markdown

@sdodson: This pull request references MCO-1961 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.

Details

In 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.

@ardaguclu

ardaguclu commented Mar 18, 2026 •

Copy link
Copy Markdown
Member

/reopen @ardaguclu We're now looking at potentially having multiple streams which means we'll have N number of images labeled with machine-os version. Can you think of any issues that will arise in product if we allow that?

Thanks @jbtrystram for testing this out, I was never able to get to that point.

It is difficult to see the implications of this change (maybe there isn't any). But machine-os is critical parts of this releasing process

// We strongly control the set of allowed component versions to prevent confusion
// about what component versions may be used for. Changing this list requires
// approval from the release architects.
AllowedComponents: []string{"kubernetes", "machine-os", "kernel", "crio", "kubectl", "kubernetes-tests"},
,
func (o *InfoOptions) describeRpmDiff(releaseInfo *ReleaseInfo, diff *ReleaseDiff, cacheDir, format, targetImage string) error {

In my opinion, by allowing any arbitrary stream we would permanently lose the control. Would it be too difficult to embed all possible streams in oc and do not allow the others?. That would bring about some maintenance burden, but at least we intentionally update the list.

@ardaguclu

Copy link
Copy Markdown
Member

Also cc'ing @wking @bradmwilliams (please ignore if you are not related to this topic)

@sdodson

sdodson commented Mar 18, 2026

Copy link
Copy Markdown
Member Author

In my opinion, by allowing any arbitrary stream we would permanently lose the control. Would it be too difficult to embed all possible streams in oc and do not allow the others?. That would bring about some maintenance burden, but at least we intentionally update the list.

In the past few months its become clear that we're likely to see a proliferation of streams. It's probably right on the tipping point as to whether or not it will be manageable to do this with a lot of cross repo coordination, right now the MCO, Installer, and RHCOS are all oriented toward dynamic discovery so that we don't have to coordinate.

@jbtrystram

Copy link
Copy Markdown

@sdodson here is a patch to remove the warning when creating the payload :

From 81fa5a71b3bbfb1eda6c001df6634f90d4743afc Mon Sep 17 00:00:00 2001
From: jbtrystram <jbtrystram@redhat.com>
Date: Tue, 24 Mar 2026 11:26:34 +0100
Subject: [PATCH] release/info: allow multiple machine-os versions

Rhcos will now come in two flavors : rhel-9 base and rhel-10. We remove
the warning when more than one version is reported.
Let's not put a limit here as  we're likely to see a proliferation of
streams with nvidia and confidential clusters comming up.

Assisted-by: OpenCode.ai <Opus 4.6>
---
 pkg/cli/admin/release/info.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkg/cli/admin/release/info.go b/pkg/cli/admin/release/info.go
index 2367751d1..ff9b60718 100644
--- a/pkg/cli/admin/release/info.go
+++ b/pkg/cli/admin/release/info.go
@@ -1058,7 +1058,8 @@ func readComponentVersions(is *imageapi.ImageStream, errOut io.Writer) (Componen
        sort.Strings(keys)
        for _, k := range keys {
                v := combined[k]
-               if v.Len() > 1 {
+               // we allow multiple machine-os versions due to dual stream efforts
+               if v.Len() > 1 && k != "machine-os" {
                        multiples = multiples.Insert(k)
                }
                if _, ok := out[k]; ok {
@@ -1075,7 +1076,8 @@ func readComponentVersions(is *imageapi.ImageStream, errOut io.Writer) (Componen
                if !ok {
                        continue
                }
-               if v.Len() > 1 {
+               // we allow multiple machine-os display names due to dual stream efforts
+               if v.Len() > 1 && k != "machine-os" {
                        multiples = multiples.Insert(k)
                }
                version, ok := out[k]
-- 
2.53.0

@ardaguclu

Copy link
Copy Markdown
Member

I'll defer the decision to @sdodson about relaxing the validation

@sdodson

sdodson commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

@sdodson here is a patch to remove the warning when creating the payload :

Thanks, I wasn't able to git apply the patch, not sure why. But I've applied the changes. PTAL

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/cli/admin/release/info.go (1)

1062-1062: Consider extracting the "machine-os" string to a constant.

The literal "machine-os" is used in multiple locations across this file and image_mapper.go. A shared constant would reduce the risk of typos and make future updates easier.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/cli/admin/release/info.go` at line 1062, The literal "machine-os" is
duplicated; define a shared constant (e.g., MachineOSKey or MACHINE_OS) and
replace all occurrences of the string in this file and in image_mapper.go
(locations like the conditional using k == "machine-os" and any map lookups or
key comparisons) to use that constant; update imports/visibility as needed so
both files can reference the constant (place it in a common package or exported
const) and run tests to ensure no typos remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/cli/admin/release/info.go`:
- Line 1062: The literal "machine-os" is duplicated; define a shared constant
(e.g., MachineOSKey or MACHINE_OS) and replace all occurrences of the string in
this file and in image_mapper.go (locations like the conditional using k ==
"machine-os" and any map lookups or key comparisons) to use that constant;
update imports/visibility as needed so both files can reference the constant
(place it in a common package or exported const) and run tests to ensure no
typos remain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29b7d6bd-fc19-48f8-8a64-638452406180

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef0058 and 70c6016.

📒 Files selected for processing (2)
  • pkg/cli/admin/release/image_mapper.go
  • pkg/cli/admin/release/info.go

@sdodson

sdodson commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

I'd like to move forward with this so we can make sure that this works properly in time for branch cut.

@ardaguclu

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 24, 2026

@jbtrystram jbtrystram left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

openshift-ci Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, jbtrystram, sdodson

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

@ardaguclu

Copy link
Copy Markdown
Member

/retest

@openshift-ci

openshift-ci Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@sdodson: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sdodson

sdodson commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

/verified later

@openshift-ci-robot

Copy link
Copy Markdown

@sdodson: /verified later <@username> requires at least one GitHub @username to be specified (it can be a comma delimited list). It indicates the engineer(s) that will be performing the verification. See https://docs.ci.openshift.org/docs/architecture/jira/#premerge-verification for more information.

Details

In response to this:

/verified later

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.

@sdodson

sdodson commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

/verified later @sdodson

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Mar 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@sdodson: This PR has been marked to be verified later by @sdodson.

Details

In response to this:

/verified later @sdodson

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.

@sdodson
sdodson merged commit 8d7f53e into openshift:main Mar 24, 2026
15 of 17 checks passed
jbtrystram added a commit to jbtrystram/rhel-coreos-config that referenced this pull request Mar 26, 2026
Since we merged openshift/oc#2157 `oc` supports
multiple `machine-os` images, so we can write those labels.

See openshift/oc#2157
@sdodson

sdodson commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick release-4.21

@openshift-cherrypick-robot

Copy link
Copy Markdown

@sdodson: new pull request created: #2244

Details

In response to this:

/cherry-pick release-4.21

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 kubernetes-sigs/prow repository.

bryan-cox added a commit to bryan-cox/hypershift that referenced this pull request Mar 28, 2026
Allow multiple machine-os versions in component version checks to
support dual stream efforts. This mirrors the same change in
openshift/oc#2157.

Refs: openshift/oc#2157

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bryan-cox added a commit to bryan-cox/hypershift that referenced this pull request Mar 28, 2026
Allow multiple machine-os versions in component version checks to
support dual stream efforts. This mirrors the same change in
openshift/oc#2157.

Refs: openshift/oc#2157

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/hypershift that referenced this pull request Mar 29, 2026
Allow multiple machine-os versions in component version checks to
support dual stream efforts. This mirrors the same change in
openshift/oc#2157.

Refs: openshift/oc#2157

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mehabhalodiya pushed a commit to mehabhalodiya/hypershift that referenced this pull request Apr 13, 2026
Allow multiple machine-os versions in component version checks to
support dual stream efforts. This mirrors the same change in
openshift/oc#2157.

Refs: openshift/oc#2157

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants