From 886ae21e938c0c6cab4d8dd5e681f62c0a13295b Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:49:31 +0200 Subject: [PATCH] build: don't generate local state for subrequests Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- build/localstate.go | 2 +- commands/bake.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build/localstate.go b/build/localstate.go index f6bd1f71..1c8f51e9 100644 --- a/build/localstate.go +++ b/build/localstate.go @@ -11,7 +11,7 @@ import ( func saveLocalState(so *client.SolveOpt, target string, opts Options, node builder.Node, cfg *confutil.Config) error { var err error - if so.Ref == "" { + if so.Ref == "" || opts.CallFunc != nil { return nil } lp := opts.Inputs.ContextPath diff --git a/commands/bake.go b/commands/bake.go index d5105df8..95fdcea5 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -464,12 +464,18 @@ func saveLocalStateGroup(dockerCli command.Cli, in bakeOptions, targets []string groupRef := identity.NewID() refs := make([]string, 0, len(bo)) for k, b := range bo { + if b.CallFunc != nil { + continue + } b.Ref = identity.NewID() b.GroupRef = groupRef b.ProvenanceResponseMode = prm refs = append(refs, b.Ref) bo[k] = b } + if len(refs) == 0 { + return nil + } l, err := localstate.New(confutil.NewConfig(dockerCli)) if err != nil { return err