Skip to content

Commit

Permalink
add kind cluster cleanup to error scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
sotojn committed Jul 25, 2024
1 parent 415672a commit 3cb46c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/scripts/src/helpers/k8s-env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ export async function launchK8sEnv(options: K8sEnvOptions) {
const { stdout } = await execa('docker', ['run', e2eImage, 'node', '-v']);
imageVersion = stdout;
} catch (err) {
await kind.destroyCluster();
throw new Error(`Problem running docker command to check node version: ${err}`);
}
if (process.version !== imageVersion) {
throw new Error(`The node version this process is running on (${process.version}) does not match
signale.fatal(`The node version this process is running on (${process.version}) does not match
the version set in k8s-env image (${imageVersion}). Check your version by running "node -v"`);
await kind.destroyCluster();
process.exit(1);
}
signale.info(`Running yarn setup with node ${process.version}...`);
try {
Expand Down

0 comments on commit 3cb46c8

Please sign in to comment.