vendor: update buildkit to 539be170

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2021-12-15 22:09:13 -08:00
parent 59533bbb5c
commit 9c3be32bc9
581 changed files with 24648 additions and 16682 deletions

View File

@ -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 {