Skip to content

MCO-2116: Generate OSImageStream manifest#10357

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
pablintino:mco-2116
Mar 23, 2026
Merged

MCO-2116: Generate OSImageStream manifest#10357
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
pablintino:mco-2116

Conversation

@pablintino
Copy link
Copy Markdown
Contributor

@pablintino pablintino commented Mar 4, 2026

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

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

openshift-ci-robot commented Mar 4, 2026

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

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 4, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 4, 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 10, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0a0807e-5bf3-485e-95ea-b2d3739ab28d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new OSImageStream writable asset and integrates it into OpenShift manifest generation; introduces DefaultOSImageStream constants for RHCOS and SCOS. The asset emits an OSImageStream CR when the OS Streams feature gate is enabled and the target is not SCOS.

Changes

Cohort / File(s) Summary
OSImageStream manifest asset
pkg/asset/manifests/osimagestream.go
New writable asset OSImageStream: depends on InstallConfig, reads/defaults the stream, builds an mcfgv1alpha.OSImageStream, marshals to YAML, and emits 99_osimagestream.yaml. No-op when OS Streams feature gate is disabled or target is SCOS.
OpenShift manifest generation
pkg/asset/manifests/openshift.go
Wired OSImageStream into manifest generation: added to Dependencies(), instantiated in Generate(), retrieved via dependencies.Get(), and its Files() appended to the final manifest file list.
RHCOS / SCOS default stream constants
pkg/rhcos/stream.go, pkg/rhcos/stream_scos.go
Added exported DefaultOSImageStream constants: RHCOS set to types.OSImageStreamRHCOS9; SCOS variant defined as empty (unused in SCOS).
Marketplace stream merge fix
hack/build-coreos-manifest.go
Persist modified architecture entry back into stream.Architectures after setting marketplace extensions to ensure changes are saved.

Sequence Diagram(s)

sequenceDiagram
    participant Generator
    participant Deps as dependencies.Get
    participant InstallConfig
    participant OSIS as OSImageStream
    participant Manifests
    participant FS as FileWriter

    Generator->>Manifests: Generate()
    Manifests->>Deps: Request dependencies (InstallConfig, OSImageStream)
    Deps->>InstallConfig: Provide InstallConfig
    Deps->>OSIS: Provide OSImageStream instance
    OSIS->>InstallConfig: Read feature gates, target, stream
    alt feature gate enabled and not SCOS
        OSIS->>OSIS: Build mcfgv1alpha.OSImageStream
        OSIS->>OSIS: Marshal to YAML (99_osimagestream.yaml)
        OSIS-->>Manifests: Return Files()
    else
        OSIS-->>Manifests: Return no files
    end
    Manifests->>FS: Append files and write outputs
    FS-->>Generator: Files written
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: generating OSImageStream manifest support in the OpenShift installer when the feature gate is enabled.
Stable And Deterministic Test Names ✅ Passed PR contains no Ginkgo test files; all changes are to implementation files only.
Test Structure And Quality ✅ Passed PR does not include any Ginkgo test code; all changes are production code only.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 10, 2026

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

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

Summary by CodeRabbit

  • New Features
  • Added support for generating OS Image Stream manifests in the OpenShift installer for enhanced image stream management.
  • Manifest generation is conditionally activated based on feature gate status and cluster configuration.
  • Platform-specific default image stream settings are now supported across RHCOS and other distributions.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/asset/manifests/osimagestream.go`:
- Around line 44-63: The OSImageStream CR is being created even when no stream
was chosen; update the generation logic that currently checks
features.FeatureGateOSStreams and installConfig.Config.IsSCOS to also skip when
installConfig.Config.OSImageStream is empty (or only whitespace). Specifically,
before constructing the mcfgv1alpha.OSImageStream (the osImageStream variable
and its Spec.DefaultStream), add a guard that returns nil if
installConfig.Config.OSImageStream is blank so no 99_osimagestream.yaml is
emitted with an empty spec.defaultStream.

In `@pkg/rhcos/stream_scos.go`:
- Around line 5-6: Add the missing import that provides the OSImageStream type:
import the package that defines OSImageStream and alias it as types (so the file
can reference types.OSImageStream) before declaring the DefaultOSImageStream
constant; update the import block in pkg/rhcos/stream_scos.go accordingly so
DefaultOSImageStream and types.OSImageStream resolve.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27091357-7587-41b5-bb98-c07bb88b1dff

📥 Commits

Reviewing files that changed from the base of the PR and between d3f34bb and ac63620.

📒 Files selected for processing (4)
  • pkg/asset/manifests/openshift.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/rhcos/stream.go
  • pkg/rhcos/stream_scos.go

Comment on lines +44 to +63
// If one of the following are true the OSImageStream CR is not generated
// 1. The feature is not enabled
// 2. The target is OKD
if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) || installConfig.Config.IsSCOS() {
// FG disabled or not OCP
return nil
}

osImageStream := &mcfgv1alpha.OSImageStream{
TypeMeta: metav1.TypeMeta{
APIVersion: mcfgv1alpha.SchemeGroupVersion.String(),
Kind: "OSImageStream",
},
ObjectMeta: metav1.ObjectMeta{
Name: "cluster",
},
Spec: &mcfgv1alpha.OSImageStreamSpec{
DefaultStream: string(installConfig.Config.OSImageStream),
},
}
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Mar 10, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Skip OSImageStream generation when no stream was selected.

This currently emits 99_osimagestream.yaml whenever the feature gate is on, even if installConfig.Config.OSImageStream is empty. That produces a CR with an empty spec.defaultStream, which does not match the PR objective of generating the manifest only when a stream was chosen.

Suggested fix
-	if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) || installConfig.Config.IsSCOS() {
+	if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) ||
+		installConfig.Config.IsSCOS() ||
+		installConfig.Config.OSImageStream == "" {
 		// FG disabled or not OCP
 		return nil
 	}
@@
 		Spec: &mcfgv1alpha.OSImageStreamSpec{
-			DefaultStream: string(installConfig.Config.OSImageStream),
+			DefaultStream: installConfig.Config.OSImageStream,
 		},
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// If one of the following are true the OSImageStream CR is not generated
// 1. The feature is not enabled
// 2. The target is OKD
if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) || installConfig.Config.IsSCOS() {
// FG disabled or not OCP
return nil
}
osImageStream := &mcfgv1alpha.OSImageStream{
TypeMeta: metav1.TypeMeta{
APIVersion: mcfgv1alpha.SchemeGroupVersion.String(),
Kind: "OSImageStream",
},
ObjectMeta: metav1.ObjectMeta{
Name: "cluster",
},
Spec: &mcfgv1alpha.OSImageStreamSpec{
DefaultStream: string(installConfig.Config.OSImageStream),
},
}
// If one of the following are true the OSImageStream CR is not generated
// 1. The feature is not enabled
// 2. The target is OKD
if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) ||
installConfig.Config.IsSCOS() ||
installConfig.Config.OSImageStream == "" {
// FG disabled or not OCP
return nil
}
osImageStream := &mcfgv1alpha.OSImageStream{
TypeMeta: metav1.TypeMeta{
APIVersion: mcfgv1alpha.SchemeGroupVersion.String(),
Kind: "OSImageStream",
},
ObjectMeta: metav1.ObjectMeta{
Name: "cluster",
},
Spec: &mcfgv1alpha.OSImageStreamSpec{
DefaultStream: installConfig.Config.OSImageStream,
},
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/asset/manifests/osimagestream.go` around lines 44 - 63, The OSImageStream
CR is being created even when no stream was chosen; update the generation logic
that currently checks features.FeatureGateOSStreams and
installConfig.Config.IsSCOS to also skip when installConfig.Config.OSImageStream
is empty (or only whitespace). Specifically, before constructing the
mcfgv1alpha.OSImageStream (the osImageStream variable and its
Spec.DefaultStream), add a guard that returns nil if
installConfig.Config.OSImageStream is blank so no 99_osimagestream.yaml is
emitted with an empty spec.defaultStream.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is expected. The CR should be generated always. If the user doesn't select a stream we should render the CR with the default stream the intaller uses.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@pablintino, understood — always emit the CR and use the installer's default when no stream was chosen. My suggestion to skip was wrong.

That said, the current code still has a gap: when installConfig.Config.OSImageStream is empty it writes an empty spec.defaultStream instead of falling back to rhcos.DefaultOSImageStream. A small defaulting step before constructing the CR would cover that case:

stream := installConfig.Config.OSImageStream
if stream == "" {
    stream = rhcos.DefaultOSImageStream
}

osImageStream := &mcfgv1alpha.OSImageStream{
    ...
    Spec: &mcfgv1alpha.OSImageStreamSpec{
        DefaultStream: string(stream),
    },
}

This keeps the "always generate" intent while ensuring a valid default is written.

( •ᴗ• )っ


📝 Learnings were identified and not saved (knowledge base disabled). Enable

Comment thread pkg/rhcos/stream_scos.go
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 10, 2026

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

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

Summary by CodeRabbit

  • New Features
  • Generates OS Image Stream manifests as part of OpenShift install assets.
  • Manifest generation is conditional on the OS Streams feature gate and target type (skips for SCOS).
  • Adds platform-specific default image stream behavior so RHCOS and SCOS targets handle defaults appropriately.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
pkg/asset/manifests/osimagestream.go (1)

3-16: Consider grouping imports by origin.

Standard library imports (context, path) are mixed with external and internal packages. Grouping them separately improves readability.

♻️ Suggested organization
 import (
 	"context"
-	"github.com/openshift/installer/pkg/rhcos"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"path"
 
 	"github.com/openshift/api/features"
 	"github.com/pkg/errors"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"sigs.k8s.io/yaml"
 
 	mcfgv1alpha "github.com/openshift/api/machineconfiguration/v1alpha1"
 	"github.com/openshift/installer/pkg/asset"
 	"github.com/openshift/installer/pkg/asset/installconfig"
+	"github.com/openshift/installer/pkg/rhcos"
 )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/asset/manifests/osimagestream.go` around lines 3 - 16, Reorder the import
block in osimagestream.go to group standard library packages together,
third-party packages together, and internal repository packages together: place
"context" and "path" in the first (standard) group, keep k8s and external libs
(metav1, "github.com/openshift/api/features", "github.com/pkg/errors",
"sigs.k8s.io/yaml") in the second group, and the project-specific imports
("github.com/openshift/installer/pkg/rhcos", mcfgv1alpha,
"github.com/openshift/installer/pkg/asset",
"github.com/openshift/installer/pkg/asset/installconfig") in the final group so
the import block is clearly separated by origin.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/asset/manifests/osimagestream.go`:
- Around line 45-48: Update the misleading comment above the OSImageStream
generation check so it refers to IsSCOS() rather than "OKD": clarify that the
OSImageStream CR is not generated when the feature gate
features.FeatureGateOSStreams is disabled or when installConfig.Config.IsSCOS()
(SCOS/OKD target) is true; keep the logic using
installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams)
and installConfig.Config.IsSCOS() unchanged, only change the comment text to
match the IsSCOS() method name (or explicitly mention both SCOS and OKD for
clarity).
- Around line 54-68: The computed fallback value `stream` is never used when
building the OSImageStream manifest, so DefaultStream is set from
installConfig.Config.OSImageStream (which may be empty); replace the direct use
of installConfig.Config.OSImageStream with the previously computed `stream`
variable when populating the OSImageStream.Spec.DefaultStream so the
rhcos.DefaultOSImageStream fallback is applied; update the construction of the
OSImageStream (OSImageStream, OSImageStreamSpec, DefaultStream) to reference
`stream` instead of installConfig.Config.OSImageStream.

---

Nitpick comments:
In `@pkg/asset/manifests/osimagestream.go`:
- Around line 3-16: Reorder the import block in osimagestream.go to group
standard library packages together, third-party packages together, and internal
repository packages together: place "context" and "path" in the first (standard)
group, keep k8s and external libs (metav1, "github.com/openshift/api/features",
"github.com/pkg/errors", "sigs.k8s.io/yaml") in the second group, and the
project-specific imports ("github.com/openshift/installer/pkg/rhcos",
mcfgv1alpha, "github.com/openshift/installer/pkg/asset",
"github.com/openshift/installer/pkg/asset/installconfig") in the final group so
the import block is clearly separated by origin.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a9c47e8-7d7c-45ea-becb-e96948c5349f

📥 Commits

Reviewing files that changed from the base of the PR and between ac63620 and c2ef2f7.

📒 Files selected for processing (4)
  • pkg/asset/manifests/openshift.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/rhcos/stream.go
  • pkg/rhcos/stream_scos.go

Comment thread pkg/asset/manifests/osimagestream.go Outdated
Comment thread pkg/asset/manifests/osimagestream.go Outdated
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 11, 2026

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

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

Summary by CodeRabbit

  • New Features

  • Generates OS Image Stream manifests as part of OpenShift install assets.

  • Manifest generation is conditional on the OS Streams feature gate and target type (skips for SCOS).

  • Adds platform-specific default image stream behavior so RHCOS and SCOS targets handle defaults appropriately.

  • Bug Fixes

  • Fixes persistence when merging marketplace stream architecture entries so updates are retained.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
pkg/asset/manifests/osimagestream.go (1)

53-68: ⚠️ Potential issue | 🔴 Critical

Use the computed fallback when populating spec.defaultStream.

Line 68 bypasses the fallback calculated on Lines 54-57, so an unset OSImageStream still emits spec.defaultStream: "" instead of the intended default.

Suggested fix
 	Spec: &mcfgv1alpha.OSImageStreamSpec{
-		DefaultStream: string(installConfig.Config.OSImageStream),
+		DefaultStream: string(stream),
 	},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/asset/manifests/osimagestream.go` around lines 53 - 68, The
spec.defaultStream is being set from installConfig.Config.OSImageStream instead
of the computed fallback stored in the local variable stream; update the
OSImageStream creation (Spec.DefaultStream) to use the computed variable stream
(convert to string if necessary) so the fallback (rhcos.DefaultOSImageStream) is
emitted when the config value is empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@pkg/asset/manifests/osimagestream.go`:
- Around line 53-68: The spec.defaultStream is being set from
installConfig.Config.OSImageStream instead of the computed fallback stored in
the local variable stream; update the OSImageStream creation
(Spec.DefaultStream) to use the computed variable stream (convert to string if
necessary) so the fallback (rhcos.DefaultOSImageStream) is emitted when the
config value is empty.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ad01fd0-dc57-4b17-88bf-f3f00621e0e2

📥 Commits

Reviewing files that changed from the base of the PR and between c2ef2f7 and 53890fd.

📒 Files selected for processing (5)
  • hack/build-coreos-manifest.go
  • pkg/asset/manifests/openshift.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/rhcos/stream.go
  • pkg/rhcos/stream_scos.go

@pablintino pablintino marked this pull request as ready for review March 16, 2026 13:57
@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 Mar 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

When the OSStreams feature gate is enabled and the user has selected an OS image stream, generate the OSImageStream CR in the openshift manifests so the cluster can boot with the desired stream.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/rhcos/stream.go`:
- Around line 7-9: Create a new file pkg/rhcos/stream_okd.go with the build tag
"//go:build okd" and define the missing package-level constant
DefaultOSImageStream for the OKD build variant (analogous to stream_scos.go);
set DefaultOSImageStream to the OKD image stream constant (e.g.,
types.OSImageStreamOKD) so that the symbol DefaultOSImageStream is available
when building with the okd tag and pkg/asset/manifests/osimagestream.go can
compile.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f5d36a5-1120-482e-944c-d3a8df3e9827

📥 Commits

Reviewing files that changed from the base of the PR and between 1a891eb and e922548.

📒 Files selected for processing (5)
  • hack/build-coreos-manifest.go
  • pkg/asset/manifests/openshift.go
  • pkg/asset/manifests/osimagestream.go
  • pkg/rhcos/stream.go
  • pkg/rhcos/stream_scos.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/asset/manifests/openshift.go

Comment thread pkg/rhcos/stream.go Outdated
Comment on lines +7 to +9
// DefaultOSImageStream is the OS image stream used when the install-config
// does not specify one.
const DefaultOSImageStream = types.OSImageStreamRHCOS9
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Mar 16, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

fd --type f 'stream.*\.go$' pkg/rhcos | while IFS= read -r f; do
  printf '\n== %s ==\n' "$f"
  sed -n '1,30p' "$f"
done

printf '\n== DefaultOSImageStream declarations ==\n'
rg -n --type go -C2 '\bDefaultOSImageStream\b' pkg/rhcos

Repository: openshift/installer

Length of output: 1802


🏁 Script executed:

# Check if DefaultOSImageStream is imported/used elsewhere
rg -n 'DefaultOSImageStream' --type go --max-count 20

Repository: openshift/installer

Length of output: 462


🏁 Script executed:

# Check for okd build variant usage in CI/tooling
fd --type f '(Makefile|\.github|\.gitlab)' -x grep -l 'okd' {}

Repository: openshift/installer

Length of output: 45


🏁 Script executed:

# Check if there's a build file or test that covers okd
fd --type f '\.(go|sh)$' -x grep -l 'okd' {} \; | head -20

Repository: openshift/installer

Length of output: 459


🏁 Script executed:

# Check the osimagestream.go file to see its build constraint and usage
head -20 pkg/asset/manifests/osimagestream.go
sed -n '50,65p' pkg/asset/manifests/osimagestream.go

Repository: openshift/installer

Length of output: 976


🏁 Script executed:

# Check if there's any okd-specific rhcos file or if okd is actually built
find . -path ./vendor -prune -o -type f -name '*okd*' -print | grep -E '\.(go|sh|yaml)$' | head -10

Repository: openshift/installer

Length of output: 45


🏁 Script executed:

# Check build constraints on osimagestream.go
head -5 pkg/asset/manifests/osimagestream.go

# Check if osimagestream.go is part of okd or if the containing package has constraints
rg -n 'build' pkg/asset/manifests/ | head -20

Repository: openshift/installer

Length of output: 2085


🏁 Script executed:

# Check what imports rhcos in manifests and their build constraints
rg -n 'pkg/rhcos' pkg/asset/manifests/ --type go -B3 | head -40

Repository: openshift/installer

Length of output: 282


🏁 Script executed:

# Check if osimagestream.go is excluded from okd builds
head -3 pkg/asset/manifests/osimagestream.go

# Verify the complete build constraint situation
printf '\n=== stream.go build constraint ===\n'
head -1 pkg/rhcos/stream.go
printf '\n=== stream_scos.go build constraint ===\n'
head -1 pkg/rhcos/stream_scos.go
printf '\n=== osimagestream.go build constraint ===\n'
head -1 pkg/asset/manifests/osimagestream.go

Repository: openshift/installer

Length of output: 270


🏁 Script executed:

# Check if okd builds are tested/used in the project
rg 'go:build.*okd|build.*okd' --type go | head -20

Repository: openshift/installer

Length of output: 290


Add DefaultOSImageStream declaration for the okd build variant.

The constant is required by pkg/asset/manifests/osimagestream.go (line 57), which has no build constraint and always compiles. However, when building with //go:build okd, neither stream.go (excluded by !(okd || scos)) nor stream_scos.go (excluded by scos) provides this constant. This causes compilation to fail for okd builds.

Create pkg/rhcos/stream_okd.go with //go:build okd and define DefaultOSImageStream appropriately for OKD, similar to the pattern in stream_scos.go.

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

In `@pkg/rhcos/stream.go` around lines 7 - 9, Create a new file
pkg/rhcos/stream_okd.go with the build tag "//go:build okd" and define the
missing package-level constant DefaultOSImageStream for the OKD build variant
(analogous to stream_scos.go); set DefaultOSImageStream to the OKD image stream
constant (e.g., types.OSImageStreamOKD) so that the symbol DefaultOSImageStream
is available when building with the okd tag and
pkg/asset/manifests/osimagestream.go can compile.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The build tags haven't changed from the already existing file. I don't think this issue should be part of this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@pablintino, understood — the build constraint on stream.go is pre-existing. The concern I raised is that osimagestream.go (new in this PR) has no build constraint and references DefaultOSImageStream, which is not defined for okd builds. That said, I respect that you'd prefer to keep scope limited here.

Would you like me to open a follow-up GitHub issue to track the missing DefaultOSImageStream for the okd build variant?

@pablintino
Copy link
Copy Markdown
Contributor Author

/test artifacts-images
/test okd-scos-images

@pablintino
Copy link
Copy Markdown
Contributor Author

/test images
/test okd-scos-images

Copy link
Copy Markdown
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

/approve

I left a few suggestions. I do think we are also waiting for #10321

Comment thread hack/build-coreos-manifest.go Outdated
arch.RHELCoreOSExtensions = &rhcos.Extensions{}
}
arch.RHELCoreOSExtensions.Marketplace = mkt
stream.Architectures[name] = arch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will become irrelevant, perhaps need a rebase once #10321 merges, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, this change should be gonne now.

Comment thread pkg/asset/manifests/osimagestream.go Outdated

osImageStreamData, err := yaml.Marshal(osImageStream)
if err != nil {
return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", f.Name())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

errors wrap is deprecated, please replace with fmt.Errorf and don't introduce pkg/errors in this (unless using errors.As)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread pkg/asset/manifests/osimagestream.go Outdated

// Name returns a human-friendly name for the asset.
func (*OSImageStream) Name() string {
return "OSImageStream"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
return "OSImageStream"
return "OS Image Stream"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread pkg/asset/manifests/osimagestream.go Outdated
// If one of the following are true the OSImageStream CR is not generated
// 1. The feature is not enabled
// 2. The target is CentOS Stream CoreOS
if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) || installConfig.Config.IsSCOS() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I introduced a handier way of checking fgs, so you can now do something like:

Suggested change
if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateOSStreams) || installConfig.Config.IsSCOS() {
if ic := installConfig.Config; !ic.Enabled(features.FeatureGateOSStreams) || ic.IsSCOS() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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 19, 2026
When the OSStreams feature gate is enabled and generate the
OSImageStream CR in the openshift manifests so the cluster
can boot with the desired stream.
If not stream was selected the default one is picked.

Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.eu>
@gpei
Copy link
Copy Markdown
Contributor

gpei commented Mar 23, 2026

/test e2e-aws-ovn-rhel10-devpreview

@pablintino
Copy link
Copy Markdown
Contributor Author

@gpei Thanks for launching the rhel 10 job. I guess that [sig-ci] [Early] prow job name should match os version [Suite:openshift/conformance/parallel] failling can be seen as a victory haha.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 23, 2026

@pablintino: The following test 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-rhel10-devpreview 105ee95 link false /test e2e-aws-ovn-rhel10-devpreview

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.

@patrickdillon
Copy link
Copy Markdown
Contributor

@gpei Thanks for launching the rhel 10 job. I guess that [sig-ci] [Early] prow job name should match os version [Suite:openshift/conformance/parallel] failling can be seen as a victory haha.

🤦‍♂️ I originally named the job rhcos10 and thought I made a mistake so I switched it to rhel10. ugg. oh well, easy fix.

@patrickdillon
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2026
@patrickdillon
Copy link
Copy Markdown
Contributor

openshift/must-gather#533 for must gather support

/verified by e2e-aws-ovn-rhel10-devpreview

log shows

'/tmp/installer/openshift/99_osimagestream.yaml' -> '/tmp/install-orig/openshift/99_osimagestream.yaml'

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 23, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@patrickdillon: This PR has been marked as verified by e2e-aws-ovn-rhel10-devpreview.

Details

In response to this:

openshift/must-gather#533 for must gather support

/verified by e2e-aws-ovn-rhel10-devpreview

log shows

'/tmp/installer/openshift/99_osimagestream.yaml' -> '/tmp/install-orig/openshift/99_osimagestream.yaml'

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-merge-bot openshift-merge-bot Bot merged commit ac9a370 into openshift:main Mar 23, 2026
15 of 16 checks passed
@gpei
Copy link
Copy Markdown
Contributor

gpei commented Mar 24, 2026

I originally named the job rhcos10 and thought I made a mistake so I switched it to rhel10. ugg. oh well, easy fix

@patrickdillon Not sure if you've already got a PR for this, I just submit
openshift/release#76724 to correct the name in the jobs.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants