fix: k8s stability

pull/437/head
Frostebite 2022-11-02 00:16:01 +00:00
parent 82ad5a7fa8
commit ceedd5808a
3 changed files with 9 additions and 9 deletions

8
dist/index.js vendored
View File

@ -3070,15 +3070,15 @@ class Kubernetes {
yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
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);
if (!(yield this.kubeClientBatch.listNamespacedJob(this.namespace)).body.items
if (!(yield this.kubeClient.listNamespacedPod(this.namespace)).body.items
.map((x) => { var _a; return ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || undefined; })
.filter((x) => x !== undefined)
.includes(this.jobName)) {
cloud_runner_logger_1.default.log('Job not found, assumed ended!');
.includes(this.podName)) {
cloud_runner_logger_1.default.log('Pod not found, assumed ended!');
break;
}
else {
cloud_runner_logger_1.default.log('Job still running, recovering stream...');
cloud_runner_logger_1.default.log('Pod still running, recovering stream...');
}
}
catch (error) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -152,15 +152,15 @@ class Kubernetes implements ProviderInterface {
this.namespace,
);
if (
!(await this.kubeClientBatch.listNamespacedJob(this.namespace)).body.items
!(await this.kubeClient.listNamespacedPod(this.namespace)).body.items
.map((x) => x.metadata?.name || undefined)
.filter((x) => x !== undefined)
.includes(this.jobName)
.includes(this.podName)
) {
CloudRunnerLogger.log('Job not found, assumed ended!');
CloudRunnerLogger.log('Pod not found, assumed ended!');
break;
} else {
CloudRunnerLogger.log('Job still running, recovering stream...');
CloudRunnerLogger.log('Pod still running, recovering stream...');
}
} catch (error: any) {
CloudRunnerLogger.log('error running k8s workflow');