Skip to content

Commit

Permalink
Pass cache imports from solve ptions to solve request
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignas committed Jul 10, 2024
1 parent 5b5afdb commit 28bb5dc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/buildctl/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/cmd/buildctl/build"
bccommon "github.com/moby/buildkit/cmd/buildctl/common"
"github.com/moby/buildkit/frontend"
gateway "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/identity"
"github.com/moby/buildkit/session"
Expand Down Expand Up @@ -363,6 +364,15 @@ func buildAction(clicontext *cli.Context) error {
Frontend: solveOpt.Frontend,
FrontendOpt: solveOpt.FrontendAttrs,
}

sreq.CacheImports = make([]frontend.CacheOptionsEntry, len(solveOpt.CacheImports))
for i, e := range solveOpt.CacheImports {
sreq.CacheImports[i] = frontend.CacheOptionsEntry{
Type: e.Type,
Attrs: e.Attrs,
}
}

if def != nil {
sreq.Definition = def.ToPB()
}
Expand Down

0 comments on commit 28bb5dc

Please sign in to comment.