Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/k8s/src/k8s/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
PodPhase,
mergePodSpecWithOptions,
mergeObjectMeta,
useKubeScheduler
useKubeScheduler,
fixArgs
} from './utils'

const kc = new k8s.KubeConfig()
Expand Down Expand Up @@ -226,6 +227,7 @@ export async function execPodStep(
stdin?: stream.Readable
): Promise<void> {
const exec = new k8s.Exec(kc)
command = fixArgs(command)
await new Promise(async function (resolve, reject) {
await exec.exec(
namespace(),
Expand Down
9 changes: 9 additions & 0 deletions packages/k8s/tests/prepare-job-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ describe('Prepare job', () => {
expect(services[0].args).toBe(undefined)
})

it('should determine alpine correctly', async () => {
prepareJobData.args.container.image = 'alpine:latest'
await prepareJob(prepareJobData.args, prepareJobOutputFilePath)
const content = JSON.parse(
fs.readFileSync(prepareJobOutputFilePath).toString()
)
expect(content.isAlpine).toBe(true)
})

it('should run pod with extensions applied', async () => {
process.env[ENV_HOOK_TEMPLATE_PATH] = path.join(
__dirname,
Expand Down