Skip to content

Instantly share code, notes, and snippets.

@logicalhan
Created November 4, 2023 01:11
Show Gist options
  • Save logicalhan/35b901f7ff60420c0d06c5240a392421 to your computer and use it in GitHub Desktop.
Save logicalhan/35b901f7ff60420c0d06c5240a392421 to your computer and use it in GitHub Desktop.
version two of feature-gate prototype
type FeatureHistory struct {
Changes map[K8sVersion][]HistoryEvent
reverseMapping map[HistoryEvent]semver.Version
built bool
}
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 current maturity level of the feature
PreRelease prerelease
// History is a recording of all changes made to the feature.
History FeatureHistory
}
var ExampleFeature := testGAGate: {
Default: true,
PreRelease: GA,
History: (&FeatureHistory{
Changes: map[K8sVersion][]HistoryEvent{
V1_27: {PromotedToAlpha},
V1_28: {PromotedToBeta, DefaultEnabled},
V1_29: {PromotedToGA},
},
}).Build(),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment