timeout adjusted

pull/437/head
Frostebite 2022-11-01 23:16:12 +00:00
parent 3db12146a1
commit 3b5b53e0f5
3 changed files with 11 additions and 25 deletions

13
dist/index.js vendored
View File

@ -3121,7 +3121,6 @@ class Kubernetes {
yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace); yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
yield this.kubeClient.deleteNamespacedPod(this.podName, this.namespace); yield this.kubeClient.deleteNamespacedPod(this.podName, this.namespace);
yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace); yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
yield new Promise((promise) => setTimeout(promise, 15000));
cloud_runner_logger_1.default.log('cleaned up Secret, Job and Pod'); cloud_runner_logger_1.default.log('cleaned up Secret, Job and Pod');
} }
catch (error) { catch (error) {
@ -3147,18 +3146,12 @@ class Kubernetes {
} }
cloud_runner_logger_1.default.log(`deleting PVC`); cloud_runner_logger_1.default.log(`deleting PVC`);
try { try {
const promise = this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace); yield this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
// eslint-disable-next-line github/no-then
promise.catch((error) => {
if (error.response.body.reason === `not found`) {
return;
} }
catch (error) {
cloud_runner_logger_1.default.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`); cloud_runner_logger_1.default.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
}); throw error;
yield promise;
// eslint-disable-next-line no-empty
} }
catch (_a) { }
}); });
} }
static findPodFromJob(kubeClient, jobName, namespace) { static findPodFromJob(kubeClient, jobName, namespace) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -219,7 +219,6 @@ class Kubernetes implements ProviderInterface {
await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace); await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
await this.kubeClient.deleteNamespacedPod(this.podName, this.namespace); await this.kubeClient.deleteNamespacedPod(this.podName, this.namespace);
await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace); await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
await new Promise((promise) => setTimeout(promise, 15000));
CloudRunnerLogger.log('cleaned up Secret, Job and Pod'); CloudRunnerLogger.log('cleaned up Secret, Job and Pod');
} catch (error: any) { } catch (error: any) {
if (error.response.body.reason === `not found`) { if (error.response.body.reason === `not found`) {
@ -247,17 +246,11 @@ class Kubernetes implements ProviderInterface {
CloudRunnerLogger.log(`deleting PVC`); CloudRunnerLogger.log(`deleting PVC`);
try { try {
const promise = this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace); await this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
// eslint-disable-next-line github/no-then } catch (error: any) {
promise.catch((error: any) => {
if (error.response.body.reason === `not found`) {
return;
}
CloudRunnerLogger.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`); CloudRunnerLogger.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
}); throw error;
await promise; }
// eslint-disable-next-line no-empty
} catch {}
} }
static async findPodFromJob(kubeClient: CoreV1Api, jobName: string, namespace: string) { static async findPodFromJob(kubeClient: CoreV1Api, jobName: string, namespace: string) {