Skip to content

USHIFT-6178 Enable Custom FeatureGates#5723

Merged
openshift-merge-bot[bot] merged 14 commits intoopenshift:mainfrom
copejon:ushift-6178
Nov 21, 2025
Merged

USHIFT-6178 Enable Custom FeatureGates#5723
openshift-merge-bot[bot] merged 14 commits intoopenshift:mainfrom
copejon:ushift-6178

Conversation

@copejon
Copy link
Contributor

@copejon copejon commented Nov 11, 2025

No description provided.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2025
@copejon copejon changed the title USHIFT-6178 Enable Custom FeatureGates [WIP] USHIFT-6178 Enable Custom FeatureGates Nov 11, 2025
@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 Nov 11, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2025
@copejon copejon changed the title [WIP] USHIFT-6178 Enable Custom FeatureGates USHIFT-6178 Enable Custom FeatureGates Nov 17, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 17, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 17, 2025
Comment on lines +177 to +178
hardcodedFeatureGates := []string{"UserNamespacesSupport=true", "UserNamespacesPodSecurityStandards=true"}
featureGateArgs = append(featureGateArgs, hardcodedFeatureGates...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have a conflict here? Configuration allows disabling UserNamespacesSupport and UserNamespacesPodSecurityStandards.

Copy link
Contributor Author

@copejon copejon Nov 21, 2025

Choose a reason for hiding this comment

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

This is now protected against by preventing the user to specify these values in the ushift config.

https://github.com/copejon/microshift/blob/e108194ba7642c410cfe7c95281d173682e55f94/pkg/config/apiserver.go#L206-L218

Comment on lines +841 to +842
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
},
{
},
{
name: "feature-gates-custom-no-upgrade-with-empty-enabled-and-disabled-lists",
config: func() *Config {
c := mkDefaultConfig()
c.ApiServer.FeatureGates.FeatureSet = "CustomNoUpgrade"
c.ApiServer.FeatureGates.CustomNoUpgrade.Enabled = []string{}
c.ApiServer.FeatureGates.CustomNoUpgrade.Disabled = []string{}
return c
}(),
expectErr: true,
},
{

adding a test for the suggestion check I added last week

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@agullon Thanks! For the sake of time, would you mind submitting this as a follow-up PR? Else CI will have to test the change, and then retest again for merge, which would take a long time.

Copy link
Contributor

Choose a reason for hiding this comment

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

add it #5795
please, review it

maxFiles: 10
# profile is the OpenShift profile specifying a specific logging policy
profile: Default
featureGates:
Copy link
Member

Choose a reason for hiding this comment

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

I started wondering - if FGs are propagated, but someone would want to apply kubelet FG, should we move it out of apiServer and make it global to avoid confusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a very good point. I had shifted FGs under kube-apiserver to smooth the passthrough logic, but it doesn't solve the problem you rightly pointe out. I'll give this a second look and get back to you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enabling a kubelet FG on the kube-apiserver and disabling it in the kubelet config results in the FG being disabled. This is b/c the kubelet goes against convention by prioritizing the config file over all other config vectors (CLI flags, KAS propagation).

This is only an issue if the user were to set contradictory featureGate values in the microshift config.

Copy link
Contributor Author

@copejon copejon left a comment

Choose a reason for hiding this comment

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

Darn it, I thought I'd made the comment as a one off, not a review.

copejon and others added 11 commits November 19, 2025 16:22
This commit introduces a comprehensive document detailing the data flow of the API server configuration, tracing the path from the `apiServer` field in the MicroShift configuration file to its ingestion by the kube-apiserver. It includes a UML sequence diagram illustrating the configuration steps, key data structures, and the transformation of configuration values into command-line flags. Additionally, it updates the configuration structure to support feature gates, enhancing the API server's customization capabilities.
… as invalide


Setting `featureSet: CustomNoUpgrade` with empty enabled/disabled lists should be invalid. Otherwise, the supposedly valid custom setting would cause a supported cluster to treat itself as unsupported: blocking FG unsetting and cluster upgrades.

Co-authored-by: Alejandro Gullón <agullon@redhat.com>
…ble valudation

replaced array prims with set.Sets for cleaner array comparisson

added validation for edge case where user attempts to set required feature-gates. It is no longer allowed

fixed critical issue with lock file management that caused deletion of custom configs to skip lock file checks
@copejon copejon requested review from agullon, pacevedom and pmtk and removed request for pmtk November 20, 2025 18:12
…readability

refactored featureGateLockManagement() by moving hasCustomFeatureGates to after the lockFile-exists check because if the lock exists, it by default has / had custom featureGates.
@copejon
Copy link
Contributor Author

copejon commented Nov 20, 2025

/test ocp-full-conformance-serial-rhel-eus
/test ocp-full-conformance-rhel-eus

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

@copejon: all tests passed!

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.

Copy link
Contributor

@pacevedom pacevedom left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: copejon, pacevedom

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

@copejon
Copy link
Contributor Author

copejon commented Nov 21, 2025

/verified by @copejon, ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 21, 2025
@openshift-ci-robot
Copy link

@copejon: This PR has been marked as verified by @copejon,ci.

Details

In response to this:

/verified by @copejon, ci

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-merge-bot openshift-merge-bot bot merged commit 5dcdcb5 into openshift:main Nov 21, 2025
12 checks passed
@copejon copejon deleted the ushift-6178 branch November 22, 2025 21:52
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. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants