Catch errors and always cleanup
parent
bec61120bd
commit
148569023b
|
|
@ -943,11 +943,16 @@ class Kubernetes {
|
|||
job.spec.backoffLimit = 1;
|
||||
yield this.kubeClientBatch.createNamespacedJob(this.namespace, job);
|
||||
core.info('Job created');
|
||||
// watch
|
||||
yield Kubernetes.watchPersistentVolumeClaimUntilReady();
|
||||
yield Kubernetes.watchBuildJobUntilFinished();
|
||||
// cleanup
|
||||
yield Kubernetes.cleanup();
|
||||
try {
|
||||
yield Kubernetes.watchPersistentVolumeClaimUntilReady();
|
||||
yield Kubernetes.watchBuildJobUntilFinished();
|
||||
}
|
||||
catch (error) {
|
||||
core.error(error);
|
||||
}
|
||||
finally {
|
||||
yield Kubernetes.cleanup();
|
||||
}
|
||||
});
|
||||
}
|
||||
static runCloneJob() {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -230,12 +230,14 @@ class Kubernetes {
|
|||
await this.kubeClientBatch.createNamespacedJob(this.namespace, job);
|
||||
core.info('Job created');
|
||||
|
||||
// watch
|
||||
await Kubernetes.watchPersistentVolumeClaimUntilReady();
|
||||
await Kubernetes.watchBuildJobUntilFinished();
|
||||
|
||||
// cleanup
|
||||
await Kubernetes.cleanup();
|
||||
try {
|
||||
await Kubernetes.watchPersistentVolumeClaimUntilReady();
|
||||
await Kubernetes.watchBuildJobUntilFinished();
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
} finally {
|
||||
await Kubernetes.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
static async runCloneJob() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue