Skip to content

build: restore BuildOptions.Version for selecting the builder#667

Open
amitmishra11 wants to merge 1 commit into
ory:v4from
amitmishra11:fix/v4-buildkit-support
Open

build: restore BuildOptions.Version for selecting the builder#667
amitmishra11 wants to merge 1 commit into
ory:v4from
amitmishra11:fix/v4-buildkit-support

Conversation

@amitmishra11

Copy link
Copy Markdown

This PR was written primarily by Claude Code; I reviewed the change and ran the build test suite against a local Docker daemon before submitting.

Problem

v3's BuildOptions had a Version field controlling which builder the daemon uses ("1" for classic, "2" for BuildKit, added in #416). That field is missing from v4's BuildOptions, even though the underlying mobyclient.ImageBuildOptions (used internally) already has an equivalent Version build.BuilderVersion field. The v4 rewrite (#631) just never carried it over.

Fix

  • Added Version string back to BuildOptions (build.go), matching v3's field name, type, and doc comment.
  • Passed it through as build.BuilderVersion(buildOpts.Version) to imageBuildOpts.Version.

Testing

  • Added TestBuildAndRunWithBuildKit, which builds and runs an image with Version: "2" set, following the same pattern as the existing TestBuildAndRun* tests.
  • Ran the full TestBuild* suite against a local Docker daemon: all 6 tests pass, including the new one.
  • go build ./..., go vet ./... clean.

Fixes #663

v3's BuildOptions had a Version field ("1" for classic, "2" for
BuildKit) that was dropped during the v4 moby client rewrite, even
though the underlying client.ImageBuildOptions already supports it.
Add it back and pass it through.

Fixes ory#663

This PR was written primarily by Claude Code; I reviewed the change
and ran the build test suite against a local Docker daemon before
submitting.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cd00bef2-e8af-457e-acde-be979ed45a30

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

CLAassistant commented Jun 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@amitmishra11
amitmishra11 changed the base branch from master to v4 June 28, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v4 does not support buildkit

2 participants