File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,18 @@ class TControlPlaneConfigActor : public NActors::TActorBootstrapped<TControlPlan
65
65
} else {
66
66
TenantInfo.reset (new TTenantInfo (ComputeConfig));
67
67
const auto & mapping = Config.GetMapping ();
68
+ for (const auto & scopeToTenant : mapping.GetScopeToTenantName ()) {
69
+ auto [_, isInserted] = TenantInfo->SubjectMapping [SUBJECT_TYPE_SCOPE].emplace (scopeToTenant.GetKey (), scopeToTenant.GetValue ());
70
+ if (!isInserted) {
71
+ CPC_LOG_E (" Invalid configuation, the scope with the name " << scopeToTenant.GetKey () << " already exists" );
72
+ }
73
+ TenantInfo->TenantMapping .emplace (scopeToTenant.GetValue (), scopeToTenant.GetValue ());
74
+ }
68
75
for (const auto & cloudToTenant : mapping.GetCloudIdToTenantName ()) {
69
- TenantInfo->SubjectMapping [SUBJECT_TYPE_CLOUD].emplace (cloudToTenant.GetKey (), cloudToTenant.GetValue ());
76
+ auto [_, isInserted] = TenantInfo->SubjectMapping [SUBJECT_TYPE_CLOUD].emplace (cloudToTenant.GetKey (), cloudToTenant.GetValue ());
77
+ if (!isInserted) {
78
+ CPC_LOG_E (" Invalid configuation, the cloud with the name " << cloudToTenant.GetKey () << " already exists" );
79
+ }
70
80
TenantInfo->TenantMapping .emplace (cloudToTenant.GetValue (), cloudToTenant.GetValue ());
71
81
}
72
82
for (const auto & commonTenantName : mapping.GetCommonTenantName ()) {
Original file line number Diff line number Diff line change @@ -46,8 +46,14 @@ struct TTenantInfo {
46
46
return pinTenants[MultiHash (cloudId) % pinTenants.size ()];
47
47
}
48
48
49
- auto it = SubjectMapping.find (SUBJECT_TYPE_CLOUD);
50
- auto vTenant = it == SubjectMapping.end () ? " " : it->second .Value (cloudId, " " );
49
+ auto it = SubjectMapping.find (SUBJECT_TYPE_SCOPE);
50
+ auto vTenant = it == SubjectMapping.end () ? " " : it->second .Value (scope, " " );
51
+
52
+ if (!vTenant) {
53
+ auto it = SubjectMapping.find (SUBJECT_TYPE_CLOUD);
54
+ vTenant = it == SubjectMapping.end () ? " " : it->second .Value (cloudId, " " );
55
+ }
56
+
51
57
if (!vTenant && CommonVTenants.size ()) {
52
58
vTenant = CommonVTenants[MultiHash (cloudId) % CommonVTenants.size ()];
53
59
}
Original file line number Diff line number Diff line change 18
18
namespace NFq {
19
19
20
20
constexpr auto SUBJECT_TYPE_CLOUD = " cloud" ;
21
+ constexpr auto SUBJECT_TYPE_SCOPE = " scope" ;
21
22
22
23
// Quota per cloud
23
24
constexpr auto QUOTA_ANALYTICS_COUNT_LIMIT = " yq.analyticsQuery.count" ;
You can’t perform that action at this time.
0 commit comments