avoid policy dependency from builder loading - #3998
Open
crazy-max wants to merge 1 commit into
Open
Conversation
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
crazy-max
marked this pull request as ready for review
August 5, 2026 10:55
thaJeztah
reviewed
Aug 5, 2026
| called := false | ||
|
|
||
| pinned, applied, err := VerifyImageRef(context.Background(), nopSubLogger{}, "moby/buildkit@"+dgst.String(), nil, nil, func(_ context.Context, _ string, _ *ocispecs.Platform, _ policy.SourceMetadataResolver) (digest.Digest, error) { | ||
| pinned, applied, err := VerifyImageRef(context.Background(), nopSubLogger{}, "moby/buildkit@"+dgst.String(), nil, nil, func(_ context.Context, _ string, _ *ocispecs.Platform, _ *sourcemeta.Resolver) (digest.Digest, error) { |
Member
There was a problem hiding this comment.
If we're breaking the api / signature, perhaps as a follow-up also look if we need all these arguments to be positional arguments or if it could be an option-struct or variadic functional args.
thaJeztah
approved these changes
Aug 5, 2026
thaJeztah
left a comment
Member
There was a problem hiding this comment.
LGTM
worth checking if this requires changes in compose, or if it doesn't use this code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change stops
builder.LoadNodesfrom constructing the default policy verifier itself, so consumers of thebuilderpackage no longer pull in the policy package and its OPA dependency graph.The builder package now accepts an optional image verifier through
WithImageVerifier, and command paths that may boot or use builder images pass the default policy verifier explicitly. The default verifier construction stays in the policy package.The default policy is runtime opt-in, but the previous unconditional import made downstream users vendor OPA and the signature verification stack even when they did not use policy support. This keeps the buildx CLI behavior while restoring a lighter dependency boundary for builder and driver consumers.