@_xtribe/cli 1.0.0-beta.10 → 1.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/install-tribe.js +32 -3
- package/package.json +1 -1
package/install-tribe.js
CHANGED
|
@@ -410,9 +410,16 @@ async function startColimaWithKubernetes() {
|
|
|
410
410
|
env: { ...process.env, PATH: `${binDir}:${process.env.PATH}` }
|
|
411
411
|
});
|
|
412
412
|
|
|
413
|
-
// Verify it's working
|
|
413
|
+
// Verify it's working and set context
|
|
414
414
|
const kubectlPath = await findCommand('kubectl') || 'kubectl';
|
|
415
415
|
execSync(`${kubectlPath} version --client`, { stdio: 'ignore' });
|
|
416
|
+
|
|
417
|
+
// Set kubectl context to colima
|
|
418
|
+
try {
|
|
419
|
+
execSync(`${kubectlPath} config use-context colima`, { stdio: 'ignore' });
|
|
420
|
+
} catch {
|
|
421
|
+
// Context might not exist yet, that's OK
|
|
422
|
+
}
|
|
416
423
|
spinner.succeed('Colima started with Kubernetes');
|
|
417
424
|
return true;
|
|
418
425
|
} catch (error) {
|
|
@@ -460,8 +467,30 @@ async function deployTribeCluster() {
|
|
|
460
467
|
TRIBE_DEPLOYMENT_YAML: destYaml
|
|
461
468
|
};
|
|
462
469
|
|
|
463
|
-
//
|
|
464
|
-
|
|
470
|
+
// Wait for Kubernetes API to be ready
|
|
471
|
+
spinner.text = 'Waiting for Kubernetes API server...';
|
|
472
|
+
let apiReady = false;
|
|
473
|
+
for (let i = 0; i < 30; i++) {
|
|
474
|
+
try {
|
|
475
|
+
const kubectlPath = await findCommand('kubectl') || 'kubectl';
|
|
476
|
+
execSync(`${kubectlPath} cluster-info`, {
|
|
477
|
+
stdio: 'ignore',
|
|
478
|
+
env: env
|
|
479
|
+
});
|
|
480
|
+
apiReady = true;
|
|
481
|
+
break;
|
|
482
|
+
} catch {
|
|
483
|
+
// Wait 2 seconds and try again
|
|
484
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (!apiReady) {
|
|
489
|
+
spinner.warn('Kubernetes API server not ready, deployment may fail');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Execute tribe start
|
|
493
|
+
execSync(`${tribePath} start`, {
|
|
465
494
|
stdio: 'pipe',
|
|
466
495
|
env: env
|
|
467
496
|
});
|