mirror of
https://github.com/moby/moby.git
synced 2026-08-10 17:15:06 +00:00
vendor: update buildkit to v0.13.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1289519b03)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
6a1fb46d48
commit
44c8cd2e8f
@@ -62,7 +62,7 @@ require (
|
||||
github.com/miekg/dns v1.1.66
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1
|
||||
github.com/mitchellh/copystructure v1.2.0
|
||||
github.com/moby/buildkit v0.23.0-rc1
|
||||
github.com/moby/buildkit v0.23.0-rc2
|
||||
github.com/moby/docker-image-spec v1.3.1
|
||||
github.com/moby/go-archive v0.1.0
|
||||
github.com/moby/ipvs v1.1.0
|
||||
|
||||
@@ -384,8 +384,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
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/moby/buildkit v0.23.0-rc1 h1:RIAEITsycLbXUt//rEPEfZUFnKUcm1cvpuWOfOidiWU=
|
||||
github.com/moby/buildkit v0.23.0-rc1/go.mod h1:v5jMDvQgUyidk3wu3NvVAAd5JJo83nfet9Gf/o0+EAQ=
|
||||
github.com/moby/buildkit v0.23.0-rc2 h1:LJIyp/w3/yzVKXngKnkvBw3mvsoE2HkvjAk4+RIBcX8=
|
||||
github.com/moby/buildkit v0.23.0-rc2/go.mod h1:v5jMDvQgUyidk3wu3NvVAAd5JJo83nfet9Gf/o0+EAQ=
|
||||
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/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
|
||||
|
||||
29
vendor/github.com/moby/buildkit/util/resolver/pool.go
generated
vendored
29
vendor/github.com/moby/buildkit/util/resolver/pool.go
generated
vendored
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/containerd/containerd/v2/core/images"
|
||||
"github.com/containerd/containerd/v2/core/remotes"
|
||||
"github.com/containerd/containerd/v2/core/remotes/docker"
|
||||
cerrdefs "github.com/containerd/errdefs"
|
||||
distreference "github.com/distribution/reference"
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/solver/pb"
|
||||
@@ -225,7 +226,7 @@ func (r *Resolver) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, er
|
||||
// Resolve attempts to resolve the reference into a name and descriptor.
|
||||
func (r *Resolver) Resolve(ctx context.Context, ref string) (string, ocispecs.Descriptor, error) {
|
||||
if r.mode == ResolveModePreferLocal && r.is != nil {
|
||||
if img, err := r.is.Get(ctx, ref); err == nil {
|
||||
if img, err := getImageByRef(ctx, r.is, ref); err == nil {
|
||||
return ref, img.Target, nil
|
||||
}
|
||||
}
|
||||
@@ -237,7 +238,7 @@ func (r *Resolver) Resolve(ctx context.Context, ref string) (string, ocispecs.De
|
||||
}
|
||||
|
||||
if r.mode == ResolveModeDefault && r.is != nil {
|
||||
if img, err := r.is.Get(ctx, ref); err == nil {
|
||||
if img, err := getImageByRef(ctx, r.is, ref); err == nil {
|
||||
return ref, img.Target, nil
|
||||
}
|
||||
}
|
||||
@@ -245,6 +246,30 @@ func (r *Resolver) Resolve(ctx context.Context, ref string) (string, ocispecs.De
|
||||
return "", ocispecs.Descriptor{}, err
|
||||
}
|
||||
|
||||
func getImageByRef(ctx context.Context, is images.Store, ref string) (images.Image, error) {
|
||||
named, err := distreference.ParseNormalizedNamed(ref)
|
||||
if err != nil {
|
||||
return images.Image{}, err
|
||||
}
|
||||
|
||||
name := named.Name()
|
||||
tag := "latest"
|
||||
if t, ok := named.(distreference.Tagged); ok {
|
||||
tag = t.Tag()
|
||||
}
|
||||
name = name + ":" + tag
|
||||
img, err := is.Get(ctx, name)
|
||||
if err != nil {
|
||||
return images.Image{}, err
|
||||
}
|
||||
if c, ok := named.(distreference.Canonical); ok {
|
||||
if img.Target.Digest != c.Digest() {
|
||||
return images.Image{}, errors.WithStack(cerrdefs.ErrNotFound)
|
||||
}
|
||||
}
|
||||
return img, nil
|
||||
}
|
||||
|
||||
type ResolveMode int
|
||||
|
||||
const (
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -757,7 +757,7 @@ github.com/mitchellh/hashstructure/v2
|
||||
# github.com/mitchellh/reflectwalk v1.0.2
|
||||
## explicit
|
||||
github.com/mitchellh/reflectwalk
|
||||
# github.com/moby/buildkit v0.23.0-rc1
|
||||
# github.com/moby/buildkit v0.23.0-rc2
|
||||
## explicit; go 1.23.0
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
|
||||
Reference in New Issue
Block a user