Skip to content

Commit d3ec1c0

Browse files
committed
prepare job in k8s does not allow for no job container
1 parent 3e04b45 commit d3ec1c0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/k8s/src/hooks/prepare-job.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export async function prepareJob(
2525
args: prepareJobArgs,
2626
responseFile
2727
): Promise<void> {
28+
if (!args.container) {
29+
throw new Error('Job Container is required.')
30+
}
31+
2832
await prunePods()
2933
if (!(await isAuthPermissionsOK())) {
3034
throw new Error(

packages/k8s/tests/prepare-job-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ describe('Prepare job', () => {
6969
).rejects.toThrow()
7070
})
7171

72-
it('should run prepare job without the job container', async () => {
72+
it('should not run prepare job without the job container', async () => {
7373
prepareJobData.args.container = undefined
7474
await expect(
7575
prepareJob(prepareJobData.args, prepareJobOutputFilePath)
76-
).resolves.not.toThrow()
76+
).rejects.toThrow()
7777
})
7878
})

0 commit comments

Comments
 (0)