policy: add strict policy config support
Strict policy will fail if remote daemon doesn't support policy verification. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@@ -359,6 +359,11 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt *O
|
||||
Config: cfg,
|
||||
})
|
||||
cbs = append(cbs, p.CheckPolicy)
|
||||
if popt.Strict {
|
||||
if bopts.LLBCaps.Supports(pb.CapSourcePolicySession) != nil {
|
||||
return nil, nil, errors.New("strict policy is not supported by the current BuildKit daemon, please upgrade to version v0.27+")
|
||||
}
|
||||
}
|
||||
}
|
||||
so.SourcePolicyProvider = policysession.NewPolicyProvider(policy.MultiPolicyCallback(cbs...))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user