Skip to content

MCO-2117: Allow default OSImageStream overrides#5714

Open
pablintino wants to merge 1 commit intoopenshift:mainfrom
pablintino:mco-2117
Open

MCO-2117: Allow default OSImageStream overrides#5714
pablintino wants to merge 1 commit intoopenshift:mainfrom
pablintino:mco-2117

Conversation

@pablintino
Copy link
Contributor

@pablintino pablintino commented Feb 27, 2026

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
  name: cluster
spec:
  defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Change the global default of a cluster running default MCPs

  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                      20:04:46
Starting pod/pabrodri-test-lppjx-master-0-debug-vrvgv ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-lppjx-worker-a-thv4m-debug-plvg8 ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 27, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 27, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

TBD

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2026
@pablintino pablintino force-pushed the mco-2117 branch 3 times, most recently from 1a8d2b6 to 6acb9de Compare February 27, 2026 12:09
Comment on lines +497 to +511
sysCtx, err := sysCtxBuilder.Build()
if err != nil {
return nil, fmt.Errorf("could not prepare for OSImageStream inspection: %w", err)
}
defer func() {
if err := sysCtx.Cleanup(); err != nil {
klog.Warningf("Unable to clean resources after OSImageStream inspection: %s", err)
}
}()

factory := osimagestream.NewDefaultStreamSourceFactory(&osimagestream.DefaultImagesInspectorFactory{})
osImageStream, err := factory.Create(ctx, sysCtx.SysContext, osimagestream.CreateOptions{
ExistingOSImageStream: existingOSImageStream,
ReleaseImageStream: imageStream,
CliImages: &osimagestream.OSImageTuple{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for reviewers: This change is "this big" mostly because the removal of the thin BuildOsImageStreamBootstrap wrappers as part of this PR. The important point, from the default handling point of view is that the ExistingOSImageStream is filled with whatever the installer passed.

ReleaseImageVersionAnnotationKey = "machineconfiguration.openshift.io/release-image-version"

// BuiltinDefaultStreamAnnotationKey is the MCO fallback default stream.
BuiltinDefaultStreamAnnotationKey = "machineconfiguration.openshift.io/builtin-default-stream"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reviewer: Used to store the fallback stream the MCO would use in case no default is provided by the installer/user.
Why do we need to store it? To avoid inspecting the payload over and over again during operator syncs.

Copy link
Contributor

@djoshy djoshy Mar 4, 2026

Choose a reason for hiding this comment

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

I think this is a good thing, since consulting the payload during an upgrade scenario might be problematic on a default change. How we have it setup right now should only cause a rebuild on MCO hash changes.

I wonder if we could upgrade test such a scenario to see if it behaves as we expect, though.

Copy link
Contributor

@djoshy djoshy Mar 4, 2026

Choose a reason for hiding this comment

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

Thinking about this more...as we're going to use an upgrade block to force all pools to transition to the new default stream before upgrading, the scenario described above should never happen? Sorry for the noise 😅

Comment on lines +109 to +127
sysCtx, err := sysCtxBuilder.Build()
if err != nil {
return fmt.Errorf("could not prepare for OSImageStream inspection: %w", err)
}
defer func() {
if err := sysCtx.Cleanup(); err != nil {
klog.Warningf("Unable to clean resources after OSImageStream inspection: %s", err)
}
}()

factory := osimagestream.NewDefaultStreamSourceFactory(&osimagestream.DefaultImagesInspectorFactory{})
osImageStream, err := factory.Create(
buildCtx,
sysCtx.SysContext,
osimagestream.CreateOptions{
ReleaseImage: image,
ConfigMapLister: optr.mcoCmLister,
ExistingOSImageStream: existingOSImageStream,
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
releaseVersion, ok := osImageStream.Annotations[ctrlcommon.ReleaseImageVersionAnnotationKey]
return !ok || releaseVersion != version.Hash
return !ok || releaseVersion != version.Hash || osimagestream.GetBuiltinDefault(osImageStream) == ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reviewer: If the annotation is removed ensure we rebuild the CR. Shouldn't happen, but just in case an admin user removes it.

Comment on lines +54 to +65
i.cacheLock.Lock()
defer i.cacheLock.Unlock()
if i.imageStream != nil {
return i.imageStream, nil
}
is, err := i.fetchImageStream(ctx)
if err != nil {
return nil, err
}
i.imageStream = is
return is, nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reviewer: Now we have a look at the ImageStream twice, one to fetch the streams and another one to determine the default stream. To avoid that new extra call (or future calls if we need more) I've added this simple cache mechanism.

Comment on lines -33 to +32
// CreateRuntimeSources builds an OSImageStream for runtime operation.
CreateRuntimeSources(ctx context.Context, releaseImage string, sysCtx *types.SystemContext) (*v1alpha1.OSImageStream, error)
// CreateBootstrapSources builds an OSImageStream for bootstrap operation.
CreateBootstrapSources(ctx context.Context, imageStream *imagev1.ImageStream, cliImages *OSImageTuple, sysCtx *types.SystemContext) (*v1alpha1.OSImageStream, error)
// Create builds an OSImageStream from the configured sources and options.
Create(ctx context.Context, sysCtx *types.SystemContext, opts CreateOptions) (*v1alpha1.OSImageStream, error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reviewer: With the inclusion of the default stream field the signature of these two functions started to be a mess I didn't like at all so I converged both and switch to a single arg with all the possible options as fields.

Comment on lines +690 to +696
cv, err := clientSet.ClusterVersions().Get(ctx, "version", metav1.GetOptions{})
require.NoError(t, err, "Error retrieving ClusterVersion")

payloadVersion, err := semver.ParseTolerant(cv.Status.Desired.Version)
require.NoError(t, err, "Error parsing payload version")

featureGateStatus := features.FeatureSets(payloadVersion.Major, SelfManaged, currentFeatureSet)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reviewer: This is because of a breaking change in the FeatureGate's API.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero
  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Move an entire cluster, that uses MCPs with no explicit osImageStream to rhel-10 in a single move

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Removing debug pod ...

Move an entire cluster, that uses MCPs with no explicit osImageStream to rhel-10 in a single move

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

Previously the default stream was determined by matching the OS version
in the stream name, without the possibility of telling the MCO which
default stream to use. This change replaces that logic, allowing users
to input the defaultStream they want to use and falling back to the
builtin if necessary. The builtin default stream determination logic
has been improved to avoid hard-coding versions and it now picks the
OSImageStream that points to the images of the default OS tags
in the payload ImageStream.

Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.com>
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

  1. Create the manifests using the intaller:
mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)
  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)
####  Move an entire cluster, that uses MCPs with no explicit osImageStream to rhel-10 in a single move


**- Description for the changelog**

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)
  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Move an entire cluster, that uses MCPs with no explicit osImageStream to rhel-10 in a single move

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Change the global default of a cluster running default MCPs

  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Move an entire cluster, that uses MCPs with no explicit osImageStream to rhel-10 in a single move

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Change the global default of a cluster running default MCPs

  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                               14:33:37
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                    14:39:01
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@pablintino: This pull request references MCO-2117 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:

- What I did

Previously the default stream was determined by matching the OS version in the stream name, without the possibility of telling the MCO which default stream to use. This change replaces that logic, allowing users to input the defaultStream they want to use and falling back to the builtin if necessary. The builtin default stream determination logic has been improved to avoid hard-coding versions and it now picks the OSImageStream that points to the images of the default OS tags in the payload ImageStream.

- How to verify it

There are two main scenarios to test.

Install a cluster with a different default set at day-zero

mkdir installer-dir
./openshift-install --dir installer-dir create manifests

# Enable TechPreview
yq -i '.spec.featureSet = "TechPreviewNoUpgrade"' installer-dir/openshift/99_feature-gate.yaml

# Create the simple bare OSImageStream with just the spec
cat << 'EOF' > installer-dir/openshift/99_osimagestream.yaml
apiVersion: machineconfiguration.openshift.io/v1alpha1
kind: OSImageStream
metadata:
 name: cluster
spec:
 defaultStream: rhel-10
EOF

# Deploy the cluster
./openshift-install --dir installer-dir create cluster

# Ensure the nodes are using the expected stream
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-xfllf-master-0-debug-d69vl ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-xfllf-worker-a-nvh9j-debug-76blg ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

Change the global default of a cluster running default MCPs

  1. Install a fresh OCP cluster containing this change with the default and TechPreview enabled.
  2. Wait for it to be fully stable.
  3. Ensure all pools are RHEL 9.
  4. Change the default
oc patch osimagestream cluster --type='merge' -p '{"spec":{"defaultStream":"rhel-10"}}'
  1. Wait for the pools to fully update
  2. Ensure nodes are running RHEL 10
oc debug node/$(oc get nodes -l node-role.kubernetes.io/master -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release                                                                                                      20:04:46
Starting pod/pabrodri-test-lppjx-master-0-debug-vrvgv ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

oc debug node/$(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[0].metadata.name}') -- chroot /host cat /etc/redhat-release
Starting pod/pabrodri-test-lppjx-worker-a-thv4m-debug-plvg8 ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
Red Hat Enterprise Linux release 10.1 (Coughlan)

- Description for the changelog

Allow users to override the default OSImageStream via Spec.DefaultStream, falling back to the builtin default resolved from the payload ImageStream tags.

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

@pablintino: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn 1634d8a link true /test e2e-aws-ovn
ci/prow/e2e-gcp-op-ocl-part1 1634d8a link false /test e2e-gcp-op-ocl-part1
ci/prow/e2e-hypershift 1634d8a link true /test e2e-hypershift

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.

}

func getDefaultImageStreamTag() string {
imageTag := "rhel-coreos"
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, so when we eventually drop rhel9, would the rhel10 stream get this tag?

Copy link
Contributor

@djoshy djoshy left a comment

Choose a reason for hiding this comment

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

Overall makes sense to me, thanks for the very helpful notes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djoshy, pablintino

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants