@@ -469,9 +469,39 @@ struct TCommonAppOptions {
469469 ConfigUpdateTracer.AddUpdate (NKikimrConsole::TConfigItem::InterconnectConfigItem, TConfigItemInfo::EUpdateKind::UpdateExplicitly);
470470 }
471471
472- if (appConfig.HasGRpcConfig () && appConfig.GetGRpcConfig ().HasCert ()) {
473- appConfig.MutableGRpcConfig ()->SetPathToCertificateFile (appConfig.GetGRpcConfig ().GetCert ());
474- ConfigUpdateTracer.AddUpdate (NKikimrConsole::TConfigItem::GRpcConfigItem, TConfigItemInfo::EUpdateKind::UpdateExplicitly);
472+ if (appConfig.HasGRpcConfig ()) {
473+ if (appConfig.GetGRpcConfig ().HasCert ()) {
474+ appConfig.MutableGRpcConfig ()->SetPathToCertificateFile (appConfig.GetGRpcConfig ().GetCert ());
475+ ConfigUpdateTracer.AddUpdate (NKikimrConsole::TConfigItem::GRpcConfigItem, TConfigItemInfo::EUpdateKind::UpdateExplicitly);
476+ }
477+ if (appConfig.GetGRpcConfig ().HasXdsBootstrap ()) {
478+ auto * xdsBootstrapConfig = appConfig.MutableGRpcConfig ()->MutableXdsBootstrap ();
479+ if (xdsBootstrapConfig->GetNode ().GetId ().empty ()) {
480+ xdsBootstrapConfig->MutableNode ()->SetId (env.FQDNHostName ());
481+ ConfigUpdateTracer.AddUpdate (NKikimrConsole::TConfigItem::GRpcConfigItem, TConfigItemInfo::EUpdateKind::UpdateExplicitly);
482+ }
483+ if (xdsBootstrapConfig->GetNode ().GetLocality ().GetZone ().empty ()) {
484+ TString dataCenter;
485+ if (DataCenter) {
486+ dataCenter = to_lower (DataCenter.GetRef ());
487+ } else if (appConfig.HasNameserviceConfig ()) {
488+ for (const auto & node : appConfig.GetNameserviceConfig ().GetNode ()) {
489+ if (node.GetNodeId () == NodeId) {
490+ if (node.HasLocation ()) {
491+ dataCenter = to_lower (node.GetLocation ().GetDataCenter ());
492+ } else if (node.HasWalleLocation ()) {
493+ dataCenter = to_lower (node.GetWalleLocation ().GetDataCenter ());
494+ }
495+ break ;
496+ }
497+ }
498+ }
499+ if (!dataCenter.empty ()) {
500+ xdsBootstrapConfig->MutableNode ()->MutableLocality ()->SetZone (dataCenter);
501+ ConfigUpdateTracer.AddUpdate (NKikimrConsole::TConfigItem::GRpcConfigItem, TConfigItemInfo::EUpdateKind::UpdateExplicitly);
502+ }
503+ }
504+ }
475505 }
476506
477507 if (!GrpcSslSettings.PathToGrpcCertFile .empty ()) {
0 commit comments