فهرست منبع

Merge pull request #47582 from vvoland/vendor-buildkit-0.13.1

vendor: github.com/moby/buildkit v0.13.1
Sebastiaan van Stijn 1 سال پیش
والد
کامیت
23e1af45c6

+ 1 - 1
vendor.mod

@@ -60,7 +60,7 @@ require (
 	github.com/miekg/dns v1.1.57
 	github.com/miekg/dns v1.1.57
 	github.com/mistifyio/go-zfs/v3 v3.0.1
 	github.com/mistifyio/go-zfs/v3 v3.0.1
 	github.com/mitchellh/copystructure v1.2.0
 	github.com/mitchellh/copystructure v1.2.0
-	github.com/moby/buildkit v0.13.0
+	github.com/moby/buildkit v0.13.1
 	github.com/moby/docker-image-spec v1.3.1
 	github.com/moby/docker-image-spec v1.3.1
 	github.com/moby/ipvs v1.1.0
 	github.com/moby/ipvs v1.1.0
 	github.com/moby/locker v1.0.1
 	github.com/moby/locker v1.0.1

+ 2 - 2
vendor.sum

@@ -476,8 +476,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
 github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
 github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
 github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
 github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
 github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
 github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
-github.com/moby/buildkit v0.13.0 h1:reVR1Y+rbNIUQ9jf0Q1YZVH5a/nhOixZsl+HJ9qQEGI=
-github.com/moby/buildkit v0.13.0/go.mod h1:aNmNQKLBFYAOFuzQjR3VA27/FijlvtBD1pjNwTSN37k=
+github.com/moby/buildkit v0.13.1 h1:L8afOFhPq2RPJJSr/VyzbufwID7jquZVB7oFHbPRcPE=
+github.com/moby/buildkit v0.13.1/go.mod h1:aNmNQKLBFYAOFuzQjR3VA27/FijlvtBD1pjNwTSN37k=
 github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
 github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
 github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
 github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
 github.com/moby/ipvs v1.1.0 h1:ONN4pGaZQgAx+1Scz5RvWV4Q7Gb+mvfRh3NsPS+1XQQ=
 github.com/moby/ipvs v1.1.0 h1:ONN4pGaZQgAx+1Scz5RvWV4Q7Gb+mvfRh3NsPS+1XQQ=

+ 9 - 0
vendor/github.com/moby/buildkit/cache/remotecache/v1/chains.go

@@ -122,6 +122,8 @@ type DescriptorProviderPair struct {
 	Provider   content.Provider
 	Provider   content.Provider
 }
 }
 
 
+var _ withCheckDescriptor = DescriptorProviderPair{}
+
 func (p DescriptorProviderPair) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
 func (p DescriptorProviderPair) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
 	return p.Provider.ReaderAt(ctx, desc)
 	return p.Provider.ReaderAt(ctx, desc)
 }
 }
@@ -156,6 +158,13 @@ func (p DescriptorProviderPair) SnapshotLabels(descs []ocispecs.Descriptor, inde
 	return nil
 	return nil
 }
 }
 
 
+func (p DescriptorProviderPair) CheckDescriptor(ctx context.Context, desc ocispecs.Descriptor) error {
+	if cd, ok := p.Provider.(withCheckDescriptor); ok {
+		return cd.CheckDescriptor(ctx, desc)
+	}
+	return nil
+}
+
 // item is an implementation of a record in the cache chain. After validation,
 // item is an implementation of a record in the cache chain. After validation,
 // normalization and marshalling into the cache config, the item results form
 // normalization and marshalling into the cache config, the item results form
 // into the "layers", while the digests and the links form into the "records".
 // into the "layers", while the digests and the links form into the "records".

+ 6 - 3
vendor/github.com/moby/buildkit/cache/remotecache/v1/utils.go

@@ -12,6 +12,11 @@ import (
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 )
 )
 
 
+type withCheckDescriptor interface {
+	// CheckDescriptor is additional method on Provider to check if the descriptor is available without opening the reader
+	CheckDescriptor(context.Context, ocispecs.Descriptor) error
+}
+
 // sortConfig sorts the config structure to make sure it is deterministic
 // sortConfig sorts the config structure to make sure it is deterministic
 func sortConfig(cc *CacheConfig) {
 func sortConfig(cc *CacheConfig) {
 	type indexedLayer struct {
 	type indexedLayer struct {
@@ -279,9 +284,7 @@ func marshalRemote(ctx context.Context, r *solver.Remote, state *marshalState) s
 		return ""
 		return ""
 	}
 	}
 
 
-	if cd, ok := r.Provider.(interface {
-		CheckDescriptor(context.Context, ocispecs.Descriptor) error
-	}); ok && len(r.Descriptors) > 0 {
+	if cd, ok := r.Provider.(withCheckDescriptor); ok && len(r.Descriptors) > 0 {
 		for _, d := range r.Descriptors {
 		for _, d := range r.Descriptors {
 			if cd.CheckDescriptor(ctx, d) != nil {
 			if cd.CheckDescriptor(ctx, d) != nil {
 				return ""
 				return ""

+ 6 - 2
vendor/github.com/moby/buildkit/executor/oci/spec.go

@@ -2,6 +2,7 @@ package oci
 
 
 import (
 import (
 	"context"
 	"context"
+	"os"
 	"path"
 	"path"
 	"path/filepath"
 	"path/filepath"
 	"runtime"
 	"runtime"
@@ -197,8 +198,11 @@ func GenerateSpec(ctx context.Context, meta executor.Meta, mounts []executor.Mou
 	}
 	}
 
 
 	if tracingSocket != "" {
 	if tracingSocket != "" {
-		if mount := getTracingSocketMount(tracingSocket); mount != nil {
-			s.Mounts = append(s.Mounts, *mount)
+		// moby/buildkit#4764
+		if _, err := os.Stat(tracingSocket); err == nil {
+			if mount := getTracingSocketMount(tracingSocket); mount != nil {
+				s.Mounts = append(s.Mounts, *mount)
+			}
 		}
 		}
 	}
 	}
 
 

+ 4 - 2
vendor/github.com/moby/buildkit/solver/llbsolver/solver.go

@@ -125,8 +125,10 @@ func New(opt Opt) (*Solver, error) {
 
 
 func (s *Solver) Close() error {
 func (s *Solver) Close() error {
 	s.solver.Close()
 	s.solver.Close()
-	err := s.sysSampler.Close()
-	return err
+	if s.sysSampler != nil {
+		return s.sysSampler.Close()
+	}
+	return nil
 }
 }
 
 
 func (s *Solver) resolver() solver.ResolveOpFunc {
 func (s *Solver) resolver() solver.ResolveOpFunc {

+ 3 - 1
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go

@@ -57,7 +57,9 @@ func ParseGitRef(ref string) (*GitRef, error) {
 		err    error
 		err    error
 	)
 	)
 
 
-	if strings.HasPrefix(ref, "github.com/") {
+	if strings.HasPrefix(ref, "./") || strings.HasPrefix(ref, "../") {
+		return nil, errdefs.ErrInvalidArgument
+	} else if strings.HasPrefix(ref, "github.com/") {
 		res.IndistinguishableFromLocal = true // Deprecated
 		res.IndistinguishableFromLocal = true // Deprecated
 		remote = fromURL(&url.URL{
 		remote = fromURL(&url.URL{
 			Scheme: "https",
 			Scheme: "https",

+ 1 - 1
vendor/modules.txt

@@ -702,7 +702,7 @@ github.com/mitchellh/hashstructure/v2
 # github.com/mitchellh/reflectwalk v1.0.2
 # github.com/mitchellh/reflectwalk v1.0.2
 ## explicit
 ## explicit
 github.com/mitchellh/reflectwalk
 github.com/mitchellh/reflectwalk
-# github.com/moby/buildkit v0.13.0
+# github.com/moby/buildkit v0.13.1
 ## explicit; go 1.21
 ## explicit; go 1.21
 github.com/moby/buildkit/api/services/control
 github.com/moby/buildkit/api/services/control
 github.com/moby/buildkit/api/types
 github.com/moby/buildkit/api/types