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(pdk): set_target sets balancer_data.ip when host is an ip #14004

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

locao
Copy link
Contributor

@locao locao commented Dec 10, 2024

Summary

To proxy to the expected address, the balancer phase needs the IP address to be set in ngx.ctx.balancer_data.ip. This change sets ngx.ctx.balancer_data.ip if the host argument used when calling set_target contains an IPv4 or IPv6 address.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Close #13775

KAG-5628

@github-actions github-actions bot added core/pdk cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Dec 10, 2024
@@ -103,6 +104,12 @@ local function new()
ngx.var.upstream_host = host

local ctx = ngx.ctx
local hostname_typ = hostname_type(host)
Copy link
Member

Choose a reason for hiding this comment

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

We should document the new behavior in the ldoc above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/pdk size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants