Skip to content

Commit 19714b3

Browse files
Implemented possibility for configuring traffic splitting, and fallback using aggregate cluster #292
1 parent 1e06196 commit 19714b3

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ class EnvoySnapshotFactory(
270270
group: Group,
271271
globalSnapshot: GlobalSnapshot
272272
): Snapshot {
273-
logger.debug("Creating new snapshot for group ${group.serviceName}")
274273
// TODO(dj): This is where serious refactoring needs to be done
275274
val egressDomainRouteSpecifications = getDomainRouteSpecifications(group, globalSnapshot)
276275
val egressServiceRouteSpecification = getServiceRouteSpecifications(group, globalSnapshot)
@@ -314,7 +313,6 @@ class EnvoySnapshotFactory(
314313
group.proxySettings.incoming.rateLimitEndpoints, globalSnapshot,
315314
egressRouteSpecification
316315
)
317-
// .also { logger.debug("Result endpoints: ${it.toString()}") }
318316

319317
val version = snapshotsVersions.version(group, clusters, endpoints, listeners, routes)
320318
return createSnapshot(
@@ -327,9 +325,7 @@ class EnvoySnapshotFactory(
327325
listenersVersion = version.listeners,
328326
routes = routes,
329327
routesVersion = version.routes
330-
).also {
331-
logger.debug("Snapshot endpoints: ${it.endpoints()}")
332-
}
328+
)
333329
}
334330

335331
private fun createRoutesWhenUsingTransparentProxy(

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ internal class EnvoyEndpointsFactoryTest {
368368
listOf(
369369
clusterState(cluster = "DC1"),
370370
clusterState(cluster = "DC2"),
371-
clusterState(cluster = "DC1", sName = serviceName2),
372-
clusterState(cluster = "DC2", sName = serviceName2),
371+
clusterState(cluster = "DC1", serviceName = serviceName2),
372+
clusterState(cluster = "DC2", serviceName = serviceName2),
373373
)
374374
)
375375

@@ -398,7 +398,7 @@ internal class EnvoyEndpointsFactoryTest {
398398
val multiClusterState = MultiClusterState(
399399
listOf(
400400
clusterState(cluster = defaultZone),
401-
clusterState(cluster = defaultZone, sName = serviceName2),
401+
clusterState(cluster = defaultZone, serviceName = serviceName2),
402402
)
403403
)
404404
val services = setOf(serviceName, serviceName2)
@@ -428,7 +428,7 @@ internal class EnvoyEndpointsFactoryTest {
428428
val multiClusterState = MultiClusterState(
429429
listOf(
430430
clusterState(cluster = defaultZone),
431-
clusterState(cluster = defaultZone, sName = serviceName2),
431+
clusterState(cluster = defaultZone, serviceName = serviceName2),
432432
)
433433
)
434434
val services = setOf(serviceName, serviceName2)
@@ -455,7 +455,7 @@ internal class EnvoyEndpointsFactoryTest {
455455
val multiClusterState = MultiClusterState(
456456
listOf(
457457
clusterState(cluster = defaultZone),
458-
clusterState(cluster = defaultZone, sName = serviceName2),
458+
clusterState(cluster = defaultZone, serviceName = serviceName2),
459459
)
460460
)
461461
val services = setOf(serviceName, serviceName2)
@@ -493,13 +493,13 @@ internal class EnvoyEndpointsFactoryTest {
493493
private fun clusterState(
494494
locality: Locality = Locality.LOCAL,
495495
cluster: String,
496-
sName: String = serviceName
496+
serviceName: String = this.serviceName
497497
): ClusterState {
498498
return ClusterState(
499499
ServicesState(
500500
serviceNameToInstances = concurrentMapOf(
501-
sName to ServiceInstances(
502-
sName, setOf(
501+
serviceName to ServiceInstances(
502+
serviceName, setOf(
503503
ServiceInstance(
504504
id = "id",
505505
tags = setOf("envoy"),

0 commit comments

Comments
 (0)