diff --git a/packages/k8s/src/hooks/run-container-step.ts b/packages/k8s/src/hooks/run-container-step.ts index 3fc1ee6..39b87cf 100644 --- a/packages/k8s/src/hooks/run-container-step.ts +++ b/packages/k8s/src/hooks/run-container-step.ts @@ -10,13 +10,7 @@ import { waitForJobToComplete, waitForPodPhases } from '../k8s' -import { - containerVolumes, - DEFAULT_CONTAINER_ENTRY_POINT, - DEFAULT_CONTAINER_ENTRY_POINT_ARGS, - PodPhase, - writeEntryPointScript -} from '../k8s/utils' +import { containerVolumes, PodPhase } from '../k8s/utils' import { JOB_CONTAINER_NAME } from './constants' export async function runContainerStep( @@ -82,17 +76,13 @@ function createPodSpec( const podContainer = new k8s.V1Container() podContainer.name = JOB_CONTAINER_NAME podContainer.image = container.image - - const { entryPoint, entryPointArgs } = container - container.entryPoint = 'sh' - - const { containerPath } = writeEntryPointScript( - container.workingDirectory, - entryPoint || DEFAULT_CONTAINER_ENTRY_POINT, - entryPoint ? entryPointArgs || [] : DEFAULT_CONTAINER_ENTRY_POINT_ARGS - ) - container.entryPointArgs = ['-e', containerPath] - podContainer.command = [container.entryPoint, ...container.entryPointArgs] + podContainer.workingDir = container.workingDirectory + podContainer.command = container.entryPoint + ? [container.entryPoint] + : undefined + podContainer.args = container.entryPointArgs?.length + ? container.entryPointArgs + : undefined if (secretName) { podContainer.envFrom = [ diff --git a/packages/k8s/tests/run-container-step-test.ts b/packages/k8s/tests/run-container-step-test.ts index 108131b..4b01321 100644 --- a/packages/k8s/tests/run-container-step-test.ts +++ b/packages/k8s/tests/run-container-step-test.ts @@ -23,16 +23,11 @@ describe('Run container step', () => { expect(exitCode).toBe(0) }) - it('should fail if the working directory does not exist', async () => { - runContainerStepData.args.workingDirectory = '/foo/bar' - await expect(runContainerStep(runContainerStepData.args)).rejects.toThrow() - }) - it('should shold have env variables available', async () => { runContainerStepData.args.entryPoint = 'bash' runContainerStepData.args.entryPointArgs = [ '-c', - "'if [[ -z $NODE_ENV ]]; then exit 1; fi'" + 'if [[ -z $NODE_ENV ]]; then exit 1; fi' ] await expect( runContainerStep(runContainerStepData.args)