forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proto_descriptors.cc
54 lines (46 loc) · 2.22 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
#include "server/proto_descriptors.h"
#include "common/common/assert.h"
#include "common/common/fmt.h"
#include "common/config/protobuf_link_hacks.h"
#include "common/protobuf/protobuf.h"
#include "absl/strings/str_cat.h"
namespace Envoy {
namespace Server {
void validateProtoDescriptors() {
const auto methods = {
"envoy.api.v2.ClusterDiscoveryService.FetchClusters",
"envoy.api.v2.ClusterDiscoveryService.StreamClusters",
"envoy.api.v2.ClusterDiscoveryService.DeltaClusters",
"envoy.api.v2.EndpointDiscoveryService.FetchEndpoints",
"envoy.api.v2.EndpointDiscoveryService.StreamEndpoints",
"envoy.api.v2.EndpointDiscoveryService.DeltaEndpoints",
"envoy.api.v2.ListenerDiscoveryService.FetchListeners",
"envoy.api.v2.ListenerDiscoveryService.StreamListeners",
"envoy.api.v2.ListenerDiscoveryService.DeltaListeners",
"envoy.api.v2.RouteDiscoveryService.FetchRoutes",
"envoy.api.v2.RouteDiscoveryService.StreamRoutes",
"envoy.api.v2.RouteDiscoveryService.DeltaRoutes",
"envoy.service.discovery.v2.AggregatedDiscoveryService.StreamAggregatedResources",
"envoy.service.discovery.v2.AggregatedDiscoveryService.DeltaAggregatedResources",
"envoy.service.discovery.v2.HealthDiscoveryService.FetchHealthCheck",
"envoy.service.discovery.v2.HealthDiscoveryService.StreamHealthCheck",
"envoy.service.discovery.v2.RuntimeDiscoveryService.FetchRuntime",
"envoy.service.discovery.v2.RuntimeDiscoveryService.StreamRuntime",
"envoy.service.ratelimit.v2.RateLimitService.ShouldRateLimit",
};
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.api.v2.Cluster", "envoy.api.v2.ClusterLoadAssignment",
"envoy.api.v2.Listener", "envoy.api.v2.RouteConfiguration",
"envoy.api.v2.route.VirtualHost", "envoy.api.v2.auth.Secret",
};
for (const auto& type : types) {
RELEASE_ASSERT(
Protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName(type) != nullptr, "");
}
}
} // namespace Server
} // namespace Envoy