feat: implement standard Kubernetes feature gates#1077
feat: implement standard Kubernetes feature gates#1077shivansh-gohem wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
…s via component-base Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shivansh-gohem The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @shivansh-gohem. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
135c43f to
c9dd4df
Compare
|
/cc @jakobmoellerdev |
|
I dont really see any features that need gating like this. what were you thinking of when writing this? |
|
@jakobmoellerdev as in the Issue #510. In that thread, @ramonvermeulen suggested implementing the standard |
|
what would parallel dag walking even be? I feel like this can be brought back in when we actually want any gating to happen. currently I dont see a need for gating and we should stabilize and work with what we have. happy to revisit this anytime though /close |
|
@jakobmoellerdev: Closed this PR. 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 kubernetes-sigs/prow repository. |
|
Understood! That makes complete sense regarding stabilization. I'll leave this closed for now, but the implementation is here in the commit history whenever the project is ready for it down the road. I'll take a look at the active issues and see where else I can help out! |
|
I mentioned the two options mainly to open up the discussion about requirements and usage of feature gates, to figure out if there is really a need / use-case for this. That's also why I didn't start implementing right away. In the example I mentioned parallel dag walking because I know it is a feature for which there is an open issue, and with feature gates it could theoretically be added as experimental / "non-GA" feature first. It has nothing to do specifically with feature gates. |
Fixes #510
Description
As suggested by @ramonvermeulen, this implements a Kubernetes-style feature gate registry using
k8s.io/component-base/featuregate(the same package used by Kubernetes core). This provides standard--feature-gates=MyFeature=trueCLI parsing, lifecycle tracking (Alpha/Beta/GA), and default states.Changes Made
pkg/features/features.go: Implemented the global feature registry (FeatureGate), starting withParallelDagWalkingas the first Alpha feature gate placeholder.pkg/features/features_test.go: Added a test suite covering default states, overriding viaSet(), and error handling for unknown features.cmd/controller/main.go: Wired the-feature-gatesstring directly into KRO's existingflagsetup, successfully bridging it tofeaturegate.Set(). Added startup logging for known feature gates.go.mod: Promotedk8s.io/component-baseto a direct dependency.Verification
go test ./pkg/features/...passes.go run ./cmd/controller/main.go --helpproperly displays the newly registered-feature-gatesflag.kindcluster with the flag enabled.