Documentation ¶
Overview ¶
Package featuregate provides utilities for features and feature gates.
Index ¶
- Constants
- Variables
- func ComputeFeatureStates(featureGateSpec configv1alpha1.FeatureGateSpec, ...) (activated, deactivated, unavailable []string)
- func FeatureActivatedInNamespace(ctx context.Context, c client.Client, namespace, feature string) (bool, error)
- func FeaturesActivatedInNamespacesMatchingSelector(ctx context.Context, c client.Client, namespaceSelector metav1.LabelSelector, ...) (bool, error)
Constants ¶
View Source
const (
// TKGSystemFeatureGate is the FeatureGate resource for gating TKG features.
TKGSystemFeatureGate = "tkg-system"
)
Variables ¶
View Source
var TKGNamespaceSelector = metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ {Key: "kubernetes.io/metadata.name", Operator: metav1.LabelSelectorOpIn, Values: []string{"tkg-system-public"}}, }, }
TKGNamespaceSelector is a label selector which matches TKG-related namespaces.
Functions ¶
func ComputeFeatureStates ¶
func ComputeFeatureStates(featureGateSpec configv1alpha1.FeatureGateSpec, features []configv1alpha1.Feature) (activated, deactivated, unavailable []string)
ComputeFeatureStates takes a FeatureGate spec and computes the actual state (activated, deactivated or unavailable) of the features in the gate by referring to a list of Feature resources.
func FeatureActivatedInNamespace ¶
func FeatureActivatedInNamespace(ctx context.Context, c client.Client, namespace, feature string) (bool, error)
FeatureActivatedInNamespace returns true only if all of the features specified are activated in the namespace.
func FeaturesActivatedInNamespacesMatchingSelector ¶
func FeaturesActivatedInNamespacesMatchingSelector(ctx context.Context, c client.Client, namespaceSelector metav1.LabelSelector, features []string) (bool, error)
FeaturesActivatedInNamespacesMatchingSelector returns true only if all the features specified are activated in every namespace matched by the selector.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.