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

feat: support SRV record #3686

Merged
merged 4 commits into from
Feb 27, 2021
Merged

feat: support SRV record #3686

merged 4 commits into from
Feb 27, 2021

Conversation

spacewander
Copy link
Member

Signed-off-by: spacewander [email protected]

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Signed-off-by: spacewander <[email protected]>
log.info("dns resolve SRV ", answer.target, ", result: ",
json.delay_encode(resolved))

local weight = answer.weight
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the explantation to treat zero weight record to 1 https://github.com/apache/apisix/blob/3af2175629f727d0374b7f77dbdc3a510cf44d81/docs/en/latest/dns.md#srv-record, can also add here.

Copy link
Member Author

Choose a reason for hiding this comment

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


-- find the least common multiple of the counts
local lcm = answer_to_count[answers[1]]
for i = 1, #answers do
Copy link
Contributor

Choose a reason for hiding this comment

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

We can iterate from i = 2.

Copy link
Member Author

Choose a reason for hiding this comment

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

Solved

Signed-off-by: spacewander <[email protected]>
{
"id": 1,
"type": "roundrobin",
"nodes": {
Copy link
Member

Choose a reason for hiding this comment

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

should use [ here, it an array object here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@membphis
Solved.

Signed-off-by: spacewander <[email protected]>
@spacewander spacewander merged commit 6731ca1 into apache:master Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants