diff --git a/source/common/tcp_proxy/tcp_proxy.cc b/source/common/tcp_proxy/tcp_proxy.cc index a82fef37c3b7..f319c039297a 100644 --- a/source/common/tcp_proxy/tcp_proxy.cc +++ b/source/common/tcp_proxy/tcp_proxy.cc @@ -40,8 +40,7 @@ Config::Route::Route( Config::WeightedClusterEntry::WeightedClusterEntry( const envoy::config::filter::network::tcp_proxy::v2::TcpProxy::WeightedCluster::ClusterWeight& config) - : cluster_name_(config.name()), cluster_weight_(PROTOBUF_GET_WRAPPED_REQUIRED(config, weight)) { -} + : cluster_name_(config.name()), cluster_weight_(config.weight()) {} Config::SharedConfig::SharedConfig( const envoy::config::filter::network::tcp_proxy::v2::TcpProxy& config, diff --git a/test/common/tcp_proxy/tcp_proxy_test.cc b/test/common/tcp_proxy/tcp_proxy_test.cc index 8177caa39aaf..4456dc1b5e0d 100644 --- a/test/common/tcp_proxy/tcp_proxy_test.cc +++ b/test/common/tcp_proxy/tcp_proxy_test.cc @@ -487,12 +487,12 @@ TEST_F(TcpProxyTest, WeightedClusters) { envoy::config::filter::network::tcp_proxy::v2::TcpProxy::WeightedCluster::ClusterWeight* cluster1 = config.mutable_weighted_clusters()->mutable_clusters()->Add(); cluster1->set_name("cluster1"); - cluster1->mutable_weight()->set_value(10); + cluster1->set_weight(10); envoy::config::filter::network::tcp_proxy::v2::TcpProxy::WeightedCluster::ClusterWeight* cluster2 = config.mutable_weighted_clusters()->mutable_clusters()->Add(); cluster2->set_name("cluster2"); - cluster2->mutable_weight()->set_value(90); + cluster2->set_weight(90); configure(config); @@ -506,7 +506,7 @@ TEST_F(TcpProxyTest, DefaultRoutes) { envoy::config::filter::network::tcp_proxy::v2::TcpProxy::WeightedCluster::ClusterWeight* ignored_cluster = config.mutable_weighted_clusters()->mutable_clusters()->Add(); ignored_cluster->set_name("ignored_cluster"); - ignored_cluster->mutable_weight()->set_value(10); + ignored_cluster->set_weight(10); configure(config);