features

package
v2.2.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentFeatureGateDefinitionHash = "sha256:7f739c68838babaf882fb52819d0093f1478e11ce49da6b3a6592c078b92944d"

Variables

This section is empty.

Functions

func ClusterFeatures

func ClusterFeatures(fs []meta.FeatureGate) []meta.Feature

ClusterFeatures returns the effective list to propagate to Groups/Instances. Explicit entries retain spec order; default-only entries follow log order.

func FeatureLogs

func FeatureLogs() [][]FeatureLog

FeatureLogs returns a copy of the complete history, indexed by revision.

func Reloadable

func Reloadable(c meta.Component, update, current []meta.Feature) bool

Types

type FeatureLog

type FeatureLog struct {
	Name    meta.Feature      `json:"name"`
	Stage   meta.FeatureStage `json:"stage"`
	Default bool              `json:"default"`
}

FeatureLog describes a feature at a particular revision.

func DefinitionsAt

func DefinitionsAt(hash string) ([]FeatureLog, error)

DefinitionsAt returns a copy of the definitions referenced by hash. Unknown hashes are never interpreted as the current definitions.

type Gates

type Gates interface {
	Enabled(feat meta.Feature) bool
}

func NewFromCluster

func NewFromCluster(fs []meta.FeatureGate) Gates

NewFromCluster applies Cluster spec overrides over the current default gates. An omitted Enabled means true; an omitted feature uses its default.

func NewFromClusterWithDefaults

func NewFromClusterWithDefaults(fs []meta.FeatureGate, defaults Gates) Gates

NewFromClusterWithDefaults applies Cluster spec overrides over the supplied default gates.

func NewFromClusterWithHash

func NewFromClusterWithHash(fs []meta.FeatureGate, hash string) (Gates, error)

NewFromClusterWithHash applies Cluster spec overrides over historical defaults.

func NewFromFeatures

func NewFromFeatures(fs []meta.Feature) Gates

NewFromFeatures builds Group/Instance gates from their complete feature list. It never consults default gates; an absent feature is disabled.

func NewFromHash

func NewFromHash(hash string) (Gates, error)

NewFromHash reconstructs the default gates at hash. Unknown hashes, including an empty hash, return an error.

func NewFromLogs

func NewFromLogs(definitions []FeatureLog) Gates

NewFromLogs constructs default gates from a complete feature log snapshot.

func NewFromObject

func NewFromObject[
	S scope.Object[F, T],
	F client.Object,
	T runtime.Object,
](obj F) Gates

NewFromObject constructs gates using only the Group/Instance features field.

Jump to

Keyboard shortcuts

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