mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 539be170
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
25
vendor/github.com/moby/buildkit/client/llb/marshal.go
generated
vendored
25
vendor/github.com/moby/buildkit/client/llb/marshal.go
generated
vendored
@ -12,9 +12,10 @@ import (
|
||||
// Definition is the LLB definition structure with per-vertex metadata entries
|
||||
// Corresponds to the Definition structure defined in solver/pb.Definition.
|
||||
type Definition struct {
|
||||
Def [][]byte
|
||||
Metadata map[digest.Digest]pb.OpMetadata
|
||||
Source *pb.Source
|
||||
Def [][]byte
|
||||
Metadata map[digest.Digest]pb.OpMetadata
|
||||
Source *pb.Source
|
||||
Constraints *Constraints
|
||||
}
|
||||
|
||||
func (def *Definition) ToPB() *pb.Definition {
|
||||
@ -38,6 +39,24 @@ func (def *Definition) FromPB(x *pb.Definition) {
|
||||
}
|
||||
}
|
||||
|
||||
func (def *Definition) Head() (digest.Digest, error) {
|
||||
if len(def.Def) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
last := def.Def[len(def.Def)-1]
|
||||
|
||||
var pop pb.Op
|
||||
if err := (&pop).Unmarshal(last); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(pop.Inputs) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return pop.Inputs[0].Digest, nil
|
||||
}
|
||||
|
||||
func WriteTo(def *Definition, w io.Writer) error {
|
||||
b, err := def.ToPB().Marshal()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user