Skip to content

Commit 0304ef3

Browse files
authored
route: don't use specific backend gvk here (#10772)
1 parent 8575ed8 commit 0304ef3

File tree

1 file changed

+3
-3
lines changed
  • internal/kgateway/translator/irtranslator

1 file changed

+3
-3
lines changed

internal/kgateway/translator/irtranslator/route.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/reports"
2222
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/translator/routeutils"
2323
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/utils"
24-
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/wellknown"
2524
"github.com/kgateway-dev/kgateway/v2/pkg/utils/regexutils"
2625
)
2726

@@ -249,8 +248,9 @@ func (h *httpRouteConfigurationTranslator) runBackendPolicies(ctx context.Contex
249248
func (h *httpRouteConfigurationTranslator) runBackend(ctx context.Context, in ir.HttpBackend, pCtx *ir.RouteBackendContext, outRoute *envoy_config_route_v3.Route) error {
250249
var errs []error
251250
if in.Backend.BackendObject != nil {
252-
if in.Backend.BackendObject.GetGroupKind().Kind == wellknown.BackendGVK.Kind {
253-
err := h.PluginPass[in.Backend.BackendObject.GetGroupKind()].ApplyForBackend(ctx, pCtx, in, outRoute)
251+
backendPass := h.PluginPass[in.Backend.BackendObject.GetGroupKind()]
252+
if backendPass != nil {
253+
err := backendPass.ApplyForBackend(ctx, pCtx, in, outRoute)
254254
if err != nil {
255255
errs = append(errs, err)
256256
}

0 commit comments

Comments
 (0)