From 9f00af216baca7ff689ea43e69c9facc0903cdc7 Mon Sep 17 00:00:00 2001 From: Isala Piyarisi Date: Thu, 31 Oct 2024 10:15:44 +0530 Subject: [PATCH] Fixed cluster creation issue with connection pooling disabled --- .../oasparser/envoyconf/routes_with_clusters.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/adapter/internal/oasparser/envoyconf/routes_with_clusters.go b/adapter/internal/oasparser/envoyconf/routes_with_clusters.go index 0e981c8804..5090ffc3f3 100644 --- a/adapter/internal/oasparser/envoyconf/routes_with_clusters.go +++ b/adapter/internal/oasparser/envoyconf/routes_with_clusters.go @@ -622,21 +622,7 @@ func processEndpoints(clusterName string, clusterDetails *model.EndpointCluster, // If the endpoint is within the cluster, set the max requests per connection to 1 // This ensure cilium proxy will not reuse the connection if withinClusterEndpoint && os.Getenv("ROUTER_DISABLE_IN_CLUSTER_CONNECTION_POOLING") == "true" { - config := &upstreams.HttpProtocolOptions{ - CommonHttpProtocolOptions: &corev3.HttpProtocolOptions{ - MaxRequestsPerConnection: wrapperspb.UInt32(1), - }, - } - - marshalledConfig, err := anypb.New(config) - if err != nil { - return nil, nil, errors.New("internal Error while marshalling the HTTP Protocol Options") - } - - // Add to cluster's TypedExtensionProtocolOptions instead of deprecated fields - cluster.TypedExtensionProtocolOptions = map[string]*any.Any{ - "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": marshalledConfig, - } + cluster.MaxRequestsPerConnection = wrapperspb.UInt32(1) } if len(clusterDetails.Endpoints) > 1 {