mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to b124b0c3
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
8
vendor/github.com/moby/buildkit/client/build.go
generated
vendored
8
vendor/github.com/moby/buildkit/client/build.go
generated
vendored
@ -44,7 +44,13 @@ func (c *Client) Build(ctx context.Context, opt SolveOpt, product string, buildF
|
||||
})
|
||||
}
|
||||
|
||||
cb := func(ref string, s *session.Session) error {
|
||||
cb := func(ref string, s *session.Session, opts map[string]string) error {
|
||||
for k, v := range opts {
|
||||
if feOpts == nil {
|
||||
feOpts = map[string]string{}
|
||||
}
|
||||
feOpts[k] = v
|
||||
}
|
||||
gwClient := c.gatewayClientForBuild(ref)
|
||||
g, err := grpcclient.New(ctx, feOpts, s.ID(), product, gwClient, gworkers)
|
||||
if err != nil {
|
||||
|
13
vendor/github.com/moby/buildkit/client/solve.go
generated
vendored
13
vendor/github.com/moby/buildkit/client/solve.go
generated
vendored
@ -75,7 +75,7 @@ func (c *Client) Solve(ctx context.Context, def *llb.Definition, opt SolveOpt, s
|
||||
return c.solve(ctx, def, nil, opt, statusChan)
|
||||
}
|
||||
|
||||
type runGatewayCB func(ref string, s *session.Session) error
|
||||
type runGatewayCB func(ref string, s *session.Session, opts map[string]string) error
|
||||
|
||||
func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runGatewayCB, opt SolveOpt, statusChan chan *SolveStatus) (*SolveResponse, error) {
|
||||
if def != nil && runGateway != nil {
|
||||
@ -109,7 +109,7 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
||||
}
|
||||
}
|
||||
|
||||
cacheOpt, err := parseCacheOptions(ctx, opt)
|
||||
cacheOpt, err := parseCacheOptions(ctx, runGateway != nil, opt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -171,6 +171,9 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
||||
}
|
||||
|
||||
for k, v := range cacheOpt.frontendAttrs {
|
||||
if opt.FrontendAttrs == nil {
|
||||
opt.FrontendAttrs = map[string]string{}
|
||||
}
|
||||
opt.FrontendAttrs[k] = v
|
||||
}
|
||||
|
||||
@ -225,7 +228,7 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
|
||||
|
||||
if runGateway != nil {
|
||||
eg.Go(func() error {
|
||||
err := runGateway(ref, s)
|
||||
err := runGateway(ref, s, opt.FrontendAttrs)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@ -386,7 +389,7 @@ type cacheOptions struct {
|
||||
frontendAttrs map[string]string
|
||||
}
|
||||
|
||||
func parseCacheOptions(ctx context.Context, opt SolveOpt) (*cacheOptions, error) {
|
||||
func parseCacheOptions(ctx context.Context, isGateway bool, opt SolveOpt) (*cacheOptions, error) {
|
||||
var (
|
||||
cacheExports []*controlapi.CacheOptionsEntry
|
||||
cacheImports []*controlapi.CacheOptionsEntry
|
||||
@ -471,7 +474,7 @@ func parseCacheOptions(ctx context.Context, opt SolveOpt) (*cacheOptions, error)
|
||||
})
|
||||
}
|
||||
}
|
||||
if opt.Frontend != "" {
|
||||
if opt.Frontend != "" || isGateway {
|
||||
// use legacy API for registry importers, because the frontend might not support the new API
|
||||
if len(legacyImportRefs) > 0 {
|
||||
frontendAttrs["cache-from"] = strings.Join(legacyImportRefs, ",")
|
||||
|
Reference in New Issue
Block a user