twellck opened a new pull request, #13144:
URL: https://github.com/apache/apisix/pull/13144

   ### Description
   
   When `enable_ipv6: true` is set, APISIX generates dual-stack (IPv4 + IPv6) 
listen directives for `node_listen` and `ssl.listen`, but not for admin, 
control, status, or prometheus endpoints. This means deployers in IPv6 
environments (e.g. Kubernetes) must work around this by manually setting 
listener IPs to `[::]` or injecting raw Nginx configuration snippets. This PR 
fixes that gap so `enable_ipv6: true` works consistently across all endpoints.
   
   Note: proxy_protocol IPv6 support is handled separately in #12859.
   The core change is ~54 lines across `ops.lua` and `ngx_tpl.lua`; the 
remaining ~288 lines are tests.
   
   #### Which issue(s) this PR fixes:
   
   Fixes #13112
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   ## Changes
   
   **`apisix/cli/ops.lua`**
   - Extended `validate_and_get_listen_addr` to return the port and an IPv6 
address alongside the existing `ip:port` string
   - IPv6 address is `[::]` for wildcard-bound listeners (admin, default 
`0.0.0.0`) and `[::1]` for loopback-bound listeners (control, status, 
prometheus, default `127.0.0.1`)
   - IPv6 is skipped when a user explicitly configures a non-default IP
   - New variables (`*_server_port`, `*_server_ipv6`) passed to the template 
context
   
   **`apisix/cli/ngx_tpl.lua`**
   - Added IPv6 listen directives for admin (HTTP and HTTPS), control, status, 
and prometheus (stream and HTTP) — 6 template locations
   
   **`t/cli/test_main.sh`**
   - 11 new tests covering:
     - IPv6 generation for each endpoint (admin, control, status, prometheus)
     - No IPv6 when `enable_ipv6: false`
     - No IPv6 when an explicit IP is configured (admin, control, status, 
prometheus)
     - IPv6 with default config (no explicit IP)
   
   ---
   *Note: AI was used to format this Pull Request.*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to