From ef8d683dc7937fd1000af7e746960b4f1242779b Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Tue, 5 Dec 2023 17:20:15 +0100 Subject: [PATCH] Fixed traffic splitting condition for cluster configuration --- .../snapshot/resource/clusters/EnvoyClustersFactory.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index 60e46e1d5..b0601c06d 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -304,7 +304,7 @@ class EnvoyClustersFactory( clusterLoadAssignment: ClusterLoadAssignment?, trafficSplitting: TrafficSplittingProperties ) = clusterLoadAssignment?.endpointsList - ?.any { e -> trafficSplitting.zoneName == e.locality.zone } ?: false + ?.any { e -> trafficSplitting.zoneName == e.locality.zone && e.lbEndpointsCount > 0 } ?: false private fun shouldAddDynamicForwardProxyCluster(group: Group) = group.proxySettings.outgoing.getDomainPatternDependencies().isNotEmpty()