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

remove unnecessary encoding/decoding also fix ipv6 issue #2857

Merged
merged 3 commits into from
Aug 16, 2018
Merged

remove unnecessary encoding/decoding also fix ipv6 issue #2857

merged 3 commits into from
Aug 16, 2018

Conversation

ElvinEfendi
Copy link
Member

@ElvinEfendi ElvinEfendi commented Jul 27, 2018

What this PR does / why we need it:
Currently we concat address and port using : and the balance interface takes care of splitting. But when the IP address is i.e ::1 then this breaks the whole thing. After encoding it becomes something like ::1:8080 where 8080 is a port. And when you decode it you get ip = nil, port = ":1:8080". The PR changes this unnecessary encoding/decoding first. But even that is not enough for supporting IPv6 endpoints because with that change we would be doing something like balancer.set_current_upstream("::1:8080"), and this is incorrect because when given with port, IPv6 addresses must be wrapped in square brackets. This is why the PR also introduces a preprocessing step in sync_backend where the helper function rewrites every IPv6 address into [IPv6].

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

Special notes for your reviewer:

@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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 27, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 15, 2018
@ElvinEfendi ElvinEfendi changed the title [WIP] more refactoring remove unnecessary encoding/decoding also fix ipv6 issue Aug 15, 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 Aug 15, 2018
@ElvinEfendi
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2018
@codecov-io
Copy link

codecov-io commented Aug 15, 2018

Codecov Report

Merging #2857 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2857   +/-   ##
=======================================
  Coverage   47.57%   47.57%           
=======================================
  Files          77       77           
  Lines        5532     5532           
=======================================
  Hits         2632     2632           
  Misses       2560     2560           
  Partials      340      340

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 082325b...7a3c8f2. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Aug 16, 2018

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@ElvinEfendi
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 16, 2018
@k8s-ci-robot k8s-ci-robot merged commit 35d22bc into kubernetes:master Aug 16, 2018
@ElvinEfendi ElvinEfendi deleted the more-lua-refactoring-and-tests branch August 16, 2018 22:53
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stack traceback: [C]: in function 'ngx_lua_ffi_balancer_set_current_peer'
4 participants