@@ -17,23 +17,30 @@ limitations under the License.
17
17
package features
18
18
19
19
import (
20
+ "k8s.io/apimachinery/pkg/util/version"
20
21
"k8s.io/component-base/featuregate"
21
22
)
22
23
23
24
const (
24
25
// owner: @logicalhan
25
26
// kep: https://kep.k8s.io/3466
26
- // alpha: v1.26
27
27
ComponentSLIs featuregate.Feature = "ComponentSLIs"
28
28
)
29
29
30
- func featureGates () map [featuregate.Feature ]featuregate.FeatureSpec {
31
- return map [featuregate.Feature ]featuregate.FeatureSpec {
32
- ComponentSLIs : {Default : true , PreRelease : featuregate .Beta },
30
+
31
+ func featureGates () map [featuregate.Feature ]featuregate.VersionedSpecs {
32
+ return map [featuregate.Feature ]featuregate.VersionedSpecs {
33
+ ComponentSLIs : {
34
+ {Version : version .MustParse ("1.26" ), Default : false , PreRelease : featuregate .Alpha },
35
+ {Version : version .MustParse ("1.27" ), Default : true , PreRelease : featuregate .Beta },
36
+ // ComponentSLIs officially graduated to GA in v1.29 but the gate was not updated until v1.32.
37
+ // To support emulated versions, keep the gate until v1.35.
38
+ {Version : version .MustParse ("1.32" ), Default : true , PreRelease : featuregate .GA , LockToDefault : true },
39
+ },
33
40
}
34
41
}
35
42
36
43
// AddFeatureGates adds all feature gates used by this package.
37
- func AddFeatureGates (mutableFeatureGate featuregate.MutableFeatureGate ) error {
38
- return mutableFeatureGate .Add (featureGates ())
44
+ func AddFeatureGates (mutableFeatureGate featuregate.MutableVersionedFeatureGate ) error {
45
+ return mutableFeatureGate .AddVersioned (featureGates ())
39
46
}
0 commit comments