Skip to content

Conversation

@Prashanth684
Copy link
Contributor

Add 'scos' build tag support to enable OKD-specific behavior:

  • Use OKD featureset as default when FeatureGate is not found
  • Migrate existing clusters from Default to OKD featureset on upgrade

ref: openshift/enhancements#1899

Add 'scos' build tag support to enable OKD-specific behavior:
 - Use OKD featureset as default when FeatureGate is not found
 - Migrate existing clusters from Default to OKD featureset on upgrade
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

The pull request introduces SCOS (OKD) build support with conditional feature gate migration. Changes include build infrastructure updates to support build tags, new version detection flags for SCOS builds, feature gate initialization logic that migrates from Default to OKD for SCOS builds, and corresponding dependency updates.

Changes

Cohort / File(s) Summary
Build Infrastructure
Dockerfile.rhel, hack/build-go.sh, go.mod
Added TAGS build-arg to Dockerfile.rhel; updated hack/build-go.sh to conditionally pass TAGS_FLAG (-tags=${TAGS}) to both binary build invocations; updated OpenShift API and client-go dependency versions to newer pseudo-versions.
SCOS Version Detection
pkg/version/version.go, pkg/version/scos.go
Introduced SCOS exported boolean flag (default false) and IsSCOS() accessor function in version.go; new scos.go file with scos build tag guard sets SCOS to true when tag is enabled.
Feature Gate Migration Logic
pkg/start/start.go, pkg/start/start_integration_test.go
Extended processInitialFeatureGate to accept configClient parameter for Kubernetes patching; added SCOS-specific migration path that transitions FeatureGate from Default to OKD when SCOS is detected; updated test calls to pass configClient argument.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Prashanth684
Once this PR has been reviewed and has the lgtm label, please assign wking for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

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

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d245c43 and 518a8d4.

⛔ Files ignored due to path filters (51)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/config/v1/register.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/types_feature.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/types_image_policy.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/types_insights.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/types_scheduling.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-OKD.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-OKD.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies-Default.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies-DevPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies-TechPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies-Default.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies-DevPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies-TechPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers-CustomNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers-DevPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers-TechPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-OKD.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-OKD.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/api/features/features.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/custom.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gatherconfig.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gathererconfig.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gatherers.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/insightsdatagather.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/insightsdatagatherspec.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/persistentvolumeclaimreference.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/persistentvolumeconfig.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/storage.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_insightsdatagather.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/insightsdatagather.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/insightsdatagather.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/client-go/config/listers/config/v1/insightsdatagather.go is excluded by !vendor/**, !**/vendor/**
  • vendor/modules.txt is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (7)
  • Dockerfile.rhel
  • go.mod
  • hack/build-go.sh
  • pkg/start/start.go
  • pkg/start/start_integration_test.go
  • pkg/version/scos.go
  • pkg/version/version.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • pkg/version/version.go
  • pkg/version/scos.go
  • go.mod
  • Dockerfile.rhel
  • pkg/start/start_integration_test.go
  • hack/build-go.sh
  • pkg/start/start.go
🧬 Code graph analysis (2)
pkg/version/scos.go (1)
pkg/version/version.go (1)
  • SCOS (23-23)
pkg/start/start.go (3)
lib/resourcebuilder/interface.go (1)
  • Interface (76-80)
pkg/featuregates/featuregates.go (2)
  • CvoGates (43-52)
  • CvoGatesFromFeatureGate (78-107)
pkg/version/version.go (1)
  • IsSCOS (28-30)
🔇 Additional comments (15)
pkg/version/version.go (1)

20-30: LGTM!

The SCOS flag and IsSCOS() function provide a clean runtime interface for detecting OKD builds. The implementation is straightforward and follows Go conventions for build-tag-controlled behavior.

Dockerfile.rhel (1)

4-5: LGTM!

The TAGS build argument is properly defined and passed to the build script, enabling build-tag support for OKD/SCOS builds while maintaining backward compatibility with an empty default.

pkg/version/scos.go (1)

1-7: LGTM!

The build-tag-guarded init function correctly enables SCOS mode when compiled with the scos tag. This is a standard Go pattern for build-time configuration.

hack/build-go.sh (3)

25-28: LGTM!

The conditional TAGS_FLAG setup correctly handles both empty and non-empty TAGS values, enabling build tag support when needed.


32-32: LGTM!

Build tags are properly passed to the cluster-version-operator-tests binary build.


43-43: LGTM!

Build tags are properly passed to the cluster-version-operator binary build, ensuring consistent tag support across both binaries.

go.mod (1)

13-14: Both dependency versions are valid and available.

The commits for github.com/openshift/api (bfa868a22401) and github.com/openshift/client-go (96a6cbc1420c) exist in their respective repositories.

pkg/start/start_integration_test.go (3)

195-196: LGTM: Test correctly adapted to new function signature.

The test properly creates a configClient and passes it to processInitialFeatureGate, matching the updated signature in pkg/start/start.go.


337-338: LGTM: Test correctly adapted to new function signature.

Consistent with the other test updates.


541-542: LGTM: Test correctly adapted to new function signature.

All three integration tests now properly handle the new configClient parameter.

pkg/start/start.go (5)

20-20: LGTM: Import required for patch operations.

The types package is correctly imported for use with types.MergePatchType in the feature gate migration logic at line 298.


50-50: LGTM: Import required for SCOS detection.

The version package is correctly imported to enable SCOS/OKD build detection via version.IsSCOS() in the feature gate initialization logic.


193-194: LGTM: Client properly created for feature gate migration.

The dedicated configClient with user agent "feature-gate-migration" is appropriately created and passed to the updated function signature.


248-248: LGTM: Function signature correctly extended.

The addition of configClient clientset.Interface parameter enables the feature gate migration logic while maintaining backward compatibility with existing behavior.


272-279: LGTM: Appropriate default for SCOS builds.

When the FeatureGate resource is not found, SCOS builds correctly default to the OKD feature set, while non-SCOS builds maintain the existing default behavior. The logging clearly indicates which path was taken.

Comment on lines +288 to 318

// Migrate from Default ("") to OKD for existing clusters during upgrade (only for OKD builds)
if version.IsSCOS() && (startingFeatureSet == "" || startingFeatureSet == configv1.Default) {
klog.Infof("Detected Default feature set, migrating to OKD feature set")

// Patch the FeatureGate to change from Default to OKD
patchData := []byte(fmt.Sprintf(`{"spec":{"featureSet":"%s"}}`, configv1.OKD))
patchedGate, patchErr := configClient.ConfigV1().FeatureGates().Patch(
ctx,
"cluster",
types.MergePatchType,
patchData,
metav1.PatchOptions{},
)
if patchErr != nil {
klog.Errorf("Failed to migrate FeatureGate from Default to OKD: %v", patchErr)
klog.Warningf("Continuing with Default feature set; migration will be retried on next restart")
// Continue with Default - don't fail startup
} else {
klog.Infof("Successfully migrated FeatureGate from Default to OKD")
startingFeatureSet = configv1.FeatureSet(configv1.OKD)
clusterFeatureGate = patchedGate

// Note: The FeatureChangeStopper will detect this change and trigger a restart
// This is expected and ensures CVO starts cleanly with the new feature set
klog.Infof("CVO will restart to apply OKD feature set changes")
}
}
// Compute CVO gates from the feature gate (potentially migrated)
cvoGates = featuregates.CvoGatesFromFeatureGate(clusterFeatureGate, cvoOpenShiftVersion)
}
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:

# First, let's examine the actual file to see the code in context
head -320 pkg/start/start.go | tail -50

Repository: openshift/cluster-version-operator

Length of output: 2518


🏁 Script executed:

# Also check the line count of the file
wc -l pkg/start/start.go

Repository: openshift/cluster-version-operator

Length of output: 100


🏁 Script executed:

# Search for tests related to SCOS migration or feature set migration
find . -name "*test*.go" -type f | xargs rg -l "SCOS|migration|OKD.*featureSet" 2>/dev/null | head -20

Repository: openshift/cluster-version-operator

Length of output: 150


🏁 Script executed:

# Look for test files specifically in the start package
find pkg/start -name "*test*.go" -type f

Repository: openshift/cluster-version-operator

Length of output: 113


🏁 Script executed:

# Check the integration test file for migration-related tests
cat pkg/start/start_integration_test.go | head -100

Repository: openshift/cluster-version-operator

Length of output: 2464


🏁 Script executed:

# Search specifically for tests covering the migration path
rg -n "IsSCOS|Default.*OKD|featureSet.*migration|SCOS" pkg/start/start_integration_test.go -B2 -A10

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Check what version.IsSCOS() checks
rg -n "IsSCOS" pkg/ -A3 | head -40

Repository: openshift/cluster-version-operator

Length of output: 1007


🏁 Script executed:

# Look for tests that cover the patch operation on FeatureGates
rg -n "Patch|featureSet" pkg/start/start_integration_test.go -B3 -A5

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Let's check the full integration test file to see what's covered
wc -l pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 117


🏁 Script executed:

# Search for all test functions in the integration test file
rg -n "^func Test" pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 265


🏁 Script executed:

# Search more broadly for any mention of migration or Default in tests
rg -n "migration|Default|OKD" pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 1019


🏁 Script executed:

# Look at the actual MergePatchType implementation to understand idempotency
rg -n "MergePatchType" pkg/ -B2 -A2

Repository: openshift/cluster-version-operator

Length of output: 284


🏁 Script executed:

# Check if there are unit tests or other tests that might cover the migration
find pkg/ -name "*.go" -type f -exec grep -l "SCOS.*Default\|Default.*OKD\|migration" {} \;

Repository: openshift/cluster-version-operator

Length of output: 165


🏁 Script executed:

# Look at what the "feature-gate-migration" test infrastructure does
rg -n "feature-gate-migration" pkg/start/start_integration_test.go -B5 -A15

Repository: openshift/cluster-version-operator

Length of output: 3341


🏁 Script executed:

# Search for tests that actually set up Default feature set scenario
rg -n "Default\|configv1.Default" pkg/start/start_integration_test.go -B3 -A3

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Check the full context around line 195 to see the actual test setup
sed -n '190,250p' pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 2519


🏁 Script executed:

# Look for any setup or test helper functions that configure feature gates
rg -n "featureSet|FeatureGate" pkg/start/start_integration_test.go -B2 -A5

Repository: openshift/cluster-version-operator

Length of output: 1586


🏁 Script executed:

# Find the processInitialFeatureGate function to see if it contains the migration logic
rg -n "func.*processInitialFeatureGate" pkg/ -A100 | head -150

Repository: openshift/cluster-version-operator

Length of output: 7139


🏁 Script executed:

# Alternatively, search for it in start.go
rg -n "processInitialFeatureGate" pkg/start/start.go -B5 -A50 | head -100

Repository: openshift/cluster-version-operator

Length of output: 5458


🏁 Script executed:

# Look for the exact function in the file
ast-grep --pattern 'func $(name) processInitialFeatureGate($_) {
  $$$
}'

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Let's check where the migration code snippet appears in the file
sed -n '250,330p' pkg/start/start.go

Repository: openshift/cluster-version-operator

Length of output: 3697


🏁 Script executed:

# Let's verify if there are any specific test cases for the Default->OKD migration scenario
rg -n "Default|OKD" pkg/start/start_integration_test.go -B5 -A5 | head -80

Repository: openshift/cluster-version-operator

Length of output: 1922


🏁 Script executed:

# Check if the FeatureGate resource is actually set up in test fixtures with Default value
rg -n "FeatureGate\|featureSet" pkg/start/start_integration_test.go -B3 -A3 | head -100

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Look for any test setup that creates FeatureGate objects
rg -n "FeatureGate.*Default\|Default.*featureSet" pkg/ -type go -B2 -A2

Repository: openshift/cluster-version-operator

Length of output: 105


🏁 Script executed:

# Search for where FeatureGate is created/set up in tests
rg -n "FeatureGate" pkg/start/start_integration_test.go -B3 -A3

Repository: openshift/cluster-version-operator

Length of output: 1127


🏁 Script executed:

# Look for test helper functions that might set up featuresets
rg -n "func.*Helper\|func.*Setup" pkg/start/start_integration_test.go -A5

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Check if Default is mentioned anywhere in test files
rg -n "configv1.Default" pkg/start/ --type go

Repository: openshift/cluster-version-operator

Length of output: 196


🏁 Script executed:

# Search more broadly for migration-related tests in the whole repo
find pkg -name "*.go" -type f -exec grep -l "Default.*OKD\|migration.*Default" {} \;

Repository: openshift/cluster-version-operator

Length of output: 96


🏁 Script executed:

# Check the full test file to understand test setup and if Default featureset is ever created
grep -n "FeatureSet\|featureSet" pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Look for helper functions in test file that might create FeatureGate fixtures
rg -n "func.*feature\|NewFeatureGate\|FeatureGate" pkg/start/start_integration_test.go -i

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Check if there's a testutil or helper package that sets up feature gates
find pkg -name "*testutil*" -o -name "*test*helper*" | xargs ls -la 2>/dev/null

Repository: openshift/cluster-version-operator

Length of output: 1593


🏁 Script executed:

# Verify that the migration scenario (Default->OKD) is explicitly tested
rg -n "startingFeatureSet.*Default\|Default.*startingFeatureSet" pkg/ --type go -B2 -A2

Repository: openshift/cluster-version-operator

Length of output: 60


🏁 Script executed:

# Check if JSON merge patch is truly idempotent by looking at how k8s handles it
web_search
Kubernetes JSON merge patch idempotency behavior

Repository: openshift/cluster-version-operator

Length of output: 177


🌐 Web query:

Kubernetes JSON merge patch idempotency behavior MergePatchType

💡 Result:

Short answer: JSON Merge Patch (MergePatchType / application/merge-patch+json) is effectively idempotent — applying the same merge patch repeatedly yields the same resulting resource after the first application. This follows the RFC 7386 MergePatch rules (fields are added/replaced; null removes a member), and Kubernetes implements this behavior (JSON-merge replaces lists entirely and uses null to remove fields). Caveats: if your patch is a non-object it replaces the whole document; lists are replaced (not merged); and strategic-merge (the default) has different list semantics. (rfc-editor.org)

Sources:

  • RFC 7386 (JSON Merge Patch) — processing rules and null-for-delete semantics. [1]
  • Kubernetes docs on patch types (kubectl patch / JSON merge patch behavior). [2]

Citations:


🏁 Script executed:

# Let's check if there are any dedicated tests for this migration path
find pkg -name "*.go" -type f | xargs grep -l "processInitialFeatureGate"

Repository: openshift/cluster-version-operator

Length of output: 132


🏁 Script executed:

# Check test file setup to see how featuresets are being initialized
sed -n '100,200p' pkg/start/start_integration_test.go

Repository: openshift/cluster-version-operator

Length of output: 2933


🏁 Script executed:

# Look at the whole test structure to understand the test cases
rg -n "func Test" pkg/start/start_integration_test.go -A1

Repository: openshift/cluster-version-operator

Length of output: 370


🏁 Script executed:

# Let's see if there's any setup in the test that creates a FeatureGate with Default value
sed -n '150,250p' pkg/start/start_integration_test.go | grep -i "featuregate\|defaultclusterprofile"

Repository: openshift/cluster-version-operator

Length of output: 445


🏁 Script executed:

# Check if there are any unit tests (as opposed to integration tests) for the migration logic
find pkg/start -name "*.go" | xargs grep -l "TestUnit\|Test.*processInitialFeatureGate" 2>/dev/null

Repository: openshift/cluster-version-operator

Length of output: 62


🏁 Script executed:

# Look at what happens when FeatureGate is not found vs Default value
sed -n '270,320p' pkg/start/start.go

Repository: openshift/cluster-version-operator

Length of output: 2528


🏁 Script executed:

# Verify the exact conditions: both "" and configv1.Default trigger migration
rg -n "configv1.OKD\|configv1.Default" pkg/start/start.go -B2 -A2

Repository: openshift/cluster-version-operator

Length of output: 60


Add test coverage for Default→OKD migration scenario.

The migration logic is well-implemented and safe:

  • Correctly triggers only for SCOS builds with Default/empty feature set
  • Uses appropriate MergePatchType patch (idempotent per RFC 7386)
  • Handles errors gracefully without failing startup
  • Updates local state consistently after successful patch
  • Properly computes CVO gates from the potentially-migrated feature gate

However, the integration tests call processInitialFeatureGate() but don't explicitly test the migration path itself—they don't set up a cluster with a Default featureset to verify the patch operation and state transition. Consider adding a test case that creates a FeatureGate with Default value and verifies it gets migrated to OKD during startup.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 6, 2026

@Prashanth684: 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-hypershift 518a8d4 link true /test e2e-hypershift
ci/prow/e2e-agnostic-ovn-upgrade-out-of-change 518a8d4 link true /test e2e-agnostic-ovn-upgrade-out-of-change
ci/prow/e2e-hypershift-conformance 518a8d4 link true /test e2e-hypershift-conformance
ci/prow/e2e-aws-ovn-techpreview 518a8d4 link true /test e2e-aws-ovn-techpreview
ci/prow/e2e-agnostic-operator 518a8d4 link true /test e2e-agnostic-operator
ci/prow/okd-scos-images 518a8d4 link true /test okd-scos-images
ci/prow/e2e-agnostic-ovn 518a8d4 link true /test e2e-agnostic-ovn

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant