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

Always sort upstream list to provide stable iteration order #2598

Merged
merged 2 commits into from
Jun 2, 2018

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Jun 2, 2018

What this PR does / why we need it:

Using a sorted list avoids unnecessary reloads

Which issue this PR fixes: fixes #2596

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 2, 2018
@codecov-io
Copy link

codecov-io commented Jun 2, 2018

Codecov Report

Merging #2598 into master will increase coverage by 0.04%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2598      +/-   ##
==========================================
+ Coverage   40.54%   40.58%   +0.04%     
==========================================
  Files          75       75              
  Lines        5106     5098       -8     
==========================================
- Hits         2070     2069       -1     
+ Misses       2755     2750       -5     
+ Partials      281      279       -2
Impacted Files Coverage Δ
internal/ingress/types_equals.go 12.67% <ø> (+0.25%) ⬆️
internal/ingress/controller/controller.go 2.22% <0%> (ø) ⬆️
cmd/nginx/flags.go 81.11% <100%> (-0.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b9eb96...631edb3. Read the comment docs.

@aledbf aledbf changed the title WIP: Always sort upstream list to provide stable iteration order Always sort upstream list to provide stable iteration order Jun 2, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 2, 2018
@@ -572,12 +572,6 @@ func (n *NGINXController) getBackendServers(ingresses []*extensions.Ingress) ([]
aUpstreams = append(aUpstreams, upstream)
}

if n.cfg.SortBackends {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the corresponding flag dummy and print a deprecation message?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch the deprecation part, I forgot that the flag also influenced the order of endpoints.

@antoineco
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, antoineco

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too many config reloads
5 participants