Skip to content

Commit

Permalink
Fixed cluster creation issue with connection pooling disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
isala404 committed Oct 31, 2024
1 parent 444d219 commit 9f00af2
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions adapter/internal/oasparser/envoyconf/routes_with_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9f00af2

Please sign in to comment.