Skip to content

Commit a2783a0

Browse files
rajsinghtechjukie
authored andcommitted
fix: prevent skeleton route status entries for unmanaged GatewayClasses (envoyproxy#7536)
* fix: prevent skeleton route status entries for unmanaged GatewayClasses When processing policies (EnvoyExtensionPolicy, SecurityPolicy), the translator was calling GetRouteParentContext for ALL parentRefs in a route, even those referencing gateways with different GatewayClasses not managed by this translator. GetRouteParentContext creates a skeleton RouteParentStatus entry with just the controllerName when called on a parentRef that hasn't been processed yet. Since all GatewayClass instances share the same controller name, these skeleton entries persisted in status without conditions. The fix checks if a parentRef context already exists before attempting to apply policy configuration to it. If the context doesn't exist, it means this parentRef wasn't processed by this translator and should be skipped. Signed-off-by: Raj Singh <[email protected]> * fix: also prevent skeleton entries in BackendTrafficPolicy processing The same issue exists in BackendTrafficPolicy route processing - calling GetRouteParentContext for all parentRefs creates skeleton status entries. Apply the same fix: check if parentRef context exists before adding to list. Signed-off-by: Raj Singh <[email protected]> --------- Signed-off-by: Raj Singh <[email protected]> Signed-off-by: jukie <[email protected]>
1 parent 55fd711 commit a2783a0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

internal/gatewayapi/envoyextensionpolicy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@ func (t *Translator) translateEnvoyExtensionPolicyForRoute(
314314
prefix := irRoutePrefix(route)
315315
parentRefs := GetParentReferences(route)
316316
for _, p := range parentRefs {
317-
parentRefCtx := GetRouteParentContext(route, p, t.GatewayControllerName)
317+
// Skip if this parentRef was not processed by this translator
318+
// (e.g., references a Gateway with a different GatewayClass)
319+
parentRefCtx := route.GetRouteParentContext(p)
320+
if parentRefCtx == nil {
321+
continue
322+
}
318323
gtwCtx := parentRefCtx.GetGateway()
319324
if gtwCtx == nil {
320325
continue

internal/gatewayapi/securitypolicy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,12 @@ func (t *Translator) translateSecurityPolicyForRoute(
659659
prefix := irRoutePrefix(route)
660660
parentRefs := GetParentReferences(route)
661661
for _, p := range parentRefs {
662-
parentRefCtx := GetRouteParentContext(route, p, t.GatewayControllerName)
662+
// Skip if this parentRef was not processed by this translator
663+
// (e.g., references a Gateway with a different GatewayClass)
664+
parentRefCtx := route.GetRouteParentContext(p)
665+
if parentRefCtx == nil {
666+
continue
667+
}
663668
gtwCtx := parentRefCtx.GetGateway()
664669
if gtwCtx == nil {
665670
continue

0 commit comments

Comments
 (0)