Fix: log all pvc info

pull/273/head
Frostebite 2021-06-18 23:20:04 +01:00
parent 2718db7a0f
commit 70e4968320
3 changed files with 20 additions and 7 deletions

13
dist/index.js vendored
View File

@ -1545,6 +1545,7 @@ class Kubernetes {
yield this.cleanup();
}
catch (error) {
core.info('Running job failed');
yield this.cleanup();
throw error;
}
@ -1653,9 +1654,15 @@ class Kubernetes {
cleanup() {
return __awaiter(this, void 0, void 0, function* () {
core.info('cleaning up');
yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
yield this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
try {
yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
yield this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
}
catch (error) {
core.info('Failed to cleanup');
core.error(JSON.stringify(error, undefined, 4));
}
});
}
static uuidv4() {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -329,6 +329,7 @@ class Kubernetes implements RemoteBuilderProviderInterface {
await this.streamLogs();
await this.cleanup();
} catch (error) {
core.info('Running job failed');
await this.cleanup();
throw error;
}
@ -436,9 +437,14 @@ class Kubernetes implements RemoteBuilderProviderInterface {
async cleanup() {
core.info('cleaning up');
await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
await this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
try {
await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
await this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);
await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
} catch (error) {
core.info('Failed to cleanup');
core.error(JSON.stringify(error, undefined, 4));
}
}
static uuidv4() {