@@ -108,6 +108,15 @@ export const buildCommand: yargs.CommandModule<
108108
109109 const sandboxIds = await Promise . all (
110110 clusters . map ( async ( { host : cluster , slug } , index ) => {
111+ const clusterApiClient : Client = createClient (
112+ createConfig ( {
113+ baseUrl : BASE_URL ,
114+ headers : {
115+ Authorization : `Bearer ${ API_KEY } ` ,
116+ "x-pitcher-manager-url" : `https://${ cluster } /api/v1` ,
117+ } ,
118+ } )
119+ ) ;
111120 const sdk = new CodeSandbox ( API_KEY , {
112121 baseUrl : BASE_URL ,
113122 headers : {
@@ -126,7 +135,7 @@ export const buildCommand: yargs.CommandModule<
126135
127136 spinner . start ( updateSpinnerMessage ( index , "Creating sandbox..." ) ) ;
128137 sandboxId = await createSandbox ( {
129- apiClient,
138+ apiClient : clusterApiClient ,
130139 shaTag : tag ,
131140 fromSandbox : argv . fromSandbox ,
132141 collectionPath : argv . path ,
@@ -140,10 +149,14 @@ export const buildCommand: yargs.CommandModule<
140149 updateSpinnerMessage ( index , "Starting sandbox..." , sandboxId )
141150 ) ;
142151
143- const startResponse = await startVm ( apiClient , sandboxId , {
152+ const startResponse = await startVm ( clusterApiClient , sandboxId , {
144153 vmTier : VMTier . fromName ( "Micro" ) ,
145154 } ) ;
146- let sandbox = new Sandbox ( sandboxId , apiClient , startResponse ) ;
155+ let sandbox = new Sandbox (
156+ sandboxId ,
157+ clusterApiClient ,
158+ startResponse
159+ ) ;
147160 let session = await sandbox . connect ( ) ;
148161
149162 spinner . start (
0 commit comments