forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proto_descriptors.cc
57 lines (49 loc) · 2.66 KB
/
proto_descriptors.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "source/server/proto_descriptors.h"
#include "source/common/common/assert.h"
#include "source/common/common/fmt.h"
#include "source/common/config/protobuf_link_hacks.h"
#include "source/common/protobuf/protobuf.h"
#include "absl/strings/str_cat.h"
namespace Envoy {
namespace Server {
void validateProtoDescriptors() {
const auto methods = {
"envoy.service.cluster.v3.ClusterDiscoveryService.FetchClusters",
"envoy.service.cluster.v3.ClusterDiscoveryService.StreamClusters",
"envoy.service.cluster.v3.ClusterDiscoveryService.DeltaClusters",
"envoy.service.discovery.v3.AggregatedDiscoveryService.StreamAggregatedResources",
"envoy.service.discovery.v3.AggregatedDiscoveryService.DeltaAggregatedResources",
"envoy.service.endpoint.v3.EndpointDiscoveryService.FetchEndpoints",
"envoy.service.endpoint.v3.EndpointDiscoveryService.StreamEndpoints",
"envoy.service.endpoint.v3.EndpointDiscoveryService.DeltaEndpoints",
"envoy.service.endpoint.v3.LocalityEndpointDiscoveryService.DeltaLocalityEndpoints",
"envoy.service.health.v3.HealthDiscoveryService.FetchHealthCheck",
"envoy.service.health.v3.HealthDiscoveryService.StreamHealthCheck",
"envoy.service.listener.v3.ListenerDiscoveryService.FetchListeners",
"envoy.service.listener.v3.ListenerDiscoveryService.StreamListeners",
"envoy.service.listener.v3.ListenerDiscoveryService.DeltaListeners",
"envoy.service.ratelimit.v3.RateLimitService.ShouldRateLimit",
"envoy.service.route.v3.RouteDiscoveryService.FetchRoutes",
"envoy.service.route.v3.RouteDiscoveryService.StreamRoutes",
"envoy.service.route.v3.RouteDiscoveryService.DeltaRoutes",
"envoy.service.runtime.v3.RuntimeDiscoveryService.StreamRuntime",
"envoy.service.runtime.v3.RuntimeDiscoveryService.FetchRuntime",
};
for (const auto& method : methods) {
RELEASE_ASSERT(Protobuf::DescriptorPool::generated_pool()->FindMethodByName(method) != nullptr,
absl::StrCat("Unable to find method descriptor for ", method));
}
const auto types = {
"envoy.config.cluster.v3.Cluster", "envoy.config.endpoint.v3.ClusterLoadAssignment",
"envoy.config.listener.v3.Listener", "envoy.config.route.v3.RouteConfiguration",
"envoy.config.route.v3.VirtualHost", "envoy.extensions.transport_sockets.tls.v3.Secret",
"envoy.config.endpoint.v3.LbEndpoint",
};
for (const auto& type : types) {
RELEASE_ASSERT(Protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName(type) !=
nullptr,
absl::StrCat("Unable to find message type for ", type));
}
}
} // namespace Server
} // namespace Envoy