You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2019/12/16 12:27:03 UTC

[GitHub] [incubator-pagespeed-mod] sambhajis-gdb commented on a change in pull request #1969: Integration of envoy fetcher in pagespeed

sambhajis-gdb commented on a change in pull request #1969: Integration of envoy fetcher in pagespeed
URL: https://github.com/apache/incubator-pagespeed-mod/pull/1969#discussion_r358205858
 
 

 ##########
 File path: pagespeed/envoy/envoy_cluster_manager.cc
 ##########
 @@ -107,13 +109,38 @@ void EnvoyClusterManager::initClusterManager() {
       dispatcher_->createDnsResolver({}), *ssl_context_manager_, *dispatcher_, *local_info_,
       secret_manager_, validation_context_, *api_, http_context_, *access_log_manager_,
       *singleton_manager_);
+}
 
-  Envoy::MessageUtil::loadFromFile(
-      "pagespeed/envoy/cluster.yaml",
-      bootstrap, Envoy::ProtobufMessage::getStrictValidationVisitor(), *api_);
-
-  cluster_manager_ = cluster_manager_factory_->clusterManagerFromProto(bootstrap);
+Envoy::Upstream::ClusterManager&
+EnvoyClusterManager::getClusterManager(const GoogleString str_url_) {
+  UriImpl uri(str_url_);
+  try {
+    uri.resolve(*dispatcher_, Envoy::Network::DnsLookupFamily::Auto);
+  } catch (UriException) {
+    // TODO : Error Handling.
+    std::cout << "UriException \n";
+    std::cout.flush();
+  }
+  cluster_manager_ =
+      cluster_manager_factory_->clusterManagerFromProto(createBootstrapConfiguration(uri));
   cluster_manager_->setInitializedCb([this]() -> void { init_manager_.initialize(init_watcher_); });
+  return *cluster_manager_;
+}
+
+const envoy::config::bootstrap::v2::Bootstrap
+EnvoyClusterManager::createBootstrapConfiguration(const Uri& uri) const {
 
 Review comment:
   used hardcoded argument i.e. Host, Port, and Scheme and pass it to createBootstrapConfiguration()
   code pushed in https://github.com/apache/incubator-pagespeed-mod/pull/1969/commits/4ab87afdc150b403bcef176c8f4934e8f4ba18d1
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services