Actually run built image

This commit is contained in:
Ferenc Hammerl
2022-09-26 13:57:51 +00:00
parent 3d102fd372
commit a99346d1ab
2 changed files with 7 additions and 3 deletions

View File

@@ -26,8 +26,9 @@ export async function runContainerStep(
): Promise<number> {
if (stepContainer.dockerfile) {
const imagePath = `${generateBuildHandle()}/${generateBuildTag()}`
await containerBuild(stepContainer, imagePath)
throw new Error('Building container actions is not currently supported')
const imageUrl = await containerBuild(stepContainer, imagePath)
// throw new Error('Building container actions is not currently supported')
stepContainer.image = imageUrl
}
let secretName: string | undefined = undefined

View File

@@ -488,11 +488,13 @@ export async function isPodContainerAlpine(
export async function containerBuild(
args: RunContainerStepArgs,
imagePath: string
): Promise<void> {
): Promise<string> {
const cm = registryConfigMap()
const secret = registrySecret()
const ss = registryStatefulSet()
const svc = registryService()
const port = svc?.spec?.ports?.[0]?.nodePort
const registryUri = `localhost:${port}/${imagePath}`
const pod = kanikoPod(args.workingDirectory, imagePath)
await Promise.all([
k8sApi.createNamespacedConfigMap(namespace(), cm),
@@ -522,6 +524,7 @@ export async function containerBuild(
console.log(JSON.stringify(err))
throw err
}
return registryUri
}
async function getCurrentNodeName(): Promise<string> {