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

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

Adds optional build tags support, enables SCOS (OKD) detection via a build tag, updates feature-gate initialization to migrate Default→OKD on SCOS, and bumps two OpenShift dependency versions.

Changes

Cohort / File(s) Summary
Build tooling & deps
Dockerfile.rhel, hack/build-go.sh, go.mod
Add TAGS build-arg and pass it into the build; introduce TAGS_FLAG handling in hack/build-go.sh to inject -tags=${TAGS} into go build commands; update github.com/openshift/api and github.com/openshift/client-go pseudo-versions.
SCOS build flag
pkg/version/version.go, pkg/version/scos.go
Add exported SCOS bool and IsSCOS() bool accessor; new scos.go (build-tag guarded) sets SCOS = true when built with the scos tag.
Feature-gate migration & wiring
pkg/start/start.go, pkg/start/start_integration_test.go
Extend processInitialFeatureGate signature to accept a configClient and wire it from Run; implement patch-based migration that switches FeatureGate from Default to OKD on SCOS when appropriate; update test call sites to pass the new client parameter.
Payload rendering
pkg/payload/render.go
Add OKD filename check to the skip-filter so files containing OKD are treated like other bootstrap skip markers (CustomNoUpgrade, TechPreviewNoUpgrade, DevPreviewNoUpgrade).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 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.

@Prashanth684
Copy link
Contributor Author

/retest

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

openshift-ci bot commented Jan 22, 2026

@Prashanth684: 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-techpreview 5dcaf60 link true /test e2e-aws-ovn-techpreview

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