do not wait for job deletion
parent
e320fc14ad
commit
d4fc646184
|
|
@ -1276,6 +1276,7 @@ const kubernetes_storage_1 = __importDefault(__webpack_require__(38941));
|
|||
const kubernetes_logging_1 = __importDefault(__webpack_require__(37290));
|
||||
const kubernetes_secret_1 = __importDefault(__webpack_require__(35129));
|
||||
const kubernetes_utils_1 = __importDefault(__webpack_require__(92040));
|
||||
const async_wait_until_1 = __importDefault(__webpack_require__(41299));
|
||||
const kubernetes_job_spec_factory_1 = __importDefault(__webpack_require__(17203));
|
||||
const kubernetes_cleanup_cronjob_1 = __importDefault(__webpack_require__(82974));
|
||||
class Kubernetes {
|
||||
|
|
@ -1361,6 +1362,15 @@ class Kubernetes {
|
|||
core.info('Abandoning cleanup, build error:');
|
||||
throw error;
|
||||
}
|
||||
try {
|
||||
yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () { return (yield this.kubeClientBatch.readNamespacedJob(this.jobName, this.namespace)).body === null; }), {
|
||||
timeout: 500000,
|
||||
intervalBetweenAttempts: 15000,
|
||||
});
|
||||
}
|
||||
catch (_a) {
|
||||
core.info('failed to read the state of the job while cleaning up?');
|
||||
}
|
||||
});
|
||||
}
|
||||
cleanupSharedBuildResources(
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -8,6 +8,7 @@ import RemoteBuilderEnvironmentVariable from './remote-builder-environment-varia
|
|||
import KubernetesLogging from './kubernetes-logging';
|
||||
import KubernetesSecret from './kubernetes-secret';
|
||||
import KubernetesUtilities from './kubernetes-utils';
|
||||
import waitUntil from 'async-wait-until';
|
||||
import KubernetesJobSpecFactory from './kubernetes-job-spec-factory';
|
||||
import KubernetesCleanupCronJob from './kubernetes-cleanup-cronjob';
|
||||
|
||||
|
|
@ -139,6 +140,17 @@ class Kubernetes implements RemoteBuilderProviderInterface {
|
|||
core.info('Abandoning cleanup, build error:');
|
||||
throw error;
|
||||
}
|
||||
try {
|
||||
await waitUntil(
|
||||
async () => (await this.kubeClientBatch.readNamespacedJob(this.jobName, this.namespace)).body === null,
|
||||
{
|
||||
timeout: 500000,
|
||||
intervalBetweenAttempts: 15000,
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
core.info('failed to read the state of the job while cleaning up?');
|
||||
}
|
||||
}
|
||||
|
||||
async cleanupSharedBuildResources(
|
||||
|
|
|
|||
Loading…
Reference in New Issue