Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(k8s): ensure images built remotely are tagged before publishing #961

Merged
merged 2 commits into from
Jul 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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