mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
pod-overhead: drop from PodSpec based on feature-gate
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
This commit is contained in:
parent
d0b0c0ae45
commit
33713087f4
@ -375,6 +375,11 @@ func dropDisabledFields(
|
|||||||
podSpec.RuntimeClassName = nil
|
podSpec.RuntimeClassName = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) && !overheadInUse(oldPodSpec) {
|
||||||
|
// Set Overhead to nil only if the feature is disabled and it is not used
|
||||||
|
podSpec.Overhead = nil
|
||||||
|
}
|
||||||
|
|
||||||
dropDisabledProcMountField(podSpec, oldPodSpec)
|
dropDisabledProcMountField(podSpec, oldPodSpec)
|
||||||
|
|
||||||
dropDisabledCSIVolumeSourceAlphaFields(podSpec, oldPodSpec)
|
dropDisabledCSIVolumeSourceAlphaFields(podSpec, oldPodSpec)
|
||||||
@ -524,6 +529,18 @@ func runtimeClassInUse(podSpec *api.PodSpec) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// overheadInUse returns true if the pod spec is non-nil and has Overhead set
|
||||||
|
func overheadInUse(podSpec *api.PodSpec) bool {
|
||||||
|
if podSpec == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if podSpec.Overhead != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// procMountInUse returns true if the pod spec is non-nil and has a SecurityContext's ProcMount field set to a non-default value
|
// procMountInUse returns true if the pod spec is non-nil and has a SecurityContext's ProcMount field set to a non-default value
|
||||||
func procMountInUse(podSpec *api.PodSpec) bool {
|
func procMountInUse(podSpec *api.PodSpec) bool {
|
||||||
if podSpec == nil {
|
if podSpec == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user