Add CBOR feature gates.

For alpha, there is one apiserver feature gate and two client-go feature gates controlling
CBOR. They were initially wired to separate test-only feature gate instances in order to prevent
them from being configurable at runtime via command-line flags or environment variables (for
client-go feature gates outside of Kubernetes components). All of the integration tests required by
the KEP as alpha criteria have been implemented. This adds the feature gates to the usual feature
gate instances and removes the temporary code to support separate test-only feature gate instances.

Kubernetes-commit: 072dfcb416fd4e1ddab0a89ac4faf519e268bc96
This commit is contained in:
Ben Luddy
2024-11-04 10:40:19 -05:00
committed by Kubernetes Publisher
parent c1010ffd7d
commit 8cb21671f4
8 changed files with 37 additions and 77 deletions

View File

@@ -49,9 +49,9 @@ func ConfigFor(inConfig *rest.Config) *rest.Config {
config.ContentType = "application/json"
config.AcceptContentTypes = "application/json"
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientAllowsCBOR) {
if features.FeatureGates().Enabled(features.ClientsAllowCBOR) {
config.AcceptContentTypes = "application/json;q=0.9,application/cbor;q=1"
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientPrefersCBOR) {
if features.FeatureGates().Enabled(features.ClientsPreferCBOR) {
config.ContentType = "application/cbor"
}
}