known_features.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. Copyright 2024 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package features
  14. import (
  15. "k8s.io/apimachinery/pkg/util/version"
  16. )
  17. // Every feature gate should have an entry here following this template:
  18. //
  19. // // owner: @username
  20. // // alpha: v1.4
  21. // MyFeature featuregate.Feature = "MyFeature"
  22. //
  23. // Feature gates should be listed in alphabetical, case-sensitive
  24. // (upper before any lower case character) order. This reduces the risk
  25. // of code conflicts because changes are more likely to be scattered
  26. // across the file.
  27. const (
  28. // owner: @benluddy
  29. // kep: https://kep.k8s.io/4222
  30. // alpha: 1.32
  31. //
  32. // If disabled, clients configured to accept "application/cbor" will instead accept
  33. // "application/json" with the same relative preference, and clients configured to write
  34. // "application/cbor" or "application/apply-patch+cbor" will instead write
  35. // "application/json" or "application/apply-patch+yaml", respectively.
  36. ClientsAllowCBOR Feature = "ClientsAllowCBOR"
  37. // owner: @benluddy
  38. // kep: https://kep.k8s.io/4222
  39. // alpha: 1.32
  40. //
  41. // If enabled, and only if ClientsAllowCBOR is also enabled, the default request content
  42. // type (if not explicitly configured) and the dynamic client's request content type both
  43. // become "application/cbor" instead of "application/json". The default content type for
  44. // apply patch requests becomes "application/apply-patch+cbor" instead of
  45. // "application/apply-patch+yaml".
  46. ClientsPreferCBOR Feature = "ClientsPreferCBOR"
  47. // owner: @deads2k
  48. // beta: v1.33
  49. //
  50. // Refactor informers to deliver watch stream events in order instead of out of order.
  51. InOrderInformers Feature = "InOrderInformers"
  52. // owner: @yue9944882
  53. // beta: v1.35
  54. //
  55. // Allow InOrderInformer to process incoming events in batches to expedite the process rate.
  56. InOrderInformersBatchProcess Feature = "InOrderInformersBatchProcess"
  57. // owner: @enj, @michaelasp
  58. // alpha: v1.30
  59. // GA: v1.35
  60. InformerResourceVersion Feature = "InformerResourceVersion"
  61. // owner: @p0lyn0mial
  62. // beta: v1.30
  63. //
  64. // Allow the client to get a stream of individual items instead of chunking from the server.
  65. WatchListClient Feature = "WatchListClient"
  66. )
  67. // defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
  68. //
  69. // To add a new feature, define a key for it above and add it here.
  70. // After registering with the binary, the features are, by default, controllable using environment variables.
  71. // For more details, please see envVarFeatureGates implementation.
  72. var defaultVersionedKubernetesFeatureGates = map[Feature]VersionedSpecs{
  73. ClientsAllowCBOR: {
  74. {Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
  75. },
  76. ClientsPreferCBOR: {
  77. {Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
  78. },
  79. InOrderInformers: {
  80. {Version: version.MustParse("1.33"), Default: true, PreRelease: Beta},
  81. },
  82. InOrderInformersBatchProcess: {
  83. {Version: version.MustParse("1.35"), Default: true, PreRelease: Beta},
  84. },
  85. InformerResourceVersion: {
  86. {Version: version.MustParse("1.30"), Default: false, PreRelease: Alpha},
  87. {Version: version.MustParse("1.35"), Default: true, PreRelease: GA},
  88. },
  89. WatchListClient: {
  90. {Version: version.MustParse("1.30"), Default: false, PreRelease: Beta},
  91. {Version: version.MustParse("1.35"), Default: true, PreRelease: Beta},
  92. },
  93. }