From 3e68c1695ebbeb41f59efd8c002446ebce82d5a3 Mon Sep 17 00:00:00 2001 From: Jeremy Gustie Date: Fri, 28 Oct 2022 11:11:11 -0400 Subject: [PATCH] Do not enforce required request values when enabling recommendations --- pkg/command/recommendation/options.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/command/recommendation/options.go b/pkg/command/recommendation/options.go index 22c6e36..efda69f 100644 --- a/pkg/command/recommendation/options.go +++ b/pkg/command/recommendation/options.go @@ -415,18 +415,8 @@ func checkResourceList(mode applications.RecommendationsMode, name string, minLi // minmax=minimum|maximum, name=request|limit|targetUtilization, resourceName=cpu|memory checkResource := func(resourceName, minmax string, value *api.NumberOrString, fixFlag string) bool { + // Even if it is allowed, we can't use it to compare to other values if value == nil { - // Enforce required values - if mode.Enabled() && name == "request" { - errs = append(errs, &Error{ - Message: fmt.Sprintf("missing %s container %s for %s", minmax, name, resourceName), - FixCommand: fixCommand, - FixFlag: fixFlag, - FixValidValues: []string{fmt.Sprintf("%s=%s", resourceName, "VALUE")}, - }) - } - - // Even if it is allowed, we can't use it to compare to other values return false }