-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
feat: support the combination of Nginx variables for annotation upstream-hash-by. #5571
Conversation
Hi @agile6v. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/assign @ElvinEfendi |
/retest |
Codecov Report
@@ Coverage Diff @@
## master #5571 +/- ##
==========================================
- Coverage 58.64% 58.33% -0.32%
==========================================
Files 88 88
Lines 6913 7195 +282
==========================================
+ Hits 4054 4197 +143
- Misses 2414 2534 +120
- Partials 445 464 +19
Continue to review full report at Codecov.
|
/retest |
1 similar comment
/retest |
@agile6v thanks for the PR. I think we should stick to how Nginx does this and support Also I think we should only be changing |
Hi @ElvinEfendi
Yes. I agree with your suggestion.
Thanks. |
/retest |
@agile6v please squash the commits |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
ping @ElvinEfendi |
rootfs/etc/nginx/lua/util.lua
Outdated
|
||
-- given the compound Nginx variables i.e {"$request_uri"} or {"$request_uri$host$scheme"} | ||
-- or {"${request_uri}-text-value"}, it returns the parsed value. | ||
function _M.lua_ngx_var(data) |
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.
Can we delete this now? Does not seem to be used anymore.
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.
OK. I move function lua_ngx_var
to util_test.lua
file.
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.
What I meant this PR replaced lua_ngx_var
with something else. Don't you think we should remove all references of lua_ngx_var
(including tests), and add tests for the two new utility functions you introduced?
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.
Hi @ElvinEfendi The name of lua_ngx_var
function is preserved but it contains two utility functions introduced this time. Function parse_complex_value
and generate_var_value
need to be used together (split into two functions because of performance considerations), So they are not individually written unit tests.
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.
split into two functions because of performance considerations
This indicates me they should be individually unit tested. But I don't feel strongly if you don't add individual unit tests for them in this PR. But IMHO we should definitely delete all references to lua_ngx_var
as it is promoting less performant solution.
--
the integration test for them is already being done as part of chash balancer test.
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.
Hi @ElvinEfendi What do you think of the latest commit?
@agile6v sorry for delay here. The PR looks great! Only |
/retest |
3 similar comments
/retest |
/retest |
/retest |
The error in the lua job seems valid
|
@agile6v please rebase and squash the commits |
Running the patch against master works
|
…ion upstream-hash-by.
/retest |
/lgtm thanks @agile6v ! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: agile6v, 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 |
/retest |
What this PR does / why we need it:
Types of changes
Which issue/s this PR fixes
fixes #4846
Checklist: