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