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

fix: Sort TCP/UDP upstream order #2885

Merged
merged 1 commit into from
Aug 10, 2018
Merged

fix: Sort TCP/UDP upstream order #2885

merged 1 commit into from
Aug 10, 2018

Conversation

mikebryant
Copy link
Contributor

What this PR does / why we need it: Sorts the TCP/UDP upstream order, to reduce unnecessary config reloads

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #2721

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 2, 2018
@codecov-io
Copy link

Codecov Report

Merging #2885 into master will decrease coverage by 0.04%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2885      +/-   ##
==========================================
- Coverage   47.56%   47.52%   -0.05%     
==========================================
  Files          76       76              
  Lines        5483     5486       +3     
==========================================
- Hits         2608     2607       -1     
- Misses       2540     2545       +5     
+ Partials      335      334       -1
Impacted Files Coverage Δ
internal/ingress/controller/controller.go 2.21% <0%> (-0.01%) ⬇️
internal/watch/file_watcher.go 80.76% <0%> (-3.85%) ⬇️

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 82bfcb0...8067e0b. Read the comment docs.

@mikebryant
Copy link
Contributor Author

/assign @caseydavenport

@aledbf
Copy link
Member

aledbf commented Aug 2, 2018

@mikebryant please don't assign PRs manually

@aledbf
Copy link
Member

aledbf commented Aug 2, 2018

@mikebryant
Copy link
Contributor Author

@aledbf Apologies, I was trying to follow the instructions given by @k8s-ci-robot

@mikebryant
Copy link
Contributor Author

@mikebryant this only sort by port number. You should use something like https://github.com/ocadotechnology/ingress-nginx/blob/8067e0bcc3c9df090530bdc113650fceb8e86bca/internal/ingress/controller/controller.go#L806

@aledbf I don't understand - the externalPort here is the key of the original configmap, so doesn't that mean there can't be duplicates? I'm trying to sort the upstreams themselves, of which there's one per port, not the backends.

@aledbf
Copy link
Member

aledbf commented Aug 2, 2018

@mikebryant you need to sort using both fields, Address and Port

@mikebryant
Copy link
Contributor Author

@mikebryant you need to sort using both fields, Address and Port

Looking here:
https://github.com/ocadotechnology/ingress-nginx/blob/8067e0bcc3c9df090530bdc113650fceb8e86bca/internal/ingress/controller/controller.go#L327

I don't see where there's an Address field on an ingress.L4Service type?

@mikebryant
Copy link
Contributor Author

@aledbf Am I right in thinking you're talking about an Endpoint object? I'm not trying to sort those, I'm trying to sort the upstream definitions themselves, i.e. the order of the upstream lines in the config

@mikebryant
Copy link
Contributor Author

Is there anything I need to be doing to help get this merged?

@aledbf
Copy link
Member

aledbf commented Aug 9, 2018

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@aledbf
Copy link
Member

aledbf commented Aug 9, 2018

@mikebryant thanks!

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 9, 2018
@aledbf aledbf merged commit 6d9772c into kubernetes:master Aug 10, 2018
@mikebryant mikebryant deleted the wip-2721 branch August 10, 2018 12:23
ElvinEfendi pushed a commit to Shopify/ingress that referenced this pull request Aug 13, 2018
@k8s-ci-robot k8s-ci-robot mentioned this pull request Jul 9, 2019
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TCP Services order doesn't appear to be stable
5 participants