featuregate

package
v0.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package featuregate provides utilities for features and feature gates.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL