Skip to content

Commit 972f40a

Browse files
committed
fixup! Support for passing through raw buildkit policies
Signed-off-by: Justin Chadwell <[email protected]>
1 parent 2ddd8a3 commit 972f40a

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

build/build.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
429429
CacheExports: cacheTo,
430430
CacheImports: cacheFrom,
431431
AllowedEntitlements: opt.Allow,
432+
SourcePolicy: opt.SourcePolicy,
432433
}
433434

434435
if opt.CgroupParent != "" {
@@ -476,13 +477,6 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
476477
}
477478
}
478479

479-
if so.SourcePolicy == nil {
480-
so.SourcePolicy, err = ReadSourcePolicy()
481-
if err != nil {
482-
return nil, nil, err
483-
}
484-
}
485-
486480
switch len(opt.Exports) {
487481
case 1:
488482
// valid

controller/build/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build
136136

137137
opts.Attests = controllerapi.CreateAttestations(in.Attests)
138138

139+
opts.SourcePolicy = in.SourcePolicy
140+
139141
allow, err := buildflags.ParseEntitlements(in.Allow)
140142
if err != nil {
141143
return nil, nil, err

0 commit comments

Comments
 (0)