Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 cleanup: delete several unused conversion paths #7681

Merged
merged 3 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions source/common/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,6 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "cds_json_lib",
srcs = ["cds_json.cc"],
hdrs = ["cds_json.h"],
external_deps = ["abseil_optional"],
deps = [
":address_json_lib",
":json_utility_lib",
":protocol_json_lib",
":tls_context_json_lib",
":utility_lib",
"//include/envoy/json:json_object_interface",
"//include/envoy/upstream:cluster_manager_interface",
"//source/common/common:assert_lib",
"//source/common/json:config_schemas_lib",
"//source/common/network:utility_lib",
"@envoy_api//envoy/api/v2:cds_cc",
"@envoy_api//envoy/api/v2/cluster:circuit_breaker_cc",
],
)

envoy_cc_library(
name = "filesystem_subscription_lib",
srcs = ["filesystem_subscription_impl.cc"],
Expand Down Expand Up @@ -336,18 +315,6 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "tls_context_json_lib",
srcs = ["tls_context_json.cc"],
hdrs = ["tls_context_json.h"],
deps = [
":json_utility_lib",
"//include/envoy/json:json_object_interface",
"//source/common/common:utility_lib",
"@envoy_api//envoy/api/v2/auth:cert_cc",
],
)

envoy_cc_library(
name = "type_to_endpoint_lib",
srcs = ["type_to_endpoint.cc"],
Expand Down
26 changes: 0 additions & 26 deletions source/common/config/address_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,6 @@
namespace Envoy {
namespace Config {

void AddressJson::translateAddress(const std::string& json_address, bool url, bool resolved,
envoy::api::v2::core::Address& address) {
if (resolved) {
Network::Address::InstanceConstSharedPtr instance =
url ? Network::Utility::resolveUrl(json_address)
: Network::Utility::parseInternetAddressAndPort(json_address);
if (instance->type() == Network::Address::Type::Ip) {
address.mutable_socket_address()->set_address(instance->ip()->addressAsString());
address.mutable_socket_address()->set_port_value(instance->ip()->port());
} else {
ASSERT(instance->type() == Network::Address::Type::Pipe);
address.mutable_pipe()->set_path(instance->asString());
}
return;
}

// We don't have v1 JSON with unresolved addresses in non-URL form.
ASSERT(url);
// Non-TCP scheme (e.g. Unix scheme) is not supported with unresolved address.
if (!Network::Utility::urlIsTcpScheme(json_address)) {
throw EnvoyException(fmt::format("unresolved URL must be TCP scheme, got: {}", json_address));
}
address.mutable_socket_address()->set_address(Network::Utility::hostFromTcpUrl(json_address));
address.mutable_socket_address()->set_port_value(Network::Utility::portFromTcpUrl(json_address));
}

void AddressJson::translateCidrRangeList(
const std::vector<std::string>& json_ip_list,
Protobuf::RepeatedPtrField<envoy::api::v2::core::CidrRange>& range_list) {
Expand Down
11 changes: 0 additions & 11 deletions source/common/config/address_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ namespace Config {

class AddressJson {
public:
/**
* Translate a v1 JSON address to v2 envoy::api::v2::core::Address.
* @param json_address source address.
* @param url is json_address a URL? E.g. tcp://<ip>:<port>. If not, it is
* treated as <ip>:<port>.
* @param resolved is json_address a concrete IP/pipe or unresolved hostname?
* @param address destination envoy::api::v2::core::Address.
*/
static void translateAddress(const std::string& json_address, bool url, bool resolved,
envoy::api::v2::core::Address& address);

/**
* Translate a v1 JSON array of IP ranges to v2
* Protobuf::RepeatedPtrField<envoy::api::v2::core::CidrRange>.
Expand Down
223 changes: 0 additions & 223 deletions source/common/config/cds_json.cc

This file was deleted.

71 changes: 0 additions & 71 deletions source/common/config/cds_json.h

This file was deleted.

Loading