diff --git a/internal/provider/kubernetes/controller.go b/internal/provider/kubernetes/controller.go index 90ed2dd13d..4b1454b952 100644 --- a/internal/provider/kubernetes/controller.go +++ b/internal/provider/kubernetes/controller.go @@ -290,13 +290,6 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques continue } - if r.backendCRDExists { - if err = r.processBackends(ctx, gwcResource); err != nil { - r.log.Error(err, fmt.Sprintf("failed processBackends for gatewayClass %s, skipping it", managedGC.Name)) - continue - } - } - // Add the referenced services, ServiceImports, and EndpointSlices in // the collected BackendRefs to the resourceTree. // BackendRefs are referred by various Route objects and the ExtAuth in SecurityPolicies. @@ -1304,23 +1297,6 @@ func (r *gatewayAPIReconciler) processBackendTLSPolicies( return nil } -// processBackends adds Backends to the resourceTree -func (r *gatewayAPIReconciler) processBackends(ctx context.Context, resourceTree *resource.Resources) error { - backends := egv1a1.BackendList{} - if err := r.client.List(ctx, &backends); err != nil { - return fmt.Errorf("error listing Backends: %w", err) - } - - for _, backend := range backends.Items { - backend := backend //nolint:copyloopvar - // Discard Status to reduce memory consumption in watchable - // It will be recomputed by the gateway-api layer - backend.Status = egv1a1.BackendStatus{} - resourceTree.Backends = append(resourceTree.Backends, &backend) - } - return nil -} - // removeFinalizer removes the gatewayclass finalizer from the provided gc, if it exists. func (r *gatewayAPIReconciler) removeFinalizer(ctx context.Context, gc *gwapiv1.GatewayClass) error { if slice.ContainsString(gc.Finalizers, gatewayClassFinalizer) {