MCO-2136: Implement osImageStream inheritance for custom MCPs#5697
MCO-2136: Implement osImageStream inheritance for custom MCPs#5697umohnani8 wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@umohnani8: This pull request references MCO-2136 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. |
|
Pre-merge verification Environment Setup: Steps:
MCP for rhel9 (default)oc create -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: rhel9
spec:
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,rhel9]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/rhel9: ""
EOF
machineconfigpool.machineconfiguration.openshift.io/rhel9 created
MCP for rhel10oc create -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: rhel10
spec:
osImageStream:
name: rhel-10
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,rhel10]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/rhel10: ""
EOF
machineconfigpool.machineconfiguration.openshift.io/rhel10 created
$ oc get mcp rhel9 -ojsonpath='{.status.osImageStream.name}'
empty
$ oc get mcp rhel10 -ojsonpath='{.status.osImageStream.name}'
rhel-10
$ oc label node ip-10-0-13-255.us-east-2.compute.internal node-role.kubernetes.io/rhel9=
node/ip-10-0-13-255.us-east-2.compute.internal labeled
$ oc label node ip-10-0-50-220.us-east-2.compute.internal node-role.kubernetes.io/rhel10=
node/ip-10-0-50-220.us-east-2.compute.internal labeled
$ oc debug node/ip-10-0-13-255.us-east-2.compute.internal -- chroot /host rpm-ostree status
Starting pod/ip-10-0-13-255us-east-2computeinternal-debug-m6qtc ...
To use host binaries, run `chroot /host`
State: idle
Deployments:
* ostree-unverified-registry:registry.build07.ci.openshift.org/ci-ln-5ct1s0k/stable@sha256:42e2e4d11674c603398469770700ef5a30432294ffa245ed1c67852e93fc380e
Digest: sha256:42e2e4d11674c603398469770700ef5a30432294ffa245ed1c67852e93fc380e
Version: 9.8.20260221-0 (2026-02-21T19:42:20Z)
Removing debug pod ...
$ oc debug node/ip-10-0-50-220.us-east-2.compute.internal -- chroot /host rpm-ostree status
Starting pod/ip-10-0-50-220us-east-2computeinternal-debug-tmpdw ...
To use host binaries, run `chroot /host`
State: idle
Deployments:
* ostree-unverified-registry:registry.build07.ci.openshift.org/ci-ln-5ct1s0k/stable@sha256:4a1798a3b92a794a69d56eaf78c1521a1c4d2e52fd05057072780ec19ccabd45
Digest: sha256:4a1798a3b92a794a69d56eaf78c1521a1c4d2e52fd05057072780ec19ccabd45
Version: 10.1.20260126-0 (2026-01-27T06:43:47Z)
Removing debug pod ...Tested with existing TC passed: (24.9s) 2026-02-26T09:56:31 "[sig-mco] MCO osImageStream Author:sregidor-NonHyperShiftHOST-Low-86924-[P1] Validate OS Image Streams value"
passed: (1m46s) 2026-02-26T09:57:52 "[sig-mco] MCO osImageStream Author:sregidor-NonHyperShiftHOST-Critical-86495-[P2] Check default OS Image Stream"
passed: (21m16s) 2026-02-26T10:19:24 "[sig-mco] MCO osImageStream Author:sregidor-NonHyperShiftHOST-Longduration-Medium-87097-[P2] Extensions from rhel9 stream to rhel10 stream [Disruptive] [Serial]"
passed: (19m12s) 2026-02-26T10:38:36 "[sig-mco] MCO osImageStream Author:sregidor-NonHyperShiftHOST-Longduration-Medium-87095-[P2] Realtime kernel from rhel9 stream to rhel10 stream [Disruptive] [Serial]" |
|
There are some other scenarios considered too Case 1
MCPoc create -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: infra
spec:
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,infra]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/infra: ""
EOF
machineconfigpool.machineconfiguration.openshift.io/infra created
Case-2
MCPoc create -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: cmcp1
spec:
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,cmcp1]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/cmcp1: ""
EOF
machineconfigpool.machineconfiguration.openshift.io/cmcp1 created
MCPoc create -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: cmcp2
spec:
osImageStream:
name: rhel-9
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,cmcp2]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/cmcp2: ""
EOF
machineconfigpool.machineconfiguration.openshift.io/cmcp2 created
$ oc get mcp cmcp1 -ojsonpath='{.spec.osImageStream.name}'
empty
$ oc get mcp cmcp2 -ojsonpath='{.spec.osImageStream.name}'
rhel-9
For case 2 the cmcp1 MCP does not show osstream mention but when we add the node it shows node on rhel-10 |
831b6cd to
78d09b1
Compare
|
@umohnani8: This pull request references MCO-2136 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. |
78d09b1 to
cb1824a
Compare
|
/test unit |
|
Re-tested for following scenarios: Case1:
Case2:
Question: Though node shows rhel10 version when added in infra mcp but when we check the osstream in it, it shows empty value oc get mcp infra -o yaml | grep rhel
empty
oc debug node/ip-10-0-95-254.us-east-2.compute.internal -- chroot /host rpm-ostree status
Starting pod/ip-10-0-95-254us-east-2computeinternal-debug-sczpp ...
To use host binaries, run `chroot /host`
State: idle
Deployments:
* ostree-unverified-registry:registry.build07.ci.openshift.org/ci-ln-qfm3dgt/stable@sha256:4a1798a3b92a794a69d56eaf78c1521a1c4d2e52fd05057072780ec19ccabd45
Digest: sha256:4a1798a3b92a794a69d56eaf78c1521a1c4d2e52fd05057072780ec19ccabd45
Version: 10.1.20260126-0 (2026-01-27T06:43:47Z)
Removing debug pod ...Case3
Question: Same here too for cmcp MCP not able to see the ossteam mention about rhel-10 though node is on rhel-10 version oc get mcp cmcp1 -ojsonpath='{.spec.osImageStream.name}'
empty
oc get mcp cmcp2 -ojsonpath='{.spec.osImageStream.name}'
rhel-9 |
pablintino
left a comment
There was a problem hiding this comment.
Important:
machine-config-operator/pkg/operator/sync.go
Line 1959 in f194385
This change allows custom MachineConfigPools (pools other than master, worker, or arbiter) to inherit the osImageStream setting from the worker pool when not explicitly set, aligning with the existing inheritance model for custom MCPs. Inheritance priority: 1. If custom MCP explicitly sets spec.osImageStream.name, use that value 2. If not set, inherit from worker pool's spec.osImageStream.name 3. If worker pool also doesn't set it, use OSImageStream.status.defaultStream The implementation includes: - GetEffectiveOSImageStreamName() helper in common/helpers.go for shared inheritance logic - Modified render controller to use inheritance when determining OS images for rendered MachineConfigs - Bootstrap scenario support with static helper function - Automatic re-rendering of custom pools when worker pool's osImageStream changes - Comprehensive unit tests for all inheritance scenarios Note: This change only affects the render controller (spec → osImageURL). Status field population is handled by PR openshift#5689, which automatically reflects the inherited stream by matching deployed osImageURLs against available streams. Signed-off-by: Urvashi <umohnani@redhat.com>
cb1824a to
f02ab03
Compare
|
@pablintino I have addressed your reviews, this should be ready now. @ptalgulk01 will probably verify it when she is back tomorrow. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pablintino, umohnani8 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 |
|
/retest-required |
|
@ptalgulk01 addressing your comment #5697 (comment): It is expected for You will be able to see the effective osStream of any pool under the Status section once #5689 is merged. Feel free to wait for that merge in to verify again before adding the verified label for this PR. |
|
/label qe-approved |
|
@umohnani8: This pull request references MCO-2136 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. |
|
@ptalgulk01: This PR has been marked as verified by 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. |
|
/test e2e-hypershift |
|
@isabella-janssen: This PR was included in a payload test run from openshift/origin#30845
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/e5745130-198b-11f1-9d4f-fb2221c027fa-0 |
|
@isabella-janssen: This PR was included in a payload test run from openshift/origin#30845
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ed76a400-198b-11f1-8a30-b929a0a0432d-0 |
|
@isabella-janssen: This PR was included in a payload test run from openshift/origin#30845
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/f27c3190-198b-11f1-8dd4-0f4d077ca52f-0 |
|
/retest-required |
1 similar comment
|
/retest-required |
|
@umohnani8: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/retest-required |
- What I did
Custom MachineConfigPools now inherit the osImageStream setting from the worker pool when they don't explicitly define one. This aligns with the existing inheritance model where custom MCPs inherit all other settings from the worker pool.
Inheritance priority:
Changes:
- How to verify it
Spin up a cluster with dual stream and techpreview enabled. Create custom pools that inherit from worker pool and that don't and verify that the osImageStream value on those nodes are what is expected
- Description for the changelog
Implement osImageStream inheritance for custom MCPs