Skip to content

Commit 121002f

Browse files
added service name to eds config #292
1 parent 2e68b5d commit 121002f

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class EnvoySnapshotFactory(
342342
routes = routes,
343343
routesVersion = version.routes
344344
).also {
345-
logger.info("Snapshot for group: $it")
345+
logger.debug("Snapshot for group: $it")
346346
}
347347
}
348348

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ class EnvoyClustersFactory(
242242
return Cluster.newBuilder(cluster)
243243
.setCommonHttpProtocolOptions(HttpProtocolOptions.newBuilder().setIdleTimeout(idleTimeoutPolicy))
244244
.setName(clusterName)
245+
.setEdsClusterConfig(
246+
Cluster.EdsClusterConfig.newBuilder(cluster.edsClusterConfig)
247+
.setServiceName(clusterName)
248+
)
245249
.build()
246250
.also { logger.debug("Created regular cluster config {}", it.toString()) }
247251
}
@@ -481,7 +485,7 @@ class EnvoyClustersFactory(
481485
)
482486
)
483487
}
484-
)
488+
).setServiceName(clusterConfiguration.serviceName)
485489
)
486490
.setLbPolicy(properties.loadBalancing.policy)
487491
// TODO: if we want to have multiple memory-backend instances of ratelimit

envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactoryTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ internal class EnvoyClustersFactoryTest {
115115
}
116116
.anySatisfy {
117117
assertThat(it.name).isEqualTo(SECONDARY_CLUSTER_NAME)
118-
assertThat(it.edsClusterConfig).isEqualTo(cluster1.edsClusterConfig)
119118
}
120119
.anySatisfy {
121120
assertThat(it.name).isEqualTo(AGGREGATE_CLUSTER_NAME)

envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/utils/ClusterOperations.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ fun createCluster(
1818
.setType(Cluster.DiscoveryType.EDS)
1919
.setConnectTimeout(Durations.fromMillis(defaultProperties.edsConnectionTimeout.toMillis()))
2020
.setEdsClusterConfig(
21-
Cluster.EdsClusterConfig.newBuilder().setEdsConfig(
22-
ConfigSource.newBuilder().setAds(AggregatedConfigSource.newBuilder())
23-
)
21+
Cluster.EdsClusterConfig.newBuilder()
22+
.setEdsConfig(
23+
ConfigSource.newBuilder().setAds(
24+
AggregatedConfigSource.newBuilder()
25+
)
26+
).setServiceName(clusterName)
2427
)
2528
.setLbPolicy(defaultProperties.loadBalancing.policy)
2629
.setCommonHttpProtocolOptions(

0 commit comments

Comments
 (0)