vendor: update buildkit

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-09-21 07:49:39 +02:00
parent 06541ebd0f
commit 45e4550c36
1040 changed files with 100774 additions and 7915 deletions

View File

@ -6,7 +6,7 @@ import (
"github.com/moby/buildkit/solver/pb"
digest "github.com/opencontainers/go-digest"
specs "github.com/opencontainers/image-spec/specs-go/v1"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
)
@ -21,7 +21,7 @@ type DefinitionOp struct {
defs map[digest.Digest][]byte
metas map[digest.Digest]pb.OpMetadata
sources map[digest.Digest][]*SourceLocation
platforms map[digest.Digest]*specs.Platform
platforms map[digest.Digest]*ocispecs.Platform
dgst digest.Digest
index pb.OutputIndex
inputCache map[digest.Digest][]*DefinitionOp
@ -31,7 +31,7 @@ type DefinitionOp struct {
func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) {
ops := make(map[digest.Digest]*pb.Op)
defs := make(map[digest.Digest][]byte)
platforms := make(map[digest.Digest]*specs.Platform)
platforms := make(map[digest.Digest]*ocispecs.Platform)
var dgst digest.Digest
for _, dt := range def.Def {
@ -43,7 +43,7 @@ func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) {
ops[dgst] = &op
defs[dgst] = dt
var platform *specs.Platform
var platform *ocispecs.Platform
if op.Platform != nil {
spec := op.Platform.Spec()
platform = &spec

View File

@ -9,7 +9,7 @@ import (
"github.com/containerd/containerd/platforms"
"github.com/google/shlex"
"github.com/moby/buildkit/solver/pb"
specs "github.com/opencontainers/image-spec/specs-go/v1"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
)
type contextKeyT string
@ -182,20 +182,20 @@ func shlexf(str string, replace bool, v ...interface{}) StateOption {
}
}
func platform(p specs.Platform) StateOption {
func platform(p ocispecs.Platform) StateOption {
return func(s State) State {
return s.WithValue(keyPlatform, platforms.Normalize(p))
}
}
func getPlatform(s State) func(context.Context, *Constraints) (*specs.Platform, error) {
return func(ctx context.Context, c *Constraints) (*specs.Platform, error) {
func getPlatform(s State) func(context.Context, *Constraints) (*ocispecs.Platform, error) {
return func(ctx context.Context, c *Constraints) (*ocispecs.Platform, error) {
v, err := s.getValue(keyPlatform)(ctx, c)
if err != nil {
return nil, err
}
if v != nil {
p := v.(specs.Platform)
p := v.(ocispecs.Platform)
return &p, nil
}
return nil, nil

View File

@ -4,7 +4,7 @@ import (
"context"
digest "github.com/opencontainers/go-digest"
specs "github.com/opencontainers/image-spec/specs-go/v1"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
)
// WithMetaResolver adds a metadata resolver to an image
@ -29,7 +29,7 @@ type ImageMetaResolver interface {
}
type ResolveImageConfigOpt struct {
Platform *specs.Platform
Platform *ocispecs.Platform
ResolveMode string
LogName string
}

View File

@ -4,7 +4,7 @@ import (
"context"
"github.com/moby/buildkit/solver/pb"
"github.com/opencontainers/go-digest"
digest "github.com/opencontainers/go-digest"
)
type SourceMap struct {

View File

@ -12,7 +12,7 @@ import (
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/apicaps"
digest "github.com/opencontainers/go-digest"
specs "github.com/opencontainers/image-spec/specs-go/v1"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
)
type StateOption func(State) State
@ -48,7 +48,7 @@ type State struct {
func (s State) ensurePlatform() State {
if o, ok := s.out.(interface {
Platform() *specs.Platform
Platform() *ocispecs.Platform
}); ok {
if p := o.Platform(); p != nil {
s = platform(*p)(s)
@ -351,11 +351,11 @@ func (s State) GetHostname(ctx context.Context, co ...ConstraintsOpt) (string, e
return getHostname(s)(ctx, c)
}
func (s State) Platform(p specs.Platform) State {
func (s State) Platform(p ocispecs.Platform) State {
return platform(p)(s)
}
func (s State) GetPlatform(ctx context.Context, co ...ConstraintsOpt) (*specs.Platform, error) {
func (s State) GetPlatform(ctx context.Context, co ...ConstraintsOpt) (*ocispecs.Platform, error) {
c := &Constraints{}
for _, f := range co {
f.SetConstraintsOption(c)
@ -403,7 +403,7 @@ type output struct {
vertex Vertex
getIndex func() (pb.OutputIndex, error)
err error
platform *specs.Platform
platform *ocispecs.Platform
}
func (o *output) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error) {
@ -429,7 +429,7 @@ func (o *output) Vertex(context.Context, *Constraints) Vertex {
return o.vertex
}
func (o *output) Platform() *specs.Platform {
func (o *output) Platform() *ocispecs.Platform {
return o.platform
}
@ -560,7 +560,7 @@ func (cw *constraintsWrapper) applyConstraints(f func(c *Constraints)) {
}
type Constraints struct {
Platform *specs.Platform
Platform *ocispecs.Platform
WorkerConstraints []string
Metadata pb.OpMetadata
LocalUniqueID string
@ -568,7 +568,7 @@ type Constraints struct {
SourceLocations []*SourceLocation
}
func Platform(p specs.Platform) ConstraintsOpt {
func Platform(p ocispecs.Platform) ConstraintsOpt {
return constraintsOptFunc(func(c *Constraints) {
c.Platform = &p
})
@ -581,15 +581,15 @@ func LocalUniqueID(v string) ConstraintsOpt {
}
var (
LinuxAmd64 = Platform(specs.Platform{OS: "linux", Architecture: "amd64"})
LinuxArmhf = Platform(specs.Platform{OS: "linux", Architecture: "arm", Variant: "v7"})
LinuxAmd64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "amd64"})
LinuxArmhf = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v7"})
LinuxArm = LinuxArmhf
LinuxArmel = Platform(specs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"})
LinuxArm64 = Platform(specs.Platform{OS: "linux", Architecture: "arm64"})
LinuxS390x = Platform(specs.Platform{OS: "linux", Architecture: "s390x"})
LinuxPpc64le = Platform(specs.Platform{OS: "linux", Architecture: "ppc64le"})
Darwin = Platform(specs.Platform{OS: "darwin", Architecture: "amd64"})
Windows = Platform(specs.Platform{OS: "windows", Architecture: "amd64"})
LinuxArmel = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"})
LinuxArm64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm64"})
LinuxS390x = Platform(ocispecs.Platform{OS: "linux", Architecture: "s390x"})
LinuxPpc64le = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64le"})
Darwin = Platform(ocispecs.Platform{OS: "darwin", Architecture: "amd64"})
Windows = Platform(ocispecs.Platform{OS: "windows", Architecture: "amd64"})
)
func Require(filters ...string) ConstraintsOpt {