Skip to content

Commit 868ec5a

Browse files
committed
Move ComponentSLIs to versioned features and mark as GA
1 parent a0977f0 commit 868ec5a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

staging/src/k8s.io/component-base/metrics/features/kube_features.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,30 @@ limitations under the License.
1717
package features
1818

1919
import (
20+
"k8s.io/apimachinery/pkg/util/version"
2021
"k8s.io/component-base/featuregate"
2122
)
2223

2324
const (
2425
// owner: @logicalhan
2526
// kep: https://kep.k8s.io/3466
26-
// alpha: v1.26
2727
ComponentSLIs featuregate.Feature = "ComponentSLIs"
2828
)
2929

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+
},
3340
}
3441
}
3542

3643
// 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())
3946
}

0 commit comments

Comments
 (0)