mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
Add AllowSidecarResizePolicy to relax resize policy validation check of sidecar containers
This commit is contained in:
@@ -3543,7 +3543,7 @@ func validateInitContainers(containers []core.Container, regularContainers []cor
|
||||
}
|
||||
}
|
||||
|
||||
if len(ctr.ResizePolicy) > 0 {
|
||||
if !opts.AllowSidecarResizePolicy && len(ctr.ResizePolicy) > 0 {
|
||||
allErrs = append(allErrs, field.Invalid(idxPath.Child("resizePolicy"), ctr.ResizePolicy, "must not be set for init containers"))
|
||||
}
|
||||
}
|
||||
@@ -4051,6 +4051,8 @@ type PodValidationOptions struct {
|
||||
AllowOnlyRecursiveSELinuxChangePolicy bool
|
||||
// Indicates whether PodLevelResources feature is enabled or disabled.
|
||||
PodLevelResourcesEnabled bool
|
||||
// Allow sidecar containers resize policy for backward compatibility
|
||||
AllowSidecarResizePolicy bool
|
||||
}
|
||||
|
||||
// validatePodMetadataAndSpec tests if required fields in the pod.metadata and pod.spec are set,
|
||||
|
||||
Reference in New Issue
Block a user