test retain workspace first

pull/437/head
Frostebite 2022-11-02 19:25:02 +00:00
parent 146b50ae1d
commit 6bcb5f2bdc
3 changed files with 4 additions and 3 deletions

2
dist/index.js vendored
View File

@ -3070,7 +3070,7 @@ class Kubernetes {
cloud_runner_logger_1.default.log('Pod running, streaming logs'); cloud_runner_logger_1.default.log('Pod running, streaming logs');
output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace); output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace);
const pods = (yield this.kubeClient.listNamespacedPod(this.namespace)).body.items.filter((x) => { var _a; return this.podName === ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name); }); const pods = (yield this.kubeClient.listNamespacedPod(this.namespace)).body.items.filter((x) => { var _a; return this.podName === ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name); });
const running = pods.length > 0 && ((_a = pods[0].status) === null || _a === void 0 ? void 0 : _a.phase) !== `Running` && ((_b = pods[0].status) === null || _b === void 0 ? void 0 : _b.phase) !== `Pending`; const running = pods.length > 0 && (((_a = pods[0].status) === null || _a === void 0 ? void 0 : _a.phase) === `Running` || ((_b = pods[0].status) === null || _b === void 0 ? void 0 : _b.phase) === `Pending`);
if (!running) { if (!running) {
cloud_runner_logger_1.default.log('Pod not found, assumed ended!'); cloud_runner_logger_1.default.log('Pod not found, assumed ended!');
break; break;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -152,7 +152,8 @@ class Kubernetes implements ProviderInterface {
const pods = (await this.kubeClient.listNamespacedPod(this.namespace)).body.items.filter( const pods = (await this.kubeClient.listNamespacedPod(this.namespace)).body.items.filter(
(x) => this.podName === x.metadata?.name, (x) => this.podName === x.metadata?.name,
); );
const running = pods.length > 0 && pods[0].status?.phase !== `Running` && pods[0].status?.phase !== `Pending`; const running =
pods.length > 0 && (pods[0].status?.phase === `Running` || pods[0].status?.phase === `Pending`);
if (!running) { if (!running) {
CloudRunnerLogger.log('Pod not found, assumed ended!'); CloudRunnerLogger.log('Pod not found, assumed ended!');