do not wait for job deletion

pull/273/head
Frostebite 2021-06-26 04:44:32 +01:00
parent 764bf7cd83
commit e320fc14ad
4 changed files with 1 additions and 16 deletions

6
dist/index.js vendored
View File

@ -1276,7 +1276,6 @@ 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 {
@ -1355,10 +1354,6 @@ class Kubernetes {
try {
yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
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 (error) {
core.info('Failed to cleanup, error:');
@ -1556,7 +1551,6 @@ class KubernetesJobSpecFactory {
};
job.spec = {
backoffLimit: 0,
ttlSecondsAfterFinished: 300,
template: {
spec: {
volumes: [

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,6 @@ 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';
@ -134,13 +133,6 @@ class Kubernetes implements RemoteBuilderProviderInterface {
try {
await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);
await waitUntil(
async () => (await this.kubeClientBatch.readNamespacedJob(this.jobName, this.namespace)).body === null,
{
timeout: 500000,
intervalBetweenAttempts: 15000,
},
);
} catch (error) {
core.info('Failed to cleanup, error:');
core.error(JSON.stringify(error, undefined, 4));

View File

@ -83,7 +83,6 @@ class KubernetesJobSpecFactory {
};
job.spec = {
backoffLimit: 0,
ttlSecondsAfterFinished: 300,
template: {
spec: {
volumes: [