Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/gatewayapi/backendtrafficpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ func (t *Translator) processBackendTrafficPolicyForRoute(
ancestorRef := getAncestorRefForPolicy(mapKey.NamespacedName, p.SectionName)
ancestorRefs = append(ancestorRefs, &ancestorRef)

parentRefCtxs = append(parentRefCtxs, GetRouteParentContext(targetedRoute, p, t.GatewayControllerName))
// Only process parentRefs that were handled by this translator
// (skip those referencing Gateways with different GatewayClasses)
if parentRefCtx := targetedRoute.GetRouteParentContext(p); parentRefCtx != nil {
parentRefCtxs = append(parentRefCtxs, parentRefCtx)
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion internal/gatewayapi/envoyextensionpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,12 @@ func (t *Translator) translateEnvoyExtensionPolicyForRoute(
parentRefs := GetParentReferences(route)
routesWithDirectResponse := sets.New[string]()
for _, p := range parentRefs {
parentRefCtx := GetRouteParentContext(route, p, t.GatewayControllerName)
// Skip if this parentRef was not processed by this translator
// (e.g., references a Gateway with a different GatewayClass)
parentRefCtx := route.GetRouteParentContext(p)
if parentRefCtx == nil {
continue
}
gtwCtx := parentRefCtx.GetGateway()
if gtwCtx == nil {
continue
Expand Down
7 changes: 6 additions & 1 deletion internal/gatewayapi/securitypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,12 @@ func (t *Translator) translateSecurityPolicyForRoute(
parentRefs := GetParentReferences(route)
routesWithDirectResponse := sets.New[string]()
for _, p := range parentRefs {
parentRefCtx := GetRouteParentContext(route, p, t.GatewayControllerName)
// Skip if this parentRef was not processed by this translator
// (e.g., references a Gateway with a different GatewayClass)
parentRefCtx := route.GetRouteParentContext(p)
if parentRefCtx == nil {
continue
}
gtwCtx := parentRefCtx.GetGateway()
if gtwCtx == nil {
continue
Expand Down