mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-18 10:46:43 +00:00
Removed exposing git token for kaniko, removed testing comments, added
wait for kaniko
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user