Skip to content

Commit

Permalink
chore: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twelvemo committed Jun 24, 2024
1 parent 13d93d3 commit 8a9b299
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/container/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async function buildContainerLocally({
Your local docker daemon does not support building multi-platform images.
If you are using Docker Desktop, you can turn on the experimental containerd image store.
To build multi-platform images locally with other local docker platforms,
you can add custom docker-container buildx builder.
you can add a custom buildx builder of type docker-container.
Learn more at https://docs.docker.com/go/build-multi-platform/
`,
})
Expand Down
19 changes: 1 addition & 18 deletions core/test/integ/src/plugins/container/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ describe("plugins.container", () => {
expect(args.slice(2, 4)).to.eql(["--build-arg", `GARDEN_ACTION_VERSION=${buildAction.versionString()}`])
})
})

describe("multiPlatformBuilds", () => {
it("should include platform flags", async () => {
const config = cloneDeep(baseConfig)
Expand All @@ -327,23 +328,5 @@ describe("plugins.container", () => {
const args = getDockerBuildFlags(resolvedBuild, ctx.provider.config)
expect(args.slice(-4)).to.eql(["--platform", "linux/amd64", "--platform", "linux/arm64"])
})

it("should set GARDEN_ACTION_VERSION", async () => {
const config = cloneDeep(baseConfig)

const buildAction = await getTestBuild(config)

const resolvedBuild = await garden.resolveAction({
action: buildAction,
log,
graph: await garden.getConfigGraph({ log, emit: false }),
})

const args = getDockerBuildFlags(resolvedBuild, ctx.provider.config)

// Also module version is set for backwards compatability
expect(args.slice(0, 2)).to.eql(["--build-arg", `GARDEN_MODULE_VERSION=${buildAction.versionString()}`])
expect(args.slice(2, 4)).to.eql(["--build-arg", `GARDEN_ACTION_VERSION=${buildAction.versionString()}`])
})
})
})

0 comments on commit 8a9b299

Please sign in to comment.