Skip to content
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

Merged
merged 1 commit into from
Sep 10, 2017

Conversation

diazjf
Copy link

@diazjf diazjf commented Sep 10, 2017

Adds some of the missing unit tests to template.go for the nginx controller.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 10, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 10, 2017
@@ -434,12 +437,6 @@ func buildRateLimit(input interface{}) []string {
limits = append(limits, limit)
}

if loc.RateLimit.RPM.Limit > 0 {
Copy link
Author

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.

Copy link
Member

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

Copy link
Author

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)
Copy link
Author

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:

  1. What happens ifloc.RateLimit.RPM.Limit > 0, but loc.RateLimit.RPM.Burst does not exist?
  2. Should we look for loc.RateLimit.RPM.Burst instead?

@coveralls
Copy link

Coverage Status

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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 43.994% when pulling c4293bc on diazjf:template-unit-tests into 7eb2b81 on kubernetes:master.

@aledbf aledbf self-assigned this Sep 10, 2017
@aledbf
Copy link
Member

aledbf commented Sep 10, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 10, 2017
@aledbf
Copy link
Member

aledbf commented Sep 10, 2017

@diazjf thanks!

@aledbf aledbf merged commit 1e943c0 into kubernetes:master Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants