diff --git a/cmd/buildctl/build.go b/cmd/buildctl/build.go index 815f9158ca851..c321042caa3e4 100644 --- a/cmd/buildctl/build.go +++ b/cmd/buildctl/build.go @@ -127,11 +127,11 @@ func read(r io.Reader, clicontext *cli.Context) (*llb.Definition, error) { dgst := digest.FromBytes(dt) opMetadata, ok := def.Metadata[dgst] if !ok { - opMetadata = pb.OpMetadata{} + opMetadata = &pb.OpMetadata{} } - c := llb.Constraints{Metadata: opMetadata} + c := llb.Constraints{Metadata: *opMetadata} llb.IgnoreCache(&c) - def.Metadata[dgst] = c.Metadata + def.Metadata[dgst] = &c.Metadata } } return def, nil diff --git a/cmd/buildctl/debug/dumpllb.go b/cmd/buildctl/debug/dumpllb.go index 7ae6b9d9acfd3..2d339c15b3c03 100644 --- a/cmd/buildctl/debug/dumpllb.go +++ b/cmd/buildctl/debug/dumpllb.go @@ -75,7 +75,7 @@ func loadLLB(r io.Reader) ([]llbOp, error) { return nil, errors.Wrap(err, "failed to parse op") } dgst := digest.FromBytes(dt) - ent := llbOp{Op: op, Digest: dgst, OpMetadata: def.Metadata[dgst]} + ent := llbOp{Op: op, Digest: dgst, OpMetadata: *def.Metadata[dgst]} ops = append(ops, ent) } return ops, nil