Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Sep 25, 2024
1 parent 88537ea commit 9055ac9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/core/handshaker/http_connect/xds_http_proxy_mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ absl::optional<grpc_resolved_address> XdsHttpProxyMapper::MapAddress(
if (!proxy_address_str.has_value()) return absl::nullopt;
auto proxy_address = StringToSockaddr(*proxy_address_str);
if (!proxy_address.ok()) {
LOG(ERROR) << "error parsing address \"" << *proxy_address_str << "\": "
<< proxy_address.status();
LOG(ERROR) << "error parsing address \"" << *proxy_address_str
<< "\": " << proxy_address.status();
return absl::nullopt;
}
auto endpoint_address_str = grpc_sockaddr_to_string(&endpoint_address, true);
Expand Down
6 changes: 3 additions & 3 deletions src/core/xds/grpc/xds_cluster_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ CommonTlsContext Http11ProxyUpstreamTransportParse(
http_11_proxy);
if (transport_socket == nullptr) return {};
ValidationErrors::ScopedField field(errors, ".transport_socket.typed_config");
const auto* typed_config =
const auto* typed_config =
envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
auto wrapped_extension = ExtractXdsExtension(context, typed_config, errors);
if (!wrapped_extension.has_value()) return {};
Expand Down Expand Up @@ -481,8 +481,8 @@ absl::StatusOr<std::shared_ptr<const XdsClusterResource>> CdsResourceParse(
auto* transport_socket =
envoy_config_cluster_v3_Cluster_transport_socket(cluster);
if (transport_socket != nullptr) {
ValidationErrors::ScopedField field(
&errors, ".transport_socket.typed_config");
ValidationErrors::ScopedField field(&errors,
".transport_socket.typed_config");
const auto* typed_config =
envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
auto extension = ExtractXdsExtension(context, typed_config, &errors);
Expand Down
4 changes: 2 additions & 2 deletions src/core/xds/grpc/xds_endpoint_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ absl::optional<ParsedLocality> LocalityParse(
for (size_t i = 0; i < size; ++i) {
ValidationErrors::ScopedField field(errors,
absl::StrCat(".lb_endpoints[", i, "]"));
auto endpoint = EndpointAddressesParse(
context, lb_endpoints[i], proxy_address, errors);
auto endpoint =
EndpointAddressesParse(context, lb_endpoints[i], proxy_address, errors);
if (endpoint.has_value()) {
for (const auto& address : endpoint->addresses()) {
bool inserted = address_set->insert(address).second;
Expand Down
3 changes: 1 addition & 2 deletions src/core/xds/grpc/xds_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ class XdsAddressMetadataValue : public XdsMetadataValue {

private:
bool Equals(const XdsMetadataValue& other) const override {
return address_ ==
DownCast<const XdsAddressMetadataValue&>(other).address_;
return address_ == DownCast<const XdsAddressMetadataValue&>(other).address_;
}

std::string address_;
Expand Down
3 changes: 1 addition & 2 deletions src/core/xds/grpc/xds_metadata_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ XdsMetadataMap ParseXdsMetadataMap(
ParseGcpAuthnAudience(context, std::move(*extension), errors);
} else if (XdsHttpConnectEnabled() &&
extension->type == XdsAddressMetadataValue::Type()) {
metadata_value =
ParseAddress(context, std::move(*extension), errors);
metadata_value = ParseAddress(context, std::move(*extension), errors);
}
if (metadata_value != nullptr) {
metadata_map.Insert(key, std::move(metadata_value));
Expand Down
2 changes: 1 addition & 1 deletion test/core/xds/xds_cluster_resource_type_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ using envoy::extensions::clusters::aggregate::v3::ClusterConfig;
using envoy::extensions::filters::http::gcp_authn::v3::Audience;
using envoy::extensions::load_balancing_policies::round_robin::v3::RoundRobin;
using envoy::extensions::load_balancing_policies::wrr_locality::v3::WrrLocality;
using envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext;
using envoy::extensions::transport_sockets::http_11_proxy::v3::
Http11ProxyUpstreamTransport;
using envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext;
using envoy::extensions::upstreams::http::v3::HttpProtocolOptions;
using xds::type::v3::TypedStruct;

Expand Down
24 changes: 10 additions & 14 deletions test/core/xds/xds_endpoint_resource_type_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,7 @@ TEST_F(XdsEndpointTest, HttpProxyInEndpoint) {
*lb_endpoint->mutable_metadata()->mutable_typed_filter_metadata();
typed_metadata_map["envoy.http11_proxy_transport_socket.proxy_address"]
.PackFrom(address_proto);
socket_address = lb_endpoint
->mutable_endpoint()
socket_address = lb_endpoint->mutable_endpoint()
->mutable_address()
->mutable_socket_address();
socket_address->set_address("127.0.0.1");
Expand Down Expand Up @@ -1330,8 +1329,7 @@ TEST_F(XdsEndpointTest, HttpProxyInLocality) {
locality_name->set_zone("myzone");
locality_name->set_sub_zone("mysubzone");
auto* lb_endpoint = locality->add_lb_endpoints();
socket_address = lb_endpoint
->mutable_endpoint()
socket_address = lb_endpoint->mutable_endpoint()
->mutable_address()
->mutable_socket_address();
socket_address->set_address("127.0.0.1");
Expand Down Expand Up @@ -1391,11 +1389,10 @@ TEST_F(XdsEndpointTest, HttpProxyEndpointSupercedesLocality) {
socket_address->set_port_value(456);
auto& endpoint_typed_metadata_map =
*lb_endpoint->mutable_metadata()->mutable_typed_filter_metadata();
endpoint_typed_metadata_map[
"envoy.http11_proxy_transport_socket.proxy_address"]
.PackFrom(address_proto);
socket_address = lb_endpoint
->mutable_endpoint()
endpoint_typed_metadata_map
["envoy.http11_proxy_transport_socket.proxy_address"]
.PackFrom(address_proto);
socket_address = lb_endpoint->mutable_endpoint()
->mutable_address()
->mutable_socket_address();
socket_address->set_address("127.0.0.1");
Expand Down Expand Up @@ -1454,11 +1451,10 @@ TEST_F(XdsEndpointTest, HttpProxyIgnoredIfNotEnabled) {
socket_address->set_port_value(456);
auto& endpoint_typed_metadata_map =
*lb_endpoint->mutable_metadata()->mutable_typed_filter_metadata();
endpoint_typed_metadata_map[
"envoy.http11_proxy_transport_socket.proxy_address"]
.PackFrom(address_proto);
socket_address = lb_endpoint
->mutable_endpoint()
endpoint_typed_metadata_map
["envoy.http11_proxy_transport_socket.proxy_address"]
.PackFrom(address_proto);
socket_address = lb_endpoint->mutable_endpoint()
->mutable_address()
->mutable_socket_address();
socket_address->set_address("127.0.0.1");
Expand Down
10 changes: 8 additions & 2 deletions test/cpp/end2end/xds/xds_http_connect_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ TEST_P(XdsHttpProxyTest, TransportProxyInClusterAndProxyAddressInEndpoint) {
socket_address->set_address(grpc_core::LocalIp());
socket_address->set_port_value(
grpc_end2end_http_proxy_get_proxy_port(http_proxy_));
auto& metadata_map = *endpoints.mutable_endpoints(0)->mutable_lb_endpoints(0)->mutable_metadata()->mutable_typed_filter_metadata();
auto& metadata_map = *endpoints.mutable_endpoints(0)
->mutable_lb_endpoints(0)
->mutable_metadata()
->mutable_typed_filter_metadata();
metadata_map["envoy.http11_proxy_transport_socket.proxy_address"].PackFrom(
proxy_address_proto);
balancer_->ads_service()->SetEdsResource(endpoints);
Expand Down Expand Up @@ -116,7 +119,10 @@ TEST_P(XdsHttpProxyTest, ProxyAddressInEndpointButNoTransportProxyInCluster) {
socket_address->set_address(grpc_core::LocalIp());
socket_address->set_port_value(
grpc_end2end_http_proxy_get_proxy_port(http_proxy_));
auto& metadata_map = *endpoints.mutable_endpoints(0)->mutable_lb_endpoints(0)->mutable_metadata()->mutable_typed_filter_metadata();
auto& metadata_map = *endpoints.mutable_endpoints(0)
->mutable_lb_endpoints(0)
->mutable_metadata()
->mutable_typed_filter_metadata();
metadata_map["envoy.http11_proxy_transport_socket.proxy_address"].PackFrom(
proxy_address_proto);
balancer_->ads_service()->SetEdsResource(endpoints);
Expand Down

0 comments on commit 9055ac9

Please sign in to comment.