Skip to content

Commit

Permalink
docs/comments: update v2 --> v3 references (#12365)
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
  • Loading branch information
Raúl Gutiérrez Segalés authored Jul 30, 2020
1 parent 0186a9f commit ec34be8
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion include/envoy/config/subscription_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SubscriptionFactory {
/**
* Subscription factory interface.
*
* @param config envoy::api::v2::core::ConfigSource to construct from.
* @param config envoy::config::core::v3::ConfigSource to construct from.
* @param type_url type URL for the resource being subscribed to.
* @param scope stats scope for any stats tracked by the subscription.
* @param callbacks the callbacks needed by all Subscription objects, to deliver config updates.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/grpc/async_client_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AsyncClientManager {
/**
* Create a Grpc::AsyncClients factory for a service. Validation of the service is performed and
* will raise an exception on failure.
* @param grpc_service envoy::api::v2::core::GrpcService configuration.
* @param grpc_service envoy::config::core::v3::GrpcService configuration.
* @param scope stats scope.
* @param skip_cluster_check if set to true skips checks for cluster presence and being statically
* configured.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/network/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class ListenerFilterCallbacks {
virtual void setDynamicMetadata(const std::string& name, const ProtobufWkt::Struct& value) PURE;

/**
* @return const envoy::api::v2::core::Metadata& the dynamic metadata associated with this
* @return const envoy::config::core::v3::Metadata& the dynamic metadata associated with this
* connection.
*/
virtual envoy::config::core::v3::Metadata& dynamicMetadata() PURE;
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/router/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ class RouteEntry : public ResponseEntry {
virtual const Envoy::Config::TypedMetadata& typedMetadata() const PURE;

/**
* @return const envoy::api::v2::core::Metadata& return the metadata provided in the config for
* @return const envoy::config::core::v3::Metadata& return the metadata provided in the config for
* this route.
*/
virtual const envoy::config::core::v3::Metadata& metadata() const PURE;
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/secret/secret_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SecretManager {
virtual ~SecretManager() = default;

/**
* @param add a static secret from envoy::api::v2::auth::Secret.
* @param add a static secret from envoy::extensions::transport_sockets::tls::v3::Secret.
* @throw an EnvoyException if the secret is invalid or not supported, or there is duplicate.
*/
virtual void
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/active_udp_listener_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Server {

/**
* Interface to create udp listener according to
* envoy::api::v2::listener::UdpListenerConfig.udp_listener_name.
* envoy::config::listener::v3::UdpListenerConfig.udp_listener_name.
*/
class ActiveUdpListenerConfigFactory : public Config::UntypedFactory {
public:
Expand Down
3 changes: 2 additions & 1 deletion include/envoy/stream_info/stream_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ class StreamInfo {
virtual const Router::RouteEntry* routeEntry() const PURE;

/**
* @return const envoy::api::v2::core::Metadata& the dynamic metadata associated with this request
* @return const envoy::config::core::v3::Metadata& the dynamic metadata associated with this
* request
*/
virtual envoy::config::core::v3::Metadata& dynamicMetadata() PURE;
virtual const envoy::config::core::v3::Metadata& dynamicMetadata() const PURE;
Expand Down
4 changes: 2 additions & 2 deletions include/envoy/upstream/cluster_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ class ClusterManager {
virtual void shutdown() PURE;

/**
* @return const envoy::api::v2::core::BindConfig& cluster manager wide bind configuration for new
* upstream connections.
* @return const envoy::config::core::v3::BindConfig& cluster manager wide bind configuration for
* new upstream connections.
*/
virtual const envoy::config::core::v3::BindConfig& bindConfig() const PURE;

Expand Down
10 changes: 5 additions & 5 deletions include/envoy/upstream/upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,8 @@ class ClusterInfo {
}

/**
* @return const envoy::api::v2::Cluster::CommonLbConfig& the common configuration for all
* load balancers for this cluster.
* @return const envoy::config::cluster::v3::Cluster::CommonLbConfig& the common configuration for
* all load balancers for this cluster.
*/
virtual const envoy::config::cluster::v3::Cluster::CommonLbConfig& lbConfig() const PURE;

Expand Down Expand Up @@ -811,8 +811,8 @@ class ClusterInfo {
lbRingHashConfig() const PURE;

/**
* @return const absl::optional<envoy::api::v2::Cluster::OriginalDstLbConfig>& the configuration
* for the Original Destination load balancing policy, only used if type is set to
* @return const absl::optional<envoy::config::cluster::v3::Cluster::OriginalDstLbConfig>& the
* configuration for the Original Destination load balancing policy, only used if type is set to
* ORIGINAL_DST_LB.
*/
virtual const absl::optional<envoy::config::cluster::v3::Cluster::OriginalDstLbConfig>&
Expand Down Expand Up @@ -904,7 +904,7 @@ class ClusterInfo {
virtual const LoadBalancerSubsetInfo& lbSubsetInfo() const PURE;

/**
* @return const envoy::api::v2::core::Metadata& the configuration metadata for this cluster.
* @return const envoy::config::core::v3::Metadata& the configuration metadata for this cluster.
*/
virtual const envoy::config::core::v3::Metadata& metadata() const PURE;

Expand Down
3 changes: 2 additions & 1 deletion source/common/config/subscription_factory_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ SubscriptionPtr SubscriptionFactoryImpl::subscriptionFromConfigSource(
Utility::configSourceInitialFetchTimeout(config), true);
}
default:
throw EnvoyException("Missing config source specifier in envoy::api::v2::core::ConfigSource");
throw EnvoyException(
"Missing config source specifier in envoy::config::core::v3::ConfigSource");
}
NOT_REACHED_GCOVR_EXCL_LINE;
}
Expand Down
21 changes: 11 additions & 10 deletions source/common/config/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Envoy {
namespace Config {

/**
* Constant Api Type Values, used by envoy::api::v2::core::ApiConfigSource.
* Constant Api Type Values, used by envoy::config::core::v3::ApiConfigSource.
*/
class ApiTypeValues {
public:
Expand Down Expand Up @@ -78,33 +78,33 @@ class Utility {

/**
* Extract refresh_delay as a std::chrono::milliseconds from
* envoy::api::v2::core::ApiConfigSource.
* envoy::config::core::v3::ApiConfigSource.
*/
static std::chrono::milliseconds
apiConfigSourceRefreshDelay(const envoy::config::core::v3::ApiConfigSource& api_config_source);

/**
* Extract request_timeout as a std::chrono::milliseconds from
* envoy::api::v2::core::ApiConfigSource. If request_timeout isn't set in the config source, a
* envoy::config::core::v3::ApiConfigSource. If request_timeout isn't set in the config source, a
* default value of 1s will be returned.
*/
static std::chrono::milliseconds
apiConfigSourceRequestTimeout(const envoy::config::core::v3::ApiConfigSource& api_config_source);

/**
* Extract initial_fetch_timeout as a std::chrono::milliseconds from
* envoy::api::v2::core::ConfigSource. If request_timeout isn't set in the config source, a
* envoy::config::core::v3::ApiConfigSource. If request_timeout isn't set in the config source, a
* default value of 0s will be returned.
*/
static std::chrono::milliseconds
configSourceInitialFetchTimeout(const envoy::config::core::v3::ConfigSource& config_source);

/**
* Populate an envoy::api::v2::core::ApiConfigSource.
* Populate an envoy::config::core::v3::ApiConfigSource.
* @param cluster supplies the cluster name for the ApiConfigSource.
* @param refresh_delay_ms supplies the refresh delay for the ApiConfigSource in ms.
* @param api_type supplies the type of subscription to use for the ApiConfigSource.
* @param api_config_source a reference to the envoy::api::v2::core::ApiConfigSource object to
* @param api_config_source a reference to the envoy::config::core::v3::ApiConfigSource object to
* populate.
*/
static void translateApiConfigSource(const std::string& cluster, uint32_t refresh_delay_ms,
Expand Down Expand Up @@ -179,7 +179,8 @@ class Utility {
const envoy::config::core::v3::ApiConfigSource& api_config_source);

/**
* Parses RateLimit configuration from envoy::api::v2::core::ApiConfigSource to RateLimitSettings.
* Parses RateLimit configuration from envoy::config::core::v3::ApiConfigSource to
* RateLimitSettings.
* @param api_config_source ApiConfigSource.
* @return RateLimitSettings.
*/
Expand Down Expand Up @@ -353,9 +354,9 @@ class Utility {
createHistogramSettings(const envoy::config::bootstrap::v3::Bootstrap& bootstrap);

/**
* Obtain gRPC async client factory from a envoy::api::v2::core::ApiConfigSource.
* Obtain gRPC async client factory from a envoy::config::core::v3::ApiConfigSource.
* @param async_client_manager gRPC async client manager.
* @param api_config_source envoy::api::v3::core::ApiConfigSource. Must have config type GRPC.
* @param api_config_source envoy::config::core::v3::ApiConfigSource. Must have config type GRPC.
* @param skip_cluster_check whether to skip cluster validation.
* @return Grpc::AsyncClientFactoryPtr gRPC async client factory.
*/
Expand All @@ -367,7 +368,7 @@ class Utility {
/**
* Translate a set of cluster's hosts into a load assignment configuration.
* @param hosts cluster's list of hosts.
* @return envoy::api::v2::ClusterLoadAssignment a load assignment configuration.
* @return envoy::config::endpoint::v3::ClusterLoadAssignment a load assignment configuration.
*/
static envoy::config::endpoint::v3::ClusterLoadAssignment
translateClusterHosts(const Protobuf::RepeatedPtrField<envoy::config::core::v3::Address>& hosts);
Expand Down
14 changes: 7 additions & 7 deletions source/common/grpc/google_grpc_creds_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ getGoogleGrpcChannelCredentials(const envoy::config::core::v3::GrpcService& grpc
class CredsUtility {
public:
/**
* Translation from envoy::api::v2::core::GrpcService to grpc::ChannelCredentials
* Translation from envoy::config::core::v3::GrpcService::GoogleGrpc to grpc::ChannelCredentials
* for channel credentials.
* @param google_grpc Google gRPC config.
* @param api reference to the Api object
Expand All @@ -31,17 +31,17 @@ class CredsUtility {
Api::Api& api);

/**
* Static translation from envoy::api::v2::core::GrpcService to a vector of grpc::CallCredentials.
* Any plugin based call credentials will be elided.
* Static translation from envoy::config::core::v3::GrpcService::GoogleGrpc to a vector of
* grpc::CallCredentials. Any plugin based call credentials will be elided.
* @param grpc_service Google gRPC config.
* @return std::vector<std::shared_ptr<grpc::CallCredentials>> call credentials.
*/
static std::vector<std::shared_ptr<grpc::CallCredentials>>
callCredentials(const envoy::config::core::v3::GrpcService::GoogleGrpc& google_grpc);

/**
* Default translation from envoy::api::v2::core::GrpcService to grpc::ChannelCredentials for SSL
* channel credentials.
* Default translation from envoy::config::core::v3::GrpcService::GoogleGrpc to
* grpc::ChannelCredentials for SSL channel credentials.
* @param grpc_service_config gRPC service config.
* @param api reference to the Api object
* @return std::shared_ptr<grpc::ChannelCredentials> SSL channel credentials. Empty SSL
Expand All @@ -53,8 +53,8 @@ class CredsUtility {
Api::Api& api);

/**
* Default static translation from envoy::api::v2::core::GrpcService to grpc::ChannelCredentials
* for all non-plugin based channel and call credentials.
* Default static translation from envoy::config::core::v3::GrpcService::GoogleGrpc to
* grpc::ChannelCredentials for all non-plugin based channel and call credentials.
* @param grpc_service_config gRPC service config.
* @param api reference to the Api object
* @return std::shared_ptr<grpc::ChannelCredentials> composite channel and call credentials.
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ bool isWebSocketUpgradeRequest(const RequestHeaderMap& headers);

/**
* @return Http1Settings An Http1Settings populated from the
* envoy::api::v2::core::Http1ProtocolOptions config.
* envoy::config::core::v3::Http1ProtocolOptions config.
*/
Http1Settings parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOptions& config);

Expand Down
2 changes: 1 addition & 1 deletion source/common/network/cidr_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CidrRange {
static CidrRange create(const std::string& range);

/**
* Constructs a CidrRange from envoy::api::v2::core::CidrRange.
* Constructs a CidrRange from envoy::config::core::v3::CidrRange.
* TODO(ccaraman): Update CidrRange::create to support only constructing valid ranges.
*/
static CidrRange create(const envoy::config::core::v3::CidrRange& cidr);
Expand Down
4 changes: 2 additions & 2 deletions source/common/network/resolver_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ namespace Envoy {
namespace Network {
namespace Address {
/**
* Create an Instance from a envoy::api::v2::core::Address.
* Create an Instance from a envoy::config::core::v3::Address.
* @param address supplies the address proto to resolve.
* @return pointer to the Instance.
*/
Address::InstanceConstSharedPtr
resolveProtoAddress(const envoy::config::core::v3::Address& address);

/**
* Create an Instance from a envoy::api::v2::core::SocketAddress.
* Create an Instance from a envoy::config::core::v3::SocketAddress.
* @param address supplies the socket address proto to resolve.
* @return pointer to the Instance.
*/
Expand Down
4 changes: 2 additions & 2 deletions source/common/protobuf/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ uint64_t fractionalPercentDenominatorToInt(
} // namespace ProtobufPercentHelper
} // namespace Envoy

// Convert an envoy::api::v2::core::Percent to a double or a default.
// Convert an envoy::type::v3::Percent to a double or a default.
// @param message supplies the proto message containing the field.
// @param field_name supplies the field name in the message.
// @param default_value supplies the default if the field is not present.
Expand All @@ -94,7 +94,7 @@ uint64_t fractionalPercentDenominatorToInt(
? (message).has_##field_name() ? (message).field_name().value() : default_value \
: throw EnvoyException(fmt::format("Value not in the range of 0..100 range.")))

// Convert an envoy::api::v2::core::Percent to a rounded integer or a default.
// Convert an envoy::type::v3::Percent to a rounded integer or a default.
// @param message supplies the proto message containing the field.
// @param field_name supplies the field name in the message.
// @param max_value supplies the maximum allowed integral value (e.g., 100, 10000, etc.).
Expand Down
3 changes: 2 additions & 1 deletion source/common/upstream/health_discovery_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ envoy::service::health::v3::HealthCheckRequestOrEndpointHealthResponse HdsDelega
auto* endpoint = response.mutable_endpoint_health_response()->add_endpoints_health();
Network::Utility::addressToProtobufAddress(
*host->address(), *endpoint->mutable_endpoint()->mutable_address());
// TODO(lilika): Add support for more granular options of envoy::api::v2::core::HealthStatus
// TODO(lilika): Add support for more granular options of
// envoy::config::core::v3::HealthStatus
if (host->health() == Host::Health::Healthy) {
endpoint->set_health_status(envoy::config::core::v3::HEALTHY);
} else {
Expand Down
2 changes: 1 addition & 1 deletion source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ void HostSetImpl::rebuildLocalityScheduler(
// scheduler.
//
// TODO(htuch): if the underlying locality index ->
// envoy::api::v2::core::Locality hasn't changed in hosts_/healthy_hosts_/degraded_hosts_, we
// envoy::config::core::v3::Locality hasn't changed in hosts_/healthy_hosts_/degraded_hosts_, we
// could just update locality_weight_ without rebuilding. Similar to how host
// level WRR works, we would age out the existing entries via picks and lazily
// apply the new weights.
Expand Down
4 changes: 2 additions & 2 deletions source/docs/subset_load_balancer.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ e7 | dev | 1.2-pre | std |

Note: Only e1 has the "xlarge" metadata key.

Given this CDS `envoy::api::v2::Cluster`:
Given this CDS `envoy::config::cluster::v3::Cluster`:

``` json
{
Expand Down Expand Up @@ -165,7 +165,7 @@ After loading this configuration, the SLB's `LbSubsetMap` looks like this:
<a name="diagram"></a>
![LbSubsetMap Diagram](subset_load_balancer_diagram.svg)

Given these `envoy::api::v2::route::Route` entries:
Given these `envoy::config::route::v3::Route` entries:

``` json
"routes": [
Expand Down
2 changes: 1 addition & 1 deletion test/common/config/subscription_factory_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST_F(SubscriptionFactoryTest, NoConfigSpecifier) {
envoy::config::core::v3::ConfigSource config;
EXPECT_THROW_WITH_MESSAGE(
subscriptionFromConfigSource(config), EnvoyException,
"Missing config source specifier in envoy::api::v2::core::ConfigSource");
"Missing config source specifier in envoy::config::core::v3::ConfigSource");
}

TEST_F(SubscriptionFactoryTest, RestClusterEmpty) {
Expand Down

0 comments on commit ec34be8

Please sign in to comment.