Skip to content

Commit 1f01680

Browse files
Implemented possibility for configuring traffic splitting, and fallback using aggregate cluster #292
1 parent b65015c commit 1f01680

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ class EnvoyClustersFactory(
267267
return cluster?.let {
268268
if (enableTrafficSplitting(serviceName, cluster.name, dependencies, clusterLoadAssignment)) {
269269
logger.debug(
270-
"Creating traffic splitting egress cluster config for ${cluster.name}, service: $serviceName")
270+
"Creating traffic splitting egress cluster config for ${cluster.name}, service: $serviceName"
271+
)
271272
createSetOfClustersForGroup(dependencySettings, cluster)
272273
} else {
273274
listOf(createClusterForGroup(dependencySettings, cluster))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class EnvoyEndpointsFactory(
8282
): List<ClusterLoadAssignment> {
8383
return egressRouteSpecifications
8484
.filter { it.clusterWeights.isNotEmpty() }
85-
.onEach { logger.debug("Traffic splitting is enabled for cluster: ${it.clusterName}") }
85+
.onEach { logger.debug("Traffic splitting is enabled for cluster: ${it.clusterName}") }
8686
.mapNotNull { routeSpec ->
8787
clusterLoadAssignments[routeSpec.clusterName]?.let {
8888
ClusterLoadAssignment.newBuilder(it)

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/utils/ClusterNames.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import pl.allegro.tech.servicemesh.envoycontrol.utils.ClusterNames.AGGREGATE_CLU
44
import pl.allegro.tech.servicemesh.envoycontrol.utils.ClusterNames.SECONDARY_CLUSTER_POSTFIX
55

66
object ClusterNames {
7-
const val SECONDARY_CLUSTER_POSTFIX= "secondary"
8-
const val AGGREGATE_CLUSTER_POSTFIX= "aggregate"
7+
const val SECONDARY_CLUSTER_POSTFIX = "secondary"
8+
const val AGGREGATE_CLUSTER_POSTFIX = "aggregate"
99
}
10-
fun getSecondaryClusterName(serviceName: String) :String {
10+
11+
fun getSecondaryClusterName(serviceName: String): String {
1112
return "$serviceName-$SECONDARY_CLUSTER_POSTFIX"
1213
}
1314

14-
fun getAggregateClusterName(serviceName: String) :String {
15+
fun getAggregateClusterName(serviceName: String): String {
1516
return "$serviceName-$AGGREGATE_CLUSTER_POSTFIX"
1617
}

0 commit comments

Comments
 (0)