diff --git a/internal/gatewayapi/contexts.go b/internal/gatewayapi/contexts.go index 1edf13a72fad..e837a9416450 100644 --- a/internal/gatewayapi/contexts.go +++ b/internal/gatewayapi/contexts.go @@ -441,17 +441,3 @@ func (b *BackendRefContext) GetBackendRef(routeKind gwapiv1.Kind) *gwapiv1.Backe } return nil } - -func (b *BackendRefContext) GetHTTPFilters() []gwapiv1.HTTPRouteFilter { - if b.HTTPBackendRef != nil { - return b.HTTPBackendRef.Filters - } - return nil -} - -func (b *BackendRefContext) GetGRPCFilters() []v1alpha2.GRPCRouteFilter { - if b.GRPCBackendRef != nil { - return b.GRPCBackendRef.Filters - } - return nil -} diff --git a/internal/gatewayapi/validate.go b/internal/gatewayapi/validate.go index dc76ceeb68bb..b98a9126527a 100644 --- a/internal/gatewayapi/validate.go +++ b/internal/gatewayapi/validate.go @@ -89,9 +89,9 @@ func (t *Translator) validateBackendRefFilters(backendRef BackendRefContext, par var filtersLen int switch routeKind { case KindHTTPRoute: - filtersLen = len(backendRef.GetHTTPFilters()) + filtersLen = len(backendRef.HTTPBackendRef.Filters) case KindGRPCRoute: - filtersLen = len(backendRef.GetGRPCFilters()) + filtersLen = len(backendRef.GRPCBackendRef.Filters) default: return true }