Skip to content

Commit

Permalink
fix(controllers) skip routes bound to excluded GWs
Browse files Browse the repository at this point in the history
In single-Gateway mode, properly skip route parent references for other
Gateways when determining whether to include a route.
  • Loading branch information
rainest committed Feb 21, 2024
1 parent 6e1dcfe commit f4cdab7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ Adding a new version? You'll need three changes:
- When managed Kong gateways are OSS edition, KIC will not apply licenses to
the Kong gateway instances to avoid invalid configurations.
[#5640](https://github.com/Kong/kubernetes-ingress-controller/pull/5640)
- Fixed an issue where single-Gateway mode did not actually filter out routes
associated with other Gateways in the controller class.
[#5642](https://github.com/Kong/kubernetes-ingress-controller/pull/5642)

## [3.1.0]

Expand Down
10 changes: 7 additions & 3 deletions internal/controllers/gateway/route_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,13 @@ func getSupportedGatewayForRoute[T gatewayapi.RouteT](ctx context.Context, logge
// If the flag `--gateway-to-reconcile` is set, KIC will only reconcile the specified gateway.
// https://github.com/Kong/kubernetes-ingress-controller/issues/5322
if gatewayToReconcile, ok := specifiedGW.Get(); ok {
namespace = gatewayToReconcile.Namespace
name = gatewayToReconcile.Name

parentNamespace := route.GetNamespace()
if parentRef.Namespace != nil {
parentNamespace = string(*parentRef.Namespace)
}
if !(parentNamespace == gatewayToReconcile.Namespace && string(parentRef.Name) == gatewayToReconcile.Name) {
continue
}
}

// pull the Gateway object from the cached client
Expand Down

0 comments on commit f4cdab7

Please sign in to comment.