-
Notifications
You must be signed in to change notification settings - Fork 27
Add feature flag support #339
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
limitations under the License. | ||
*/ | ||
|
||
// NOTE: this file is based off k8s.io/apiserver/pkg/util/feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally making some changes here, but they ended up not being necessary. Can we just pull this straight from k8s.io/apiserver/pkg/util/feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and it looks like it's already in vendor/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kragniz.
Looks like a good start.
- Add a note about feature flags to the developer docs and maybe the user docs.
- Enable the example feature flag in the E2E tests
- Import rather than copy code from k8s.io/apiserver as you suggested.
- Maybe quickly summarise what you were telling me about how kubeadm put feature flags in the API resources....so that I can enable features on a per-cluster basis...might we do that as well....or would that be equivalent to making an v2alpha1 API?
@@ -6,6 +6,9 @@ createAPIService: true | |||
rbac: | |||
enabled: true | |||
|
|||
# A set of key=value pairs that describe feature gates for various features. Use --help to see available flags. | |||
featureGates: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma or space separated?
@@ -66,6 +76,8 @@ func (s *ControllerOptions) AddFlags(fs *pflag.FlagSet) { | |||
fs.DurationVar(&s.LeaderElectionRetryPeriod, "leader-election-retry-period", defaultLeaderElectionRetryPeriod, ""+ | |||
"The duration the clients should wait between attempting acquisition and renewal "+ | |||
"of a leadership. This is only applicable if leader election is enabled.") | |||
fs.StringVar(&s.FeatureGatesString, "feature-gates", defaultFeatureGatesString, "A set of key=value pairs that describe feature gates for various features. "+ | |||
"Options are:\n"+strings.Join(features.KnownFeatures(&features.InitFeatureGates), "\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma or space separated?
The output looks like this:
|
@kragniz: PR needs rebase. 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/test-infra repository. |
What this PR does / why we need it: adds support for generic feature flags
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #335Special notes for your reviewer:
Release note: