From 868ea71c914017ae6e8ceedfb0b3819a74d7cdec Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Mon, 16 Dec 2024 21:32:16 +0100 Subject: [PATCH] added log for empty load assignment --- .../envoycontrol/snapshot/EnvoySnapshotFactory.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt index 4e80857d7..3f8fb3a7b 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt @@ -337,7 +337,19 @@ class EnvoySnapshotFactory( val endpoints = getServicesEndpointsForGroup( group.proxySettings.incoming.rateLimitEndpoints, globalSnapshot, egressRouteSpecification - ) + ).also { e -> + val list = e.mapNotNull { el -> el.endpointsList.find { x -> x.lbEndpointsList.isEmpty() } } + val rPolicy = group.proxySettings.outgoing.defaultServiceSettings.routingPolicy + if (list.isNotEmpty() && + list.none { it.locality.zone.contains(properties.loadBalancing.trafficSplitting.zoneName) } && + rPolicy.autoServiceTag + ) { + logger.warn( + "Some of service ${group.serviceName} dependencies have ClusterLoadAssignment with empty " + + "lbEndpoints: $list, routingPolicy: $rPolicy, all endpoints: $e" + ) + } + } val version = snapshotsVersions.version(group, clusters, endpoints, listeners, routes) return createSnapshot(