Skip to content

Commit

Permalink
fix(k8s): ensure images built remotely are tagged before publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 authored and edvald committed Jul 12, 2019
1 parent 4013335 commit 63a2bba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions garden-service/src/plugins/kubernetes/container/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { containerHelpers } from "../../container/helpers"
import { KubernetesPluginContext } from "../config"
import { publishContainerModule } from "../../container/publish"
import { getRegistryPortForward } from "./util"
import execa = require("execa")

export async function k8sPublishContainerModule(params: PublishModuleParams<ContainerModule>) {
const { ctx, module, log } = params
Expand Down Expand Up @@ -41,7 +40,11 @@ export async function k8sPublishContainerModule(params: PublishModuleParams<Cont
host: `local.app.garden:${fwd.localPort}`,
})

await execa("docker", ["pull", pullImageName])
await containerHelpers.dockerCli(module, ["pull", pullImageName])

// We need to tag the remote image with the local ID before we publish it
const localId = await containerHelpers.getLocalImageId(module)
await containerHelpers.dockerCli(module, ["tag", pullImageName, localId])
}

return publishContainerModule(params)
Expand Down

0 comments on commit 63a2bba

Please sign in to comment.