Skip to content

Commit 7914209

Browse files
cluster fix
1 parent 765ca90 commit 7914209

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bin/commands/build.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ export const buildCommand: yargs.CommandModule<
149149
updateSpinnerMessage(index, "Starting sandbox...", sandboxId)
150150
);
151151

152+
// This is a hack, we need to tell the global scheduler that the VM is running
153+
// in a different cluster than the one it'd like to default to.
154+
const baseUrl = apiClient
155+
.getConfig()
156+
.baseUrl?.replace("api", "global-scheduler");
157+
158+
await fetch(
159+
`${baseUrl}/api/v1/cluster/${sandboxId}?preferredManager=${cluster}`
160+
).then((res) => res.json());
161+
152162
const startResponse = await startVm(clusterApiClient, sandboxId, {
153163
vmTier: VMTier.fromName("Micro"),
154164
});

0 commit comments

Comments
 (0)