Update config selector for LDS update with no route config (#25528)

* Update config selector upon LDS update

* Add current_virtual_host_.Clear()

* Correct the clear statement
reviewable/pr25395/r2
Lidi Zheng 4 years ago committed by GitHub
parent f99a08fe46
commit 3cef9d3302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc

@ -732,6 +732,7 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
} }
route_config_name_ = std::move(listener.route_config_name); route_config_name_ = std::move(listener.route_config_name);
if (!route_config_name_.empty()) { if (!route_config_name_.empty()) {
current_virtual_host_.routes.clear();
auto watcher = absl::make_unique<RouteConfigWatcher>(Ref()); auto watcher = absl::make_unique<RouteConfigWatcher>(Ref());
route_config_watcher_ = watcher.get(); route_config_watcher_ = watcher.get();
xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher)); xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
@ -741,6 +742,10 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
if (route_config_name_.empty()) { if (route_config_name_.empty()) {
GPR_ASSERT(current_listener_.rds_update.has_value()); GPR_ASSERT(current_listener_.rds_update.has_value());
OnRouteConfigUpdate(std::move(*current_listener_.rds_update)); OnRouteConfigUpdate(std::move(*current_listener_.rds_update));
} else {
// HCM may contain newer filter config. We need to propagate the update as
// config selector to the channel
GenerateResult();
} }
} }

Loading…
Cancel
Save