Skip to content

Commit

Permalink
Merge pull request #90 from thestormforge/optional-recommendations
Browse files Browse the repository at this point in the history
Do not enforce required request values when enabling recommendations
  • Loading branch information
jgustie authored Nov 9, 2022
2 parents e10539a + 3e68c16 commit b3d9284
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/command/recommendation/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit b3d9284

Please sign in to comment.