const Alpha … const Beta … const GA … const Deprecated … type prerelease … type Feature … type FeatureSpec … type Gates … type Registry … // FeatureGates returns the feature gates exposed by this library. // // By default, only the default features gates will be returned. // The default implementation allows controlling the features // via environmental variables. // For example, if you have a feature named "MyFeature" // setting an environmental variable "KUBE_FEATURE_MyFeature" // will allow you to configure the state of that feature. // // Please note that the actual set of the feature gates // might be overwritten by calling ReplaceFeatureGates method. func FeatureGates() Gates { … } // AddFeaturesToExistingFeatureGates adds the default feature gates to the provided registry. // Usually this function is combined with ReplaceFeatureGates to take control of the // features exposed by this library. func AddFeaturesToExistingFeatureGates(registry Registry) error { … } // ReplaceFeatureGates overwrites the default implementation of the feature gates // used by this library. // // Useful for binaries that would like to have full control of the features // exposed by this library, such as allowing consumers of a binary // to interact with the features via a command line flag. // // For example: // // // first, register client-go's features to your registry. // clientgofeaturegate.AddFeaturesToExistingFeatureGates(utilfeature.DefaultMutableFeatureGate) // // then replace client-go's feature gates implementation with your implementation // clientgofeaturegate.ReplaceFeatureGates(utilfeature.DefaultMutableFeatureGate) func ReplaceFeatureGates(newFeatureGates Gates) { … } func replaceFeatureGatesWithWarningIndicator(newFeatureGates Gates) bool { … } func init() { … } type featureGatesWrapper … var featureGates … var TestOnlyFeatureGates … type testOnlyFeatureGates … func (t *testOnlyFeatureGates) Enabled(feature Feature) bool { … } func (t *testOnlyFeatureGates) Set(feature Feature, enabled bool) error { … }