Skip to content

MCO-2114: allow OSStream reconciliation in OKD#5725

Draft
cheesesashimi wants to merge 1 commit intoopenshift:mainfrom
cheesesashimi:zzlotnik/osstream-in-okd
Draft

MCO-2114: allow OSStream reconciliation in OKD#5725
cheesesashimi wants to merge 1 commit intoopenshift:mainfrom
cheesesashimi:zzlotnik/osstream-in-okd

Conversation

@cheesesashimi
Copy link
Member

@cheesesashimi cheesesashimi commented Mar 2, 2026

- What I did

This removes the OKD-only no-op path for OSImageStream reconciliation. The intent is to eventually allow OKD to reconcile a single default OSImageStream.

- How to verify it

This PR will not enable this by itself. That said, there should be no behavioral changes to OCP or OKD as a result of this PR.

- Description for the changelog
Allow OKD to reconcile OSImageStreams

Summary by CodeRabbit

  • Refactor
    • Simplified the OS image stream feature enablement logic to rely exclusively on feature gate configuration, removing environment-based conditions.
    • Consolidated OS image stream implementation across different build variants for improved maintainability.

@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 2, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@cheesesashimi: This pull request references MCO-2114 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

This removes the OKD-only no-op path for OSImageStream reconciliation. The intent is to eventually allow OKD to reconcile a single default OSImageStream.

- How to verify it

This PR will not enable this by itself. That said, there should be no behavioral changes to OCP or OKD as a result of this PR.

- Description for the changelog
Allow OKD to reconcile OSImageStreams

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 2, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheesesashimi

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 2, 2026
@cheesesashimi cheesesashimi force-pushed the zzlotnik/osstream-in-okd branch from 7cd484c to 8581c31 Compare March 9, 2026 20:08
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Walkthrough

The changes remove build tag conditionals (!fcos && !scos) from OS image stream code, consolidating platform-specific variants. This eliminates a no-op implementation file and simplifies feature detection to rely solely on the feature gate rather than environment checks.

Changes

Cohort / File(s) Summary
Build Constraint Removal
pkg/operator/osimagestream.go, pkg/operator/osimagestream_okd.go
Removed build constraints that conditionally excluded OS image stream functionality. Deleted the FCOS/SCOS platform variant file containing the no-op syncOSImageStream method implementation.
Feature Gate Simplification
pkg/osimagestream/helpers.go
Simplified IsFeatureEnabled to check only the FeatureGateOSStreams gate, removing conditional logic based on SCOS/FCOS environments. Removed unused version package import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Unable to execute shell commands to verify test file structure and coverage for affected packages. Manual verification of test files in pkg/operator and pkg/osimagestream directories is required to assess test coverage.
✅ 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 specifically describes the main change: removing OKD-only conditional build constraints to allow OSImageStream reconciliation in OKD.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Stable And Deterministic Test Names ✅ Passed This pull request does not introduce or modify any Ginkgo test names. The three modified files are non-test source code files, and related test files use standard Go unit testing with table-driven tests using t.Run() with static descriptive strings, not Ginkgo.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 9, 2026

@cheesesashimi: This pull request references MCO-2114 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

This removes the OKD-only no-op path for OSImageStream reconciliation. The intent is to eventually allow OKD to reconcile a single default OSImageStream.

- How to verify it

This PR will not enable this by itself. That said, there should be no behavioral changes to OCP or OKD as a result of this PR.

- Description for the changelog
Allow OKD to reconcile OSImageStreams

Summary by CodeRabbit

  • Refactor
  • Simplified the OS image stream feature enablement logic to rely exclusively on feature gate configuration, removing environment-based conditions.
  • Consolidated OS image stream implementation across different build variants for improved maintainability.

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

@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/osimagestream/helpers.go`:
- Around line 40-44: The comment in bootstrap.go that says "Enable
OSImageStreams if the FeatureGate is active and the deployment is not OKD" is
stale; update that comment to reflect the current implementation:
IsFeatureEnabled(fgHandler) checks only the FeatureGateOSStreams feature flag
(via IsFeatureEnabled and features.FeatureGateOSStreams) and does not perform
any OKD/deployment-type checks, so remove the "and the deployment is not OKD"
qualifier and state that enabling is governed solely by the feature gate.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: a765056b-1d94-4952-bcf3-6afcb46160f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7a8a698 and 8581c31.

📒 Files selected for processing (3)
  • pkg/operator/osimagestream.go
  • pkg/operator/osimagestream_okd.go
  • pkg/osimagestream/helpers.go
💤 Files with no reviewable changes (2)
  • pkg/operator/osimagestream.go
  • pkg/operator/osimagestream_okd.go

Comment on lines 40 to 44
// IsFeatureEnabled checks if the OSImageStream feature is enabled.
// Returns true only if the FeatureGateOSStreams is enabled and the cluster is not running SCOS or FCOS.
// Returns true only if the FeatureGateOSStreams is enabled.
func IsFeatureEnabled(fgHandler common.FeatureGatesHandler) bool {
return fgHandler.Enabled(features.FeatureGateOSStreams) && !version.IsSCOS() && !version.IsFCOS()
return fgHandler.Enabled(features.FeatureGateOSStreams)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check for stale comments referencing OKD/FCOS/SCOS exclusion in IsFeatureEnabled callers
# and verify feature gate default configuration

echo "=== Searching for stale comments about OKD/FCOS/SCOS exclusion ==="
rg -n -C3 "not OKD|!.*FCOS|!.*SCOS|IsFeatureEnabled.*OKD" --type go

echo ""
echo "=== Searching for FeatureGateOSStreams default configuration ==="
rg -n -C5 "FeatureGateOSStreams" --type go

Repository: openshift/machine-config-operator

Length of output: 4356


Implementation is correct; update stale comment in bootstrap.go.

The simplified IsFeatureEnabled function correctly relies solely on the feature gate check. The feature gate FeatureGateOSStreams is configured to be enabled only in preview phases (DevPreviewNoUpgrade, TechPreviewNoUpgrade), not in OKD, confirming the PR's claim of no behavioral changes.

However, the comment in pkg/controller/bootstrap/bootstrap.go at line 228 currently states:

"Enable OSImageStreams if the FeatureGate is active and the deployment is not OKD"

This is now inaccurate. Update it to reflect that only the feature gate is checked, removing the "and the deployment is not OKD" qualifier.

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

In `@pkg/osimagestream/helpers.go` around lines 40 - 44, The comment in
bootstrap.go that says "Enable OSImageStreams if the FeatureGate is active and
the deployment is not OKD" is stale; update that comment to reflect the current
implementation: IsFeatureEnabled(fgHandler) checks only the FeatureGateOSStreams
feature flag (via IsFeatureEnabled and features.FeatureGateOSStreams) and does
not perform any OKD/deployment-type checks, so remove the "and the deployment is
not OKD" qualifier and state that enabling is governed solely by the feature
gate.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

2 participants