MCO-2114: allow OSStream reconciliation in OKD#5725
MCO-2114: allow OSStream reconciliation in OKD#5725cheesesashimi wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@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. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7cd484c to
8581c31
Compare
WalkthroughThe changes remove build tag conditionals ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 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. Comment |
|
@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. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
pkg/operator/osimagestream.gopkg/operator/osimagestream_okd.gopkg/osimagestream/helpers.go
💤 Files with no reviewable changes (2)
- pkg/operator/osimagestream.go
- pkg/operator/osimagestream_okd.go
| // 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) | ||
| } |
There was a problem hiding this comment.
🧩 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 goRepository: 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.
- 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