Skip to content

Commit

Permalink
fix(publish): copy image from registry if it has been pushed directly…
Browse files Browse the repository at this point in the history
… after build (#6681)
  • Loading branch information
twelvemo authored Nov 26, 2024
1 parent 95a00b0 commit 405940e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/plugins/kubernetes/container/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ export const k8sPublishContainerBuild: BuildActionHandler<"publish", ContainerBu
const localImageId = action.getOutput("localImageId")
const deploymentRegistryImageId = action.getOutput("deploymentImageId")
const remoteImageId = containerHelpers.getPublicImageId(action, tagOverride)
const dockerBuildExtraFlags = action.getSpec("extraFlags")

// For in-cluster building or cloud builder, use regctl to copy the image.
// This does not require to pull the image locally.
if (provider.config.buildMode !== "local-docker" || cloudBuilderConfigured) {
if (
provider.config.buildMode !== "local-docker" ||
cloudBuilderConfigured ||
dockerBuildExtraFlags?.includes("--push")
) {
const regctlCopyCommand = ["image", "copy", deploymentRegistryImageId, remoteImageId]
log.info({ msg: `Publishing image ${remoteImageId}` })
await containerHelpers.regctlCli({ cwd: action.getBuildPath(), args: regctlCopyCommand, log, ctx })
Expand Down

0 comments on commit 405940e

Please sign in to comment.