Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions source/common/config/grpc_mux_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void GrpcMuxImpl::onDiscoveryResponse(
// We have to walk all watches (and need an efficient map as a result) to
// ensure we deliver empty config updates when a resource is dropped. We make the map ordered
// for test determinism.
std::vector<DecodedResourceImplPtr> resources;
std::vector<DecodedResourcePtr> resources;
absl::btree_map<std::string, DecodedResourceRef> resource_ref_map;
std::vector<DecodedResourceRef> all_resource_refs;
OpaqueResourceDecoder& resource_decoder = api_state.watches_.front()->resource_decoder_;
Expand Down Expand Up @@ -247,8 +247,7 @@ void GrpcMuxImpl::onDiscoveryResponse(

// Execute external config validators if there are any watches.
if (!api_state.watches_.empty()) {
config_validators_->executeValidators(
type_url, reinterpret_cast<std::vector<DecodedResourcePtr>&>(resources));
config_validators_->executeValidators(type_url, resources);
}

for (auto watch : api_state.watches_) {
Expand Down
6 changes: 2 additions & 4 deletions source/common/config/watch_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void WatchMap::onConfigUpdate(
// Build a pair of maps: from watches, to the set of resources {added,removed} that each watch
// cares about. Each entry in the map-pair is then a nice little bundle that can be fed directly
// into the individual onConfigUpdate()s.
std::vector<DecodedResourceImplPtr> decoded_resources;
std::vector<DecodedResourcePtr> decoded_resources;
absl::flat_hash_map<Watch*, std::vector<DecodedResourceRef>> per_watch_added;
for (const auto& r : added_resources) {
const absl::flat_hash_set<Watch*>& interested_in_r = watchesInterestedIn(r.name());
Expand All @@ -211,9 +211,7 @@ void WatchMap::onConfigUpdate(
}

// Execute external config validators.
config_validators_.executeValidators(
type_url_, reinterpret_cast<std::vector<DecodedResourcePtr>&>(decoded_resources),
removed_resources);
config_validators_.executeValidators(type_url_, decoded_resources, removed_resources);

// We just bundled up the updates into nice per-watch packages. Now, deliver them.
for (const auto& [cur_watch, resource_to_add] : per_watch_added) {
Expand Down