Skip to content

Commit

Permalink
Merge pull request #5143 from Ignas/pass-cache-imports-to-solve
Browse files Browse the repository at this point in the history
Pass cache imports from solve ptions to solve request
  • Loading branch information
jedevc authored Jul 16, 2024
2 parents 7401054 + bf0ff2e commit 8f4aa21
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 8f4aa21

Please sign in to comment.