Removed exposing git token for kaniko, removed testing comments, added

wait for kaniko
This commit is contained in:
Nikola Jokic
2022-09-29 16:03:15 +02:00
parent 02f00d0fd5
commit 365a99a4de
3 changed files with 8 additions and 9 deletions

View File

@@ -474,7 +474,15 @@ export async function containerBuild(
): Promise<string> {
const registryUri = `localhost:${registryNodePort()}/${imagePath}`
const pod = kanikoPod(args.dockerfile, imagePath)
if (!pod.metadata?.name) {
throw new Error('kaniko pod name is not set')
}
await k8sApi.createNamespacedPod(namespace(), pod)
await waitForPodPhases(
pod.metadata.name,
new Set([PodPhase.SUCCEEDED]),
new Set([PodPhase.PENDING, PodPhase.UNKNOWN, PodPhase.RUNNING])
)
return registryUri
}

View File

@@ -50,12 +50,6 @@ export function kanikoPod(
readOnly: true
}
]
c.env = [
{
name: 'GIT_TOKEN',
value: process.env.GITHUB_TOKEN
}
]
c.args = [
`--dockerfile=${path.basename(dockerfile)}`,
`--context=dir://${KANIKO_MOUNT_PATH}`,

View File

@@ -56,9 +56,6 @@ describe('run container step with docker build', () => {
const { registryName, registryPort, nodePort } =
await testHelper.createContainerRegistry()
// process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_HOST = 'docker-registry'
// process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_PORT = '5000'
// process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_NODE_PORT = '31500'
process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_HOST = registryName
process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_PORT = registryPort.toString()
process.env.RUNNER_CONTAINER_HOOKS_REGISTRY_NODE_PORT = nodePort.toString()