timeout adjusted
parent
3db12146a1
commit
3b5b53e0f5
|
|
@ -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) => {
|
catch (error) {
|
||||||
if (error.response.body.reason === `not found`) {
|
cloud_runner_logger_1.default.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
|
||||||
return;
|
throw error;
|
||||||
}
|
|
||||||
cloud_runner_logger_1.default.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
|
|
||||||
});
|
|
||||||
yield promise;
|
|
||||||
// eslint-disable-next-line no-empty
|
|
||||||
}
|
}
|
||||||
catch (_a) { }
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static findPodFromJob(kubeClient, jobName, namespace) {
|
static findPodFromJob(kubeClient, jobName, namespace) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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) => {
|
CloudRunnerLogger.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
|
||||||
if (error.response.body.reason === `not found`) {
|
throw error;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
CloudRunnerLogger.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);
|
|
||||||
});
|
|
||||||
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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue