vendor: github.com/moby/buildkit v0.26.3

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit c63bf203bf)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2025-12-16 14:21:57 -06:00
committed by Paweł Gronowski
parent fbf3ed25f8
commit 8ebb104e36
5 changed files with 61 additions and 50 deletions

2
go.mod
View File

@@ -56,7 +56,7 @@ require (
github.com/miekg/dns v1.1.66
github.com/mistifyio/go-zfs/v3 v3.1.0
github.com/mitchellh/copystructure v1.2.0
github.com/moby/buildkit v0.26.2
github.com/moby/buildkit v0.26.3
github.com/moby/docker-image-spec v1.3.1
github.com/moby/go-archive v0.1.0
github.com/moby/ipvs v1.1.0

4
go.sum
View File

@@ -417,8 +417,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/moby/buildkit v0.26.2 h1:EIh5j0gzRsCZmQzvgNNWzSDbuKqwUIiBH7ssqLv8RU8=
github.com/moby/buildkit v0.26.2/go.mod h1:ylDa7IqzVJgLdi/wO7H1qLREFQpmhFbw2fbn4yoTw40=
github.com/moby/buildkit v0.26.3 h1:D+ruZVAk/3ipRq5XRxBH9/DIFpRjSlTtMbghT5gQP9g=
github.com/moby/buildkit v0.26.3/go.mod h1:4T4wJzQS4kYWIfFRjsbJry4QoxDBjK+UGOEOs1izL7w=
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=

View File

@@ -653,43 +653,7 @@ func (lbf *llbBridgeForwarder) ResolveSourceMeta(ctx context.Context, req *pb.Re
if err != nil {
return nil, err
}
r := &pb.ResolveSourceMetaResponse{
Source: resp.Op,
}
if resp.Image != nil {
r.Image = &pb.ResolveSourceImageResponse{
Digest: string(resp.Image.Digest),
Config: resp.Image.Config,
}
if resp.Image.AttestationChain != nil {
r.Image.AttestationChain = toPBAttestationChain(resp.Image.AttestationChain)
}
}
if resp.Git != nil {
r.Git = &pb.ResolveSourceGitResponse{
Checksum: resp.Git.Checksum,
Ref: resp.Git.Ref,
CommitChecksum: resp.Git.CommitChecksum,
CommitObject: resp.Git.CommitObject,
TagObject: resp.Git.TagObject,
}
}
if resp.HTTP != nil {
var lastModified *timestamp.Timestamp
if resp.HTTP.LastModified != nil {
lastModified = &timestamp.Timestamp{
Seconds: resp.HTTP.LastModified.Unix(),
}
}
r.HTTP = &pb.ResolveSourceHTTPResponse{
Checksum: resp.HTTP.Digest.String(),
Filename: resp.HTTP.Filename,
LastModified: lastModified,
}
}
return r, nil
return ToPBResolveSourceMetaResponse(resp), nil
}
func (lbf *llbBridgeForwarder) ResolveImageConfig(ctx context.Context, req *pb.ResolveImageConfigRequest) (*pb.ResolveImageConfigResponse, error) {
@@ -1705,6 +1669,45 @@ func getCaps(label string) map[string]struct{} {
return out
}
func ToPBResolveSourceMetaResponse(in *sourceresolver.MetaResponse) *pb.ResolveSourceMetaResponse {
r := &pb.ResolveSourceMetaResponse{
Source: in.Op,
}
if in.Image != nil {
r.Image = &pb.ResolveSourceImageResponse{
Digest: string(in.Image.Digest),
Config: in.Image.Config,
}
if in.Image.AttestationChain != nil {
r.Image.AttestationChain = toPBAttestationChain(in.Image.AttestationChain)
}
}
if in.Git != nil {
r.Git = &pb.ResolveSourceGitResponse{
Checksum: in.Git.Checksum,
Ref: in.Git.Ref,
CommitChecksum: in.Git.CommitChecksum,
CommitObject: in.Git.CommitObject,
TagObject: in.Git.TagObject,
}
}
if in.HTTP != nil {
var lastModified *timestamp.Timestamp
if in.HTTP.LastModified != nil {
lastModified = &timestamp.Timestamp{
Seconds: in.HTTP.LastModified.Unix(),
}
}
r.HTTP = &pb.ResolveSourceHTTPResponse{
Checksum: in.HTTP.Digest.String(),
Filename: in.HTTP.Filename,
LastModified: lastModified,
}
}
return r
}
func toPBAttestationChain(ac *sourceresolver.AttestationChain) *pb.AttestationChain {
if ac == nil {
return nil

View File

@@ -5,6 +5,7 @@ import (
"strings"
"github.com/moby/buildkit/client/llb/sourceresolver"
"github.com/moby/buildkit/frontend/gateway"
gatewaypb "github.com/moby/buildkit/frontend/gateway/pb"
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/sourcepolicy"
@@ -88,19 +89,26 @@ func (p *policyEvaluator) Evaluate(ctx context.Context, op *pb.Op) (bool, error)
Platform: toOCIPlatform(metareq.Platform),
}
}
if metareq.Image != nil {
if op.ImageOpt == nil {
op.ImageOpt = &sourceresolver.ResolveImageOpt{}
}
op.ImageOpt.NoConfig = metareq.Image.NoConfig
op.ImageOpt.AttestationChain = metareq.Image.AttestationChain
}
if metareq.Git != nil {
op.GitOpt = &sourceresolver.ResolveGitOpt{
ReturnObject: metareq.Git.ReturnObject,
}
}
resp, err := p.resolveSourceMetadata(ctx, metareq.Source, op, false)
if err != nil {
return false, errors.Wrap(err, "error resolving source metadata from policy request")
}
req.Source = &gatewaypb.ResolveSourceMetaResponse{
Source: resp.Op,
}
if resp.Image != nil {
req.Source.Image = &gatewaypb.ResolveSourceImageResponse{
Digest: resp.Image.Digest.String(),
Config: resp.Image.Config,
}
}
req.Source = gateway.ToPBResolveSourceMetaResponse(resp)
continue
}

2
vendor/modules.txt vendored
View File

@@ -838,7 +838,7 @@ github.com/mitchellh/hashstructure/v2
# github.com/mitchellh/reflectwalk v1.0.2
## explicit
github.com/mitchellh/reflectwalk
# github.com/moby/buildkit v0.26.2
# github.com/moby/buildkit v0.26.3
## explicit; go 1.24.3
github.com/moby/buildkit/api/services/control
github.com/moby/buildkit/api/types