component-base: k8s.io/component-base/featuregate Index | Files | Directories

package featuregate

import "k8s.io/component-base/featuregate"

Index

Package Files

feature_gate.go

Constants

const (
    // Values for PreRelease.
    Alpha = prerelease("ALPHA")
    Beta  = prerelease("BETA")
    GA    = prerelease("")

    // Deprecated
    Deprecated = prerelease("DEPRECATED")
)

func NewFeatureGate Uses

func NewFeatureGate() *featureGate

type Feature Uses

type Feature string

type FeatureGate Uses

type FeatureGate interface {
    // Enabled returns true if the key is enabled.
    Enabled(key Feature) bool
    // KnownFeatures returns a slice of strings describing the FeatureGate's known features.
    KnownFeatures() []string
    // DeepCopy returns a deep copy of the FeatureGate object, such that gates can be
    // set on the copy without mutating the original. This is useful for validating
    // config against potential feature gate changes before committing those changes.
    DeepCopy() MutableFeatureGate
}

FeatureGate indicates whether a given feature is enabled or not

type FeatureSpec Uses

type FeatureSpec struct {
    // Default is the default enablement state for the feature
    Default bool
    // LockToDefault indicates that the feature is locked to its default and cannot be changed
    LockToDefault bool
    // PreRelease indicates the maturity level of the feature
    PreRelease prerelease
}

type MutableFeatureGate Uses

type MutableFeatureGate interface {
    FeatureGate

    // AddFlag adds a flag for setting global feature gates to the specified FlagSet.
    AddFlag(fs *pflag.FlagSet)
    // Set parses and stores flag gates for known features
    // from a string like feature1=true,feature2=false,...
    Set(value string) error
    // SetFromMap stores flag gates for known features from a map[string]bool or returns an error
    SetFromMap(m map[string]bool) error
    // Add adds features to the featureGate.
    Add(features map[Feature]FeatureSpec) error
}

MutableFeatureGate parses and stores flag gates for known features from a string like feature1=true,feature2=false,...

Directories

PathSynopsis
testing

Package featuregate imports 9 packages (graph) and is imported by 85 packages. Updated 2019-11-20. Refresh now. Tools for package owners.