Skip to content

Instantly share code, notes, and snippets.

@logicalhan
Created November 4, 2023 01:09
Show Gist options
  • Save logicalhan/a0f8a03f93e4153e714b8338f0b648f4 to your computer and use it in GitHub Desktop.
Save logicalhan/a0f8a03f93e4153e714b8338f0b648f4 to your computer and use it in GitHub Desktop.
version one of feature-gate prototype
type FeatureSpec struct {
// Default is the default enablement state for the feature
Default bool
// DefaultEnabledVersion is the Kubernetes version that this feature is default enabled.
DefaultEnabledVersion *string
// LockToDefault indicates that the feature is locked to its default and cannot be changed
LockToDefault bool
// LockToDefaultVersion indicates from which version the feature is locked to its default and cannot be changed
LockToDefaultVersion *string
// PreRelease indicates the current maturity level of the feature
PreRelease prerelease
// PromotionVersionMap indicates the k8s version this feature was promoted
PromotionVersionMap PromotionVersionMapping
// DeprecatedVersion indicates the k8s version this feature was promoted
DeprecatedVersion *string
}
var ExampleFeature = featuregate.Feature("stable_default_on"): {
PreRelease: featuregate.GA,
Default: true,
DefaultEnabledVersion: stringPtr("1.28"),
PromotionVersionMap: featuregate.PromotionVersionMapping{
featuregate.Alpha: "1.27",
featuregate.Beta: "1.28",
featuregate.GA: "1.29",
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment