podresources: getallocatable: add feature gate

Add feature gate to disable the GetAllocatableResources API.
The feature gate isd alpha stage, disabled by default.

Add e2e test to demonstrate the behaviour with feature gate disabled.

Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
Francesco Romani
2021-02-04 22:25:13 +01:00
parent 6c8d4ee9ee
commit d7a30e1b08
4 changed files with 150 additions and 5 deletions

View File

@@ -724,6 +724,12 @@ const (
// Allows jobs to be created in the suspended state.
SuspendJob featuregate.Feature = "SuspendJob"
// owner: @fromanirh
// alpha: v1.21
//
// Enable POD resources API to return allocatable resources
KubeletPodResourcesGetAllocatable featuregate.Feature = "KubeletPodResourcesGetAllocatable"
// owner: @jayunit100 @abhiraut @rikatz
// beta: v1.21
//
@@ -838,6 +844,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha},
ServiceInternalTrafficPolicy: {Default: false, PreRelease: featuregate.Alpha},
SuspendJob: {Default: false, PreRelease: featuregate.Alpha},
KubeletPodResourcesGetAllocatable: {Default: false, PreRelease: featuregate.Alpha},
NamespaceDefaultLabelName: {Default: true, PreRelease: featuregate.Beta}, // graduate to GA and lock to default in 1.22, remove in 1.24
// inherited features from generic apiserver, relisted here to get a conflict if it is changed