Created
November 4, 2023 01:11
-
-
Save logicalhan/35b901f7ff60420c0d06c5240a392421 to your computer and use it in GitHub Desktop.
version two of feature-gate prototype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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