Skip to content

Commit

Permalink
added service name to eds config #292
Browse files Browse the repository at this point in the history
  • Loading branch information
nastassia-dailidava committed Sep 19, 2023
1 parent 2e68b5d commit 121002f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class EnvoySnapshotFactory(
routes = routes,
routesVersion = version.routes
).also {
logger.info("Snapshot for group: $it")
logger.debug("Snapshot for group: $it")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ class EnvoyClustersFactory(
return Cluster.newBuilder(cluster)
.setCommonHttpProtocolOptions(HttpProtocolOptions.newBuilder().setIdleTimeout(idleTimeoutPolicy))
.setName(clusterName)
.setEdsClusterConfig(
Cluster.EdsClusterConfig.newBuilder(cluster.edsClusterConfig)
.setServiceName(clusterName)
)
.build()
.also { logger.debug("Created regular cluster config {}", it.toString()) }
}
Expand Down Expand Up @@ -481,7 +485,7 @@ class EnvoyClustersFactory(
)
)
}
)
).setServiceName(clusterConfiguration.serviceName)
)
.setLbPolicy(properties.loadBalancing.policy)
// TODO: if we want to have multiple memory-backend instances of ratelimit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ internal class EnvoyClustersFactoryTest {
}
.anySatisfy {
assertThat(it.name).isEqualTo(SECONDARY_CLUSTER_NAME)
assertThat(it.edsClusterConfig).isEqualTo(cluster1.edsClusterConfig)
}
.anySatisfy {
assertThat(it.name).isEqualTo(AGGREGATE_CLUSTER_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ fun createCluster(
.setType(Cluster.DiscoveryType.EDS)
.setConnectTimeout(Durations.fromMillis(defaultProperties.edsConnectionTimeout.toMillis()))
.setEdsClusterConfig(
Cluster.EdsClusterConfig.newBuilder().setEdsConfig(
ConfigSource.newBuilder().setAds(AggregatedConfigSource.newBuilder())
)
Cluster.EdsClusterConfig.newBuilder()
.setEdsConfig(
ConfigSource.newBuilder().setAds(
AggregatedConfigSource.newBuilder()
)
).setServiceName(clusterName)
)
.setLbPolicy(defaultProperties.loadBalancing.policy)
.setCommonHttpProtocolOptions(
Expand Down

0 comments on commit 121002f

Please sign in to comment.