Skip to content

Commit 66da447

Browse files
authored
Merge pull request kubernetes#128317 from Jefftree/revert-componentsli-feature
Set ComponentSLIs feature as GA
2 parents b7a85a9 + b8e3ef7 commit 66da447

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,29 @@ 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

23-
func featureGates() map[featuregate.Feature]featuregate.FeatureSpec {
24-
return map[featuregate.Feature]featuregate.FeatureSpec{}
24+
const (
25+
// owner: @logicalhan
26+
// kep: https://kep.k8s.io/3466
27+
ComponentSLIs featuregate.Feature = "ComponentSLIs"
28+
)
29+
30+
func featureGates() map[featuregate.Feature]featuregate.VersionedSpecs {
31+
return map[featuregate.Feature]featuregate.VersionedSpecs{
32+
ComponentSLIs: {
33+
{Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha},
34+
{Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta},
35+
// ComponentSLIs officially graduated to GA in v1.29 but the gate was not updated until v1.32.
36+
// To support emulated versions, keep the gate until v1.35.
37+
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true},
38+
},
39+
}
2540
}
2641

2742
// AddFeatureGates adds all feature gates used by this package.
28-
func AddFeatureGates(mutableFeatureGate featuregate.MutableFeatureGate) error {
29-
return mutableFeatureGate.Add(featureGates())
43+
func AddFeatureGates(mutableFeatureGate featuregate.MutableVersionedFeatureGate) error {
44+
return mutableFeatureGate.AddVersioned(featureGates())
3045
}

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@
182182
lockToDefault: false
183183
preRelease: Alpha
184184
version: "1.29"
185+
- name: ComponentSLIs
186+
versionedSpecs:
187+
- default: false
188+
lockToDefault: false
189+
preRelease: Alpha
190+
version: "1.26"
191+
- default: true
192+
lockToDefault: false
193+
preRelease: Beta
194+
version: "1.27"
195+
- default: true
196+
lockToDefault: true
197+
preRelease: GA
198+
version: "1.32"
185199
- name: ConcurrentWatchObjectDecode
186200
versionedSpecs:
187201
- default: false

0 commit comments

Comments
 (0)