Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build !fcos && !scos

package operator

import (
Expand Down
13 changes: 0 additions & 13 deletions pkg/operator/osimagestream_okd.go

This file was deleted.

5 changes: 2 additions & 3 deletions pkg/osimagestream/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/openshift/api/features"
"github.com/openshift/api/machineconfiguration/v1alpha1"
"github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/version"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
)

Expand Down Expand Up @@ -39,7 +38,7 @@ func GetOSImageStreamSetByName(osImageStream *v1alpha1.OSImageStream, name strin
}

// 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)
}
Comment on lines 40 to 44
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.