mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-14 08:36:45 +00:00
prepare job in k8s does not allow for no job container
This commit is contained in:
@@ -25,6 +25,10 @@ export async function prepareJob(
|
|||||||
args: prepareJobArgs,
|
args: prepareJobArgs,
|
||||||
responseFile
|
responseFile
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
if (!args.container) {
|
||||||
|
throw new Error('Job Container is required.')
|
||||||
|
}
|
||||||
|
|
||||||
await prunePods()
|
await prunePods()
|
||||||
if (!(await isAuthPermissionsOK())) {
|
if (!(await isAuthPermissionsOK())) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ describe('Prepare job', () => {
|
|||||||
).rejects.toThrow()
|
).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should run prepare job without the job container', async () => {
|
it('should not run prepare job without the job container', async () => {
|
||||||
prepareJobData.args.container = undefined
|
prepareJobData.args.container = undefined
|
||||||
await expect(
|
await expect(
|
||||||
prepareJob(prepareJobData.args, prepareJobOutputFilePath)
|
prepareJob(prepareJobData.args, prepareJobOutputFilePath)
|
||||||
).resolves.not.toThrow()
|
).rejects.toThrow()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user