Skip to content

Commit e96acdb

Browse files
authored
Merge pull request kubernetes#127171 from Jefftree/feature-gate-comment
Reorder kube_features to be alphabetical and add comment on where to add new feature
2 parents 04bba3c + da308ea commit e96acdb

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

pkg/features/kube_features.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ const (
3838
// of code conflicts because changes are more likely to be scattered
3939
// across the file.
4040

41-
// owner: @ttakahashi21 @mkimuram
42-
// kep: https://kep.k8s.io/3294
43-
// alpha: v1.26
44-
//
45-
// Enable usage of Provision of PVCs from snapshots in other namespaces
46-
CrossNamespaceVolumeDataSource featuregate.Feature = "CrossNamespaceVolumeDataSource"
47-
4841
// owner: @aojea
4942
// Deprecated: v1.31
5043
//
@@ -178,6 +171,13 @@ const (
178171
// Set the scheduled time as an annotation in the job.
179172
CronJobsScheduledAnnotation featuregate.Feature = "CronJobsScheduledAnnotation"
180173

174+
// owner: @ttakahashi21 @mkimuram
175+
// kep: https://kep.k8s.io/3294
176+
// alpha: v1.26
177+
//
178+
// Enable usage of Provision of PVCs from snapshots in other namespaces
179+
CrossNamespaceVolumeDataSource featuregate.Feature = "CrossNamespaceVolumeDataSource"
180+
181181
// owner: @elezar
182182
// kep: http://kep.k8s.io/4009
183183
// alpha: v1.28
@@ -954,17 +954,12 @@ func init() {
954954
clientfeatures.ReplaceFeatureGates(ca)
955955
}
956956

957-
// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
958-
// To add a new feature, define a key for it above and add it here. The features will be
959-
// available throughout Kubernetes binaries.
957+
// defaultKubernetesFeatureGates consists of legacy unversioned Kubernetes-specific feature keys.
958+
// Please do not add to this file and use pkg/features/versioned_kube_features.go instead.
960959
//
961960
// Entries are separated from each other with blank lines to avoid sweeping gofmt changes
962961
// when adding or removing one entry.
963962
var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
964-
AllowDNSOnlyNodeCSR: {Default: false, PreRelease: featuregate.Deprecated}, // remove after 1.33
965-
966-
DisableNodeKubeProxyVersion: {Default: false, PreRelease: featuregate.Deprecated}, // default on in 1.33
967-
968963
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
969964
// unintentionally on either side:
970965

@@ -1047,8 +1042,12 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
10471042
// ...
10481043
HPAScaleToZero: {Default: false, PreRelease: featuregate.Alpha},
10491044

1045+
AllowDNSOnlyNodeCSR: {Default: false, PreRelease: featuregate.Deprecated}, // remove after 1.33
1046+
10501047
AllowInsecureKubeletCertificateSigningRequests: {Default: false, PreRelease: featuregate.Deprecated}, // remove in 1.33
10511048

1049+
DisableNodeKubeProxyVersion: {Default: false, PreRelease: featuregate.Deprecated}, // default on in 1.33
1050+
10521051
StorageNamespaceIndex: {Default: true, PreRelease: featuregate.Beta},
10531052

10541053
RecursiveReadOnlyMounts: {Default: true, PreRelease: featuregate.Beta},

pkg/features/versioned_kube_features.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ import (
2323
)
2424

2525
// defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys with VersionedSpecs.
26-
// To add a new feature, define a key for it and add it here. The features will be
26+
// To add a new feature, define a key for it in pkg/features/kube_features.go and add it here. The features will be
2727
// available throughout Kubernetes binaries.
28+
// For features available via specific kubernetes components like apiserver,
29+
// cloud-controller-manager, etc find the respective kube_features.go file
30+
// (eg:staging/src/apiserver/pkg/features/kube_features.go), define the versioned
31+
// feature gate there, and reference it in this file.
32+
// To support n-3 compatibility version, features may only be removed 3 releases after graduation.
2833
//
29-
// Entries are alphabetized and separated from each other with blank lines to avoid sweeping gofmt changes
30-
// when adding or removing one entry.
34+
// Entries are alphabetized.
3135
var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
32-
CrossNamespaceVolumeDataSource: {
33-
{Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha},
34-
},
3536
AnyVolumeDataSource: {
3637
{Version: version.MustParse("1.18"), Default: false, PreRelease: featuregate.Alpha},
3738
{Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta},
@@ -86,6 +87,9 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
8687
CronJobsScheduledAnnotation: {
8788
{Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta},
8889
},
90+
CrossNamespaceVolumeDataSource: {
91+
{Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha},
92+
},
8993
DevicePluginCDIDevices: {
9094
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha},
9195
{Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta},

0 commit comments

Comments
 (0)