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