Documentation ¶
Index ¶
Constants ¶
const ( // Values for PreRelease. Alpha = prerelease("ALPHA") Beta = prerelease("BETA") GA = prerelease("") // Deprecated Deprecated = prerelease("DEPRECATED") )
Variables ¶
This section is empty.
Functions ¶
func AddFeaturesToExistingFeatureGates ¶
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 ReplaceFeatureGates ¶
func ReplaceFeatureGates(newFeatureGates Gates)
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)
Types ¶
type Feature ¶
type Feature string
const ( // owner: @p0lyn0mial // beta: v1.30 // // Allow the client to get a stream of individual items instead of chunking from the server. // // NOTE: // The feature is disabled in Beta by default because // it will only be turned on for selected control plane component(s). WatchListClient Feature = "WatchListClient" // owner: @nilekhc // alpha: v1.30 InformerResourceVersion Feature = "InformerResourceVersion" )
type FeatureSpec ¶
type Gates ¶
Gates indicates whether a given feature is enabled or not.
func FeatureGates ¶
func FeatureGates() Gates
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.
type Registry ¶
type Registry interface { // Add adds existing feature gates to the provided registry. // // As of today, this method is used by AddFeaturesToExistingFeatureGates and // ReplaceFeatureGates to take control of the features exposed by this library. Add(map[Feature]FeatureSpec) error }
Registry represents an external feature gates registry.