johannes-engler-mw commented on PR #2703:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2703#issuecomment-3763034874
Hi there,
While reviewing the `feat/2639` changes, I noticed a bug in the status
propagation logic that affects all route controllers.
### Issue
The `acceptStatus` variable is shared across all parent gateways in the
reconciliation loop. If one gateway fails processing, all parent references are
marked as "Not Accepted", which violates the Gateway API specification that
requires per-parent status tracking.
**Example from `httproute_controller.go:163-184`:**
```go
acceptStatus := ResourceStatus{
status: true,
msg: "Route is accepted",
}
// ...
for _, gateway := range gateways {
if err := ProcessGatewayProxy(...); err != nil {
acceptStatus.status = false // Overwrites status for ALL parents
acceptStatus.msg = err.Error()
}
}
```
### Affected Controllers
This pattern exists in all 5 route controllers:
- `httproute_controller.go`
- `grpcroute_controller.go`
- `tcproute_controller.go`
- `tlsroute_controller.go`
- `udproute_controller.go`
### Impact
- **HTTPRoute (highest impact)**: The `feat/2639` port-based routing feature
encourages multi-listener/multi-gateway topologies, making partial failures
more likely
- **Other route types**: Lower impact in practice, but still a spec violation
### Proposed Fix
Track status per-gateway using a map:
```go
gatewayStatuses := make(map[string]ResourceStatus)
for _, gateway := range gateways {
if err := ProcessGatewayProxy(...); err != nil {
gatewayStatuses[gateway.Gateway.Name] = ResourceStatus{status:
false, msg: err.Error()}
} else {
gatewayStatuses[gateway.Gateway.Name] = ResourceStatus{status: true,
msg: "Route is accepted"}
}
}
// Use per-gateway status when setting parent status conditions
```
### Question
How would you like to proceed?
1. Fix only HTTPRoute as part of `feat/2639` (since it's most impacted by
the new feature)
2. Fix all route controllers in a separate PR
3. Fix all route controllers as part of `feat/2639`
Happy to submit a fix either way.
--
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]