fix: update publishService/statusAdress logic in gateway and ingress controller files (#2730)#2732
fix: update publishService/statusAdress logic in gateway and ingress controller files (#2730)#2732hemanthjk-c wants to merge 10 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes #2730 where apisix-ingress-controller only supported IP addresses in statusAddress and publishService configurations, rejecting hostnames (common in cloud environments like AWS EKS). The changes add hostname support by detecting whether addresses are IPs or hostnames and setting the appropriate fields in Gateway/Ingress status objects. Additionally, a new ClusterIP service flow is added for publishService, which propagates hostnames from Ingress resources fronting the ClusterIP service.
Changes:
- Added IP vs hostname detection in
gateway_controller.goandingress_controller.gousingnet.ParseIP, setting the correct address type (IPAddress/HostnameAddressTypefor Gateway,IP/Hostnamefor Ingress). - Added ClusterIP service handling in
ingress_controller.gothat discovers Ingresses referencing the publish service and propagates their load balancer hostnames. - Added e2e tests and documentation updates for the new behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/gateway_controller.go | Detect IP vs hostname in statusAddress and set Type field on Gateway status addresses |
| internal/controller/ingress_controller.go | Detect IP vs hostname for statusAddress; add ClusterIP publishService support |
| test/e2e/gatewayapi/gateway.go | E2e tests for Gateway status address type (IP and hostname) |
| test/e2e/ingress/ingress.go | E2e tests for Ingress status address (IP, hostname, ClusterIP publishService) |
| docs/en/latest/reference/example.md | Document IP/hostname support in statusAddress and ClusterIP publishService |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review Comments1.
|
… service logic and associated test
…duplicated assertion logic
…ates from the statusAddress passed from gatewayproxy
@Baoyuantop , thanks for bringing this up. I've updated both the files with the suggested changes. Also added test cases to cover the new changes |
Type of change:
What this PR does / why we need it:
This PR fixes #2730
Pre-submission checklist: