Restructure naming of resource resize restart policy

This commit is contained in:
vinay kulkarni
2023-02-28 07:30:31 +00:00
parent 3c6e419cc3
commit 8b23497ae7
9 changed files with 74 additions and 74 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.RestartRequired))
var supportedResizePolicies = sets.NewString(string(core.RestartNotRequired), string(core.RestartContainer))
func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *field.Path) field.ErrorList {
allErrors := field.ErrorList{}
@@ -3035,12 +3035,12 @@ func validateResizePolicy(policyList []core.ContainerResizePolicy, fldPath *fiel
default:
allErrors = append(allErrors, field.NotSupported(fldPath, p.ResourceName, supportedResizeResources.List()))
}
switch p.Policy {
case core.RestartNotRequired, core.RestartRequired:
switch p.RestartPolicy {
case core.RestartNotRequired, core.RestartContainer:
case "":
allErrors = append(allErrors, field.Required(fldPath, ""))
default:
allErrors = append(allErrors, field.NotSupported(fldPath, p.Policy, supportedResizePolicies.List()))
allErrors = append(allErrors, field.NotSupported(fldPath, p.RestartPolicy, supportedResizePolicies.List()))
}
}
return allErrors