-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase coverage in template.go for nginx controller #1330
Conversation
@@ -434,12 +437,6 @@ func buildRateLimit(input interface{}) []string { | |||
limits = append(limits, limit) | |||
} | |||
|
|||
if loc.RateLimit.RPM.Limit > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines of code are a duplicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not duplicated RPM != RPS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed! Thanks @aledbf I just pushed the fix.
@@ -434,12 +437,6 @@ func buildRateLimit(input interface{}) []string { | |||
limits = append(limits, limit) | |||
} | |||
|
|||
if loc.RateLimit.RPM.Limit > 0 { | |||
limit := fmt.Sprintf("limit_req zone=%v burst=%v nodelay;", | |||
loc.RateLimit.RPM.Name, loc.RateLimit.RPM.Burst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but I have a few questions on this particular section:
- What happens if
loc.RateLimit.RPM.Limit
> 0, butloc.RateLimit.RPM.Burst
does not exist? - Should we look for
loc.RateLimit.RPM.Burst
instead?
Coverage increased (+0.3%) to 44.01% when pulling 8c75f50d9f7102ff6fe214b12442af881ee792d3 on diazjf:template-unit-tests into 7eb2b81 on kubernetes:master. |
Adds some of the missing unit tests to template.go for the nginx controller.
8c75f50
to
c4293bc
Compare
/lgtm |
@diazjf thanks! |
Adds some of the missing unit tests to template.go for the nginx controller.