Set default resize policy only for specified resource types, rename RestartNotRequired -> NotRequired

This commit is contained in:
vinay kulkarni
2023-03-10 01:57:14 +00:00
parent 9411050448
commit 9a805db010
10 changed files with 47 additions and 48 deletions

View File

@@ -3016,7 +3016,7 @@ func validatePullPolicy(policy core.PullPolicy, fldPath *field.Path) field.Error
}
var supportedResizeResources = sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory))
var supportedResizePolicies = sets.NewString(string(core.RestartNotRequired), string(core.RestartContainer))
var supportedResizePolicies = sets.NewString(string(core.NotRequired), string(core.RestartContainer))
func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *field.Path) field.ErrorList {
allErrors := field.ErrorList{}
@@ -3036,7 +3036,7 @@ func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *fiel
allErrors = append(allErrors, field.NotSupported(fldPath, p.ResourceName, supportedResizeResources.List()))
}
switch p.RestartPolicy {
case core.RestartNotRequired, core.RestartContainer:
case core.NotRequired, core.RestartContainer:
case "":
allErrors = append(allErrors, field.Required(fldPath, ""))
default: