Skip to content

Commit c479f00

Browse files
committed
Update field to use feature gate
1 parent ab964a7 commit c479f00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/api/pod/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, po
386386
AllowPodLifecycleSleepActionZeroValue: utilfeature.DefaultFeatureGate.Enabled(features.PodLifecycleSleepActionAllowZero),
387387
PodLevelResourcesEnabled: utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources),
388388
AllowInvalidLabelValueInRequiredNodeAffinity: false,
389+
AllowSidecarResizePolicy: utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling),
389390
}
390391

391392
// If old spec uses relaxed validation or enabled the RelaxedEnvironmentVariableValidation feature gate,
@@ -419,7 +420,7 @@ func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, po
419420

420421
opts.AllowPodLifecycleSleepActionZeroValue = opts.AllowPodLifecycleSleepActionZeroValue || podLifecycleSleepActionZeroValueInUse(podSpec)
421422
// If oldPod has resize policy set on the restartable init container, we must allow it
422-
opts.AllowSidecarResizePolicy = hasRestartableInitContainerResizePolicy(oldPodSpec)
423+
opts.AllowSidecarResizePolicy = opts.AllowSidecarResizePolicy || hasRestartableInitContainerResizePolicy(oldPodSpec)
423424
}
424425
if oldPodMeta != nil && !opts.AllowInvalidPodDeletionCost {
425426
// This is an update, so validate only if the existing object was valid.

0 commit comments

Comments
 (0)