Skip to content

Commit

Permalink
Backport of fix(control-plane): sidecar CPU limit incorrectly validat…
Browse files Browse the repository at this point in the history
…ed against CPU request into release/1.3.x (#3212)

backport of commit 78db847

Co-authored-by: DanStough <dan.stough@hashicorp.com>
  • Loading branch information
hc-github-team-consul-core and DanStough authored Nov 14, 2023
1 parent ad84047 commit 36898a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/3209.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
control-plane: Fixes a bug with the control-plane CLI validation where the consul-dataplane sidecar CPU request is
compared against the memory limit instead of the CPU limit.
```
2 changes: 1 addition & 1 deletion control-plane/subcommand/inject-connect/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (c *Command) parseAndValidateSidecarProxyFlags() error {
return fmt.Errorf("-default-sidecar-proxy-cpu-limit is invalid: %w", err)
}
}
if c.sidecarProxyCPULimit.Value() != 0 && c.sidecarProxyCPURequest.Cmp(c.sidecarProxyMemoryLimit) > 0 {
if c.sidecarProxyCPULimit.Value() != 0 && c.sidecarProxyCPURequest.Cmp(c.sidecarProxyCPULimit) > 0 {
return fmt.Errorf("request must be <= limit: -default-sidecar-proxy-cpu-request value of %q is greater than the -default-sidecar-proxy-cpu-limit value of %q",
c.flagDefaultSidecarProxyCPURequest, c.flagDefaultSidecarProxyCPULimit)
}
Expand Down

0 comments on commit 36898a2

Please sign in to comment.