Skip to content

Commit

Permalink
fix(warehouse): control plane client needs to be initialized for mast…
Browse files Browse the repository at this point in the history
…er mode (#2826)
  • Loading branch information
achettyiitr committed Dec 21, 2022
1 parent dfc4b23 commit 5ad7ee7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions warehouse/warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -2189,13 +2189,6 @@ func Start(ctx context.Context, app app.App) error {
reporting.AddClient(ctx, types.Config{ConnInfo: psqlInfo, ClientName: types.WAREHOUSE_REPORTING_CLIENT})
return nil
}))
region := config.GetString("region", "")

controlPlaneClient = controlplane.NewClient(
backendconfig.GetConfigBackendURL(),
backendconfig.DefaultBackendConfig.Identity(),
controlplane.WithRegion(region),
)
}

if isStandAlone() && isMaster() {
Expand All @@ -2206,7 +2199,7 @@ func Start(ctx context.Context, app app.App) error {
backendconfig.DefaultBackendConfig.WaitForConfig(ctx)

c := controlplane.NewClient(
config.GetString("CONFIG_BACKEND_URL", "https://api.rudderstack.com"),
backendconfig.GetConfigBackendURL(),
backendconfig.DefaultBackendConfig.Identity(),
)

Expand All @@ -2232,6 +2225,14 @@ func Start(ctx context.Context, app app.App) error {

backendconfig.DefaultBackendConfig.WaitForConfig(ctx)

region := config.GetString("region", "")

controlPlaneClient = controlplane.NewClient(
backendconfig.GetConfigBackendURL(),
backendconfig.DefaultBackendConfig.Identity(),
controlplane.WithRegion(region),
)

tenantManager = &multitenant.Manager{
BackendConfig: backendconfig.DefaultBackendConfig,
}
Expand Down

0 comments on commit 5ad7ee7

Please sign in to comment.