catch setup resource errors

pull/273/head
Frostebite 2021-06-26 03:00:49 +01:00
parent aa15eda155
commit 4384dbfb25
3 changed files with 43 additions and 41 deletions

4
dist/index.js vendored
View File

@ -1411,6 +1411,7 @@ class KubernetesCleanupCronJob {
}); });
} }
static createCleanupCronJob(kubeClientBatch, name, namespace) { static createCleanupCronJob(kubeClientBatch, name, namespace) {
return __awaiter(this, void 0, void 0, function* () {
try { try {
const batchJob = new client_node_1.V1beta1CronJob(); const batchJob = new client_node_1.V1beta1CronJob();
batchJob.kind = 'CronJob'; batchJob.kind = 'CronJob';
@ -1448,11 +1449,12 @@ class KubernetesCleanupCronJob {
}, },
}, },
}; };
kubeClientBatch.createNamespacedCronJob(namespace, batchJob); yield kubeClientBatch.createNamespacedCronJob(namespace, batchJob);
} }
catch (error) { catch (error) {
throw error; throw error;
} }
});
} }
} }
exports.default = KubernetesCleanupCronJob; exports.default = KubernetesCleanupCronJob;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ class KubernetesCleanupCronJob {
static async cleanup(api: BatchV1beta1Api, name: string, namespace: string) { static async cleanup(api: BatchV1beta1Api, name: string, namespace: string) {
await api.deleteNamespacedCronJob('name', namespace); await api.deleteNamespacedCronJob('name', namespace);
} }
static createCleanupCronJob(kubeClientBatch: BatchV1beta1Api, name: string, namespace: string) { static async createCleanupCronJob(kubeClientBatch: BatchV1beta1Api, name: string, namespace: string) {
try { try {
const batchJob = new V1beta1CronJob(); const batchJob = new V1beta1CronJob();
batchJob.kind = 'CronJob'; batchJob.kind = 'CronJob';
@ -43,7 +43,7 @@ class KubernetesCleanupCronJob {
}, },
}; };
kubeClientBatch.createNamespacedCronJob(namespace, batchJob); await kubeClientBatch.createNamespacedCronJob(namespace, batchJob);
} catch (error) { } catch (error) {
throw error; throw error;
} }