diff --git a/client/client_test.go b/client/client_test.go index 140fd2ab73a1..b73fffb915dd 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -250,6 +250,7 @@ var allTests = []func(t *testing.T, sb integration.Sandbox){ testHTTPResolveMetaReuse, testHTTPResolveMultiBuild, testGitResolveMutatedSource, + testImageResolveAttestationChainRequiresNetwork, } func TestIntegration(t *testing.T) { @@ -12249,6 +12250,92 @@ func testHTTPResolveSourceMetadata(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) } +func testImageResolveAttestationChainRequiresNetwork(t *testing.T, sb integration.Sandbox) { + // this test temporarily requires direct registry access as the integration test + // mirroring system does not support mirroring attestation chains yet. + // Support is coming in future buildx release. + ctx := sb.Context() + c, err := New(ctx, sb.Address()) + require.NoError(t, err) + defer c.Close() + + amd64, err := platforms.Parse("linux/amd64") + require.NoError(t, err) + + _, err = c.Build(ctx, SolveOpt{}, "test", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) { + const rootDigest = "sha256:4e91099af134f4b1f509fecbd1a55981dfff18d8029d6782e28413210ef468b7" + const imageDigest = "sha256:d2f0b39234a66c3d58f24200d3fda9e4e3d2263c09f9b7286a826ab639713047" + const attestationDigest = "sha256:fb4c46b14f52d1bf790f593921c52dddc698fc6780792fb8469fc60efc0e609b" + const sigDigest = "sha256:bd0a6b088440ba9838e8eec79e736128fe52afce934578eae30ca8675f6d3142" + + id := "registry-1-stage.docker.io/docker/github-builder-test@" + rootDigest + md, err := c.ResolveSourceMetadata(ctx, &pb.SourceOp{ + Identifier: "docker-image://" + id, + }, sourceresolver.Opt{ + ImageOpt: &sourceresolver.ResolveImageOpt{ + NoConfig: true, + AttestationChain: true, + Platform: &amd64, + }, + }) + if err != nil { + return nil, err + } + require.Equal(t, rootDigest, md.Image.Digest.String()) + require.Nil(t, md.Image.Config) + require.NotNil(t, md.Image) + require.NotNil(t, md.Image.AttestationChain) + ac := md.Image.AttestationChain + require.Equal(t, rootDigest, ac.Root.String()) + require.Equal(t, imageDigest, ac.ImageManifest.String()) + require.Equal(t, attestationDigest, ac.AttestationManifest.String()) + require.Len(t, ac.SignatureManifests, 1) + require.Equal(t, sigDigest, ac.SignatureManifests[0].String()) + + desc := ac.Blobs[ac.Root] + require.Equal(t, rootDigest, desc.Descriptor.Digest.String()) + require.Len(t, desc.Data, int(desc.Descriptor.Size)) + require.Equal(t, ocispecs.MediaTypeImageIndex, desc.Descriptor.MediaType) + chk := digest.FromBytes(desc.Data) + require.Equal(t, rootDigest, chk.String()) + + desc = ac.Blobs[ac.ImageManifest] + // image manifest is expected to be missing as content is not needed to verify attestation chain + _, ok := ac.Blobs[digest.Digest(imageDigest)] + require.False(t, ok) + + desc = ac.Blobs[ac.AttestationManifest] + require.Equal(t, attestationDigest, desc.Descriptor.Digest.String()) + require.Equal(t, ocispecs.MediaTypeImageManifest, desc.Descriptor.MediaType) + require.Len(t, desc.Data, int(desc.Descriptor.Size)) + chk = digest.FromBytes(desc.Data) + require.Equal(t, attestationDigest, chk.String()) + + desc = ac.Blobs[ac.SignatureManifests[0]] + require.Equal(t, sigDigest, desc.Descriptor.Digest.String()) + require.Equal(t, ocispecs.MediaTypeImageManifest, desc.Descriptor.MediaType) + require.Len(t, desc.Data, int(desc.Descriptor.Size)) + chk = digest.FromBytes(desc.Data) + require.Equal(t, sigDigest, chk.String()) + + var sigMfst ocispecs.Manifest + err = json.Unmarshal(ac.Blobs[ac.SignatureManifests[0]].Data, &sigMfst) + require.NoError(t, err) + require.Equal(t, 1, len(sigMfst.Layers)) + sigLayer := sigMfst.Layers[0] + sigDesc := ac.Blobs[digest.Digest(sigLayer.Digest)] + require.Equal(t, sigLayer.Digest, sigDesc.Descriptor.Digest) + require.Len(t, sigDesc.Data, int(sigDesc.Descriptor.Size)) + require.Equal(t, "application/vnd.dev.sigstore.bundle.v0.3+json", sigDesc.Descriptor.MediaType) + chk = digest.FromBytes(sigDesc.Data) + require.Equal(t, sigLayer.Digest, chk) + + require.Len(t, md.Image.AttestationChain.Blobs, 4) + return nil, nil + }, nil) + require.NoError(t, err) +} + func testHTTPPruneAfterCacheKey(t *testing.T, sb integration.Sandbox) { // this test depends on hitting race condition in internal functions. // If debugging and expecting failure you can add small sleep in beginning of source/http.Exec() to hit reliably diff --git a/client/llb/imagemetaresolver/resolver.go b/client/llb/imagemetaresolver/resolver.go index d5bfb1a469a9..6c6436e5901b 100644 --- a/client/llb/imagemetaresolver/resolver.go +++ b/client/llb/imagemetaresolver/resolver.go @@ -86,8 +86,8 @@ func (imr *imageMetaResolver) ResolveImageConfig(ctx context.Context, ref string defer imr.locker.Unlock(ref) platform := imr.platform - if opt.Platform != nil { - platform = opt.Platform + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + platform = imgOpt.Platform } k := imr.key(ref, platform) diff --git a/client/llb/resolver_test.go b/client/llb/resolver_test.go index dba105bb1dc0..c05a711c23e4 100644 --- a/client/llb/resolver_test.go +++ b/client/llb/resolver_test.go @@ -87,8 +87,8 @@ func (r *testResolver) ResolveImageConfig(ctx context.Context, ref string, opt s img.Config.WorkingDir = r.dir - if opt.Platform != nil { - r.platform = platforms.Format(*opt.Platform) + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + r.platform = platforms.Format(*imgOpt.Platform) } dt, err := json.Marshal(img) diff --git a/client/llb/source.go b/client/llb/source.go index fac14e507a65..857ff97bbbd4 100644 --- a/client/llb/source.go +++ b/client/llb/source.go @@ -146,8 +146,8 @@ func Image(ref string, opts ...ImageOption) State { p = c.Platform } _, _, dt, err := info.metaResolver.ResolveImageConfig(ctx, ref, sourceresolver.Opt{ - Platform: p, ImageOpt: &sourceresolver.ResolveImageOpt{ + Platform: p, ResolveMode: info.resolveMode.String(), }, }) @@ -163,8 +163,8 @@ func Image(ref string, opts ...ImageOption) State { p = c.Platform } ref, dgst, dt, err := info.metaResolver.ResolveImageConfig(context.TODO(), ref, sourceresolver.Opt{ - Platform: p, ImageOpt: &sourceresolver.ResolveImageOpt{ + Platform: p, ResolveMode: info.resolveMode.String(), }, }) diff --git a/client/llb/sourceresolver/types.go b/client/llb/sourceresolver/types.go index bcdcf17197b7..82902c640ccc 100644 --- a/client/llb/sourceresolver/types.go +++ b/client/llb/sourceresolver/types.go @@ -24,7 +24,6 @@ type MetaResolver interface { type Opt struct { LogName string SourcePolicies []*spb.Policy - Platform *ocispecs.Platform ImageOpt *ResolveImageOpt OCILayoutOpt *ResolveOCILayoutOpt @@ -40,12 +39,29 @@ type MetaResponse struct { } type ResolveImageOpt struct { - ResolveMode string + Platform *ocispecs.Platform + ResolveMode string + NoConfig bool + AttestationChain bool } type ResolveImageResponse struct { - Digest digest.Digest - Config []byte + Digest digest.Digest + Config []byte + AttestationChain *AttestationChain +} + +type AttestationChain struct { + Root digest.Digest + ImageManifest digest.Digest + AttestationManifest digest.Digest + SignatureManifests []digest.Digest + Blobs map[digest.Digest]Blob +} + +type Blob struct { + Descriptor ocispecs.Descriptor + Data []byte } type ResolveGitOpt struct { @@ -67,7 +83,8 @@ type ResolveHTTPResponse struct { } type ResolveOCILayoutOpt struct { - Store ResolveImageConfigOptStore + Platform *ocispecs.Platform + Store ResolveImageConfigOptStore } type ResolveImageConfigOptStore struct { diff --git a/frontend/dockerfile/dockerfile2llb/convert.go b/frontend/dockerfile/dockerfile2llb/convert.go index e2acee413aa5..c9335cbd9500 100644 --- a/frontend/dockerfile/dockerfile2llb/convert.go +++ b/frontend/dockerfile/dockerfile2llb/convert.go @@ -541,9 +541,9 @@ func toDispatchState(ctx context.Context, dt []byte, opt ConvertOpt) (*dispatchS } prefix += "internal]" mutRef, dgst, dt, err := metaResolver.ResolveImageConfig(ctx, d.stage.BaseName, sourceresolver.Opt{ - LogName: fmt.Sprintf("%s load metadata for %s", prefix, d.stage.BaseName), - Platform: platform, + LogName: fmt.Sprintf("%s load metadata for %s", prefix, d.stage.BaseName), ImageOpt: &sourceresolver.ResolveImageOpt{ + Platform: platform, ResolveMode: opt.ImageResolveMode.String(), }, }) diff --git a/frontend/dockerui/namedcontext.go b/frontend/dockerui/namedcontext.go index 2033b374958b..27aa51c88b06 100644 --- a/frontend/dockerui/namedcontext.go +++ b/frontend/dockerui/namedcontext.go @@ -94,9 +94,9 @@ func (nc *NamedContext) load(ctx context.Context, count int) (*llb.State, *docke named = reference.TagNameOnly(named) ref, dgst, data, err := nc.bc.client.ResolveImageConfig(ctx, named.String(), sourceresolver.Opt{ - LogName: fmt.Sprintf("[context %s] load metadata for %s", nc.nameWithPlatform, ref), - Platform: opt.Platform, + LogName: fmt.Sprintf("[context %s] load metadata for %s", nc.nameWithPlatform, ref), ImageOpt: &sourceresolver.ResolveImageOpt{ + Platform: opt.Platform, ResolveMode: opt.ResolveMode, }, }) @@ -183,9 +183,9 @@ func (nc *NamedContext) load(ctx context.Context, count int) (*llb.State, *docke } _, dgst, data, err := nc.bc.client.ResolveImageConfig(ctx, dummyRef.String(), sourceresolver.Opt{ - LogName: fmt.Sprintf("[context %s] load metadata for %s", nc.nameWithPlatform, dummyRef.String()), - Platform: opt.Platform, + LogName: fmt.Sprintf("[context %s] load metadata for %s", nc.nameWithPlatform, dummyRef.String()), OCILayoutOpt: &sourceresolver.ResolveOCILayoutOpt{ + Platform: opt.Platform, Store: sourceresolver.ResolveImageConfigOptStore{ SessionID: nc.bc.bopts.SessionID, StoreID: named.Name(), diff --git a/frontend/gateway/gateway.go b/frontend/gateway/gateway.go index d58cf444c993..e35adab1f100 100644 --- a/frontend/gateway/gateway.go +++ b/frontend/gateway/gateway.go @@ -631,10 +631,17 @@ func (lbf *llbBridgeForwarder) ResolveSourceMeta(ctx context.Context, req *pb.Re resolveopt := sourceresolver.Opt{ LogName: req.LogName, SourcePolicies: req.SourcePolicies, - Platform: platform, } resolveopt.ImageOpt = &sourceresolver.ResolveImageOpt{ ResolveMode: req.ResolveMode, + Platform: platform, + } + if req.Image != nil { + resolveopt.ImageOpt.NoConfig = req.Image.NoConfig + resolveopt.ImageOpt.AttestationChain = req.Image.AttestationChain + } + resolveopt.OCILayoutOpt = &sourceresolver.ResolveOCILayoutOpt{ + Platform: platform, } if req.Git != nil { resolveopt.GitOpt = &sourceresolver.ResolveGitOpt{ @@ -656,6 +663,9 @@ func (lbf *llbBridgeForwarder) ResolveSourceMeta(ctx context.Context, req *pb.Re 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{ @@ -698,11 +708,11 @@ func (lbf *llbBridgeForwarder) ResolveImageConfig(ctx context.Context, req *pb.R resolveopt := sourceresolver.Opt{ LogName: req.LogName, SourcePolicies: req.SourcePolicies, - Platform: platform, } if sourceresolver.ResolverType(req.ResolverType) == sourceresolver.ResolverTypeRegistry { resolveopt.ImageOpt = &sourceresolver.ResolveImageOpt{ ResolveMode: req.ResolveMode, + Platform: platform, } } else if sourceresolver.ResolverType(req.ResolverType) == sourceresolver.ResolverTypeOCILayout { resolveopt.OCILayoutOpt = &sourceresolver.ResolveOCILayoutOpt{ @@ -710,6 +720,7 @@ func (lbf *llbBridgeForwarder) ResolveImageConfig(ctx context.Context, req *pb.R SessionID: req.SessionID, StoreID: req.StoreID, }, + Platform: platform, } } @@ -1694,6 +1705,33 @@ func getCaps(label string) map[string]struct{} { return out } +func toPBAttestationChain(ac *sourceresolver.AttestationChain) *pb.AttestationChain { + if ac == nil { + return nil + } + out := &pb.AttestationChain{ + Root: string(ac.Root), + ImageManifest: string(ac.ImageManifest), + AttestationManifest: string(ac.AttestationManifest), + Blobs: make(map[string]*pb.Blob), + } + for _, s := range ac.SignatureManifests { + out.SignatureManifests = append(out.SignatureManifests, string(s)) + } + for k, v := range ac.Blobs { + out.Blobs[k.String()] = &pb.Blob{ + Descriptor_: &pb.Descriptor{ + MediaType: v.Descriptor.MediaType, + Size: v.Descriptor.Size, + Digest: string(v.Descriptor.Digest), + Annotations: maps.Clone(v.Descriptor.Annotations), + }, + Data: v.Data, + } + } + return out +} + func addCapsForKnownFrontends(caps map[string]struct{}, dgst digest.Digest) { // these frontends were built without caps detection but do support inputs defaults := map[digest.Digest]struct{}{ diff --git a/frontend/gateway/grpcclient/client.go b/frontend/gateway/grpcclient/client.go index bd77b7929b6e..42e449a47bab 100644 --- a/frontend/gateway/grpcclient/client.go +++ b/frontend/gateway/grpcclient/client.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "net" "os" "strings" @@ -25,6 +26,7 @@ import ( "github.com/moby/buildkit/util/imageutil" "github.com/moby/sys/signal" digest "github.com/opencontainers/go-digest" + ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" fstypes "github.com/tonistiigi/fsutil/types" "golang.org/x/sync/errgroup" @@ -497,8 +499,14 @@ func (c *grpcClient) ResolveSourceMetadata(ctx context.Context, op *opspb.Source }, nil } + var platform *ocispecs.Platform + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + platform = imgOpt.Platform + } else if ociOpt := opt.OCILayoutOpt; ociOpt != nil && ociOpt.Platform != nil { + platform = ociOpt.Platform + } var p *opspb.Platform - if platform := opt.Platform; platform != nil { + if platform != nil { p = &opspb.Platform{ OS: platform.OS, Architecture: platform.Architecture, @@ -514,6 +522,13 @@ func (c *grpcClient) ResolveSourceMetadata(ctx context.Context, op *opspb.Source LogName: opt.LogName, SourcePolicies: opt.SourcePolicies, } + if opt.ImageOpt != nil { + req.Image = &pb.ResolveSourceImageRequest{ + NoConfig: opt.ImageOpt.NoConfig, + AttestationChain: opt.ImageOpt.AttestationChain, + } + } + if opt.GitOpt != nil { req.Git = &pb.ResolveSourceGitRequest{ ReturnObject: opt.GitOpt.ReturnObject, @@ -529,10 +544,7 @@ func (c *grpcClient) ResolveSourceMetadata(ctx context.Context, op *opspb.Source Op: resp.Source, } if resp.Image != nil { - r.Image = &sourceresolver.ResolveImageResponse{ - Digest: digest.Digest(resp.Image.Digest), - Config: resp.Image.Config, - } + r.Image = imgResponseFromPB(resp.Image) } if resp.Git != nil { r.Git = &sourceresolver.ResolveGitResponse{ @@ -561,6 +573,45 @@ func (c *grpcClient) ResolveSourceMetadata(ctx context.Context, op *opspb.Source return r, nil } +func imgResponseFromPB(resp *pb.ResolveSourceImageResponse) *sourceresolver.ResolveImageResponse { + r := &sourceresolver.ResolveImageResponse{ + Digest: digest.Digest(resp.Digest), + Config: resp.Config, + } + if resp.AttestationChain != nil { + ac := &sourceresolver.AttestationChain{ + Root: digest.Digest(resp.AttestationChain.Root), + ImageManifest: digest.Digest(resp.AttestationChain.ImageManifest), + AttestationManifest: digest.Digest(resp.AttestationChain.AttestationManifest), + SignatureManifests: []digest.Digest{}, + Blobs: map[digest.Digest]sourceresolver.Blob{}, + } + for _, sm := range resp.AttestationChain.SignatureManifests { + ac.SignatureManifests = append(ac.SignatureManifests, digest.Digest(sm)) + } + for k, v := range resp.AttestationChain.Blobs { + ac.Blobs[digest.Digest(k)] = sourceresolver.Blob{ + Descriptor: descriptorFromPB(v.GetDescriptor_()), + Data: v.Data, + } + } + r.AttestationChain = ac + } + return r +} + +func descriptorFromPB(pbDesc *pb.Descriptor) ocispecs.Descriptor { + if pbDesc == nil { + return ocispecs.Descriptor{} + } + return ocispecs.Descriptor{ + MediaType: pbDesc.GetMediaType(), + Size: pbDesc.GetSize(), + Digest: digest.Digest(pbDesc.GetDigest()), + Annotations: maps.Clone(pbDesc.GetAnnotations()), + } +} + func (c *grpcClient) resolveImageConfigViaSourceMetadata(ctx context.Context, ref string, opt sourceresolver.Opt, p *opspb.Platform) (string, digest.Digest, []byte, error) { op := &opspb.SourceOp{ Identifier: "docker-image://" + ref, @@ -596,8 +647,15 @@ func (c *grpcClient) resolveImageConfigViaSourceMetadata(ctx context.Context, re } func (c *grpcClient) ResolveImageConfig(ctx context.Context, ref string, opt sourceresolver.Opt) (string, digest.Digest, []byte, error) { + var platform *ocispecs.Platform + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + platform = imgOpt.Platform + } else if ociOpt := opt.OCILayoutOpt; ociOpt != nil && ociOpt.Platform != nil { + platform = ociOpt.Platform + } + var p *opspb.Platform - if platform := opt.Platform; platform != nil { + if platform != nil { p = &opspb.Platform{ OS: platform.OS, Architecture: platform.Architecture, diff --git a/frontend/gateway/pb/gateway.pb.go b/frontend/gateway/pb/gateway.pb.go index fb1f7ab1d55c..4a958a42ada0 100644 --- a/frontend/gateway/pb/gateway.pb.go +++ b/frontend/gateway/pb/gateway.pb.go @@ -909,13 +909,14 @@ func (x *ResolveImageConfigResponse) GetRef() string { } type ResolveSourceMetaRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` - Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` - LogName string `protobuf:"bytes,3,opt,name=LogName,proto3" json:"LogName,omitempty"` - ResolveMode string `protobuf:"bytes,4,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` - SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` - Git *ResolveSourceGitRequest `protobuf:"bytes,5,opt,name=Git,proto3" json:"Git,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` + Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` + LogName string `protobuf:"bytes,3,opt,name=LogName,proto3" json:"LogName,omitempty"` + ResolveMode string `protobuf:"bytes,4,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` + Git *ResolveSourceGitRequest `protobuf:"bytes,5,opt,name=Git,proto3" json:"Git,omitempty"` + Image *ResolveSourceImageRequest `protobuf:"bytes,6,opt,name=Image,proto3" json:"Image,omitempty"` + SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -978,16 +979,23 @@ func (x *ResolveSourceMetaRequest) GetResolveMode() string { return "" } -func (x *ResolveSourceMetaRequest) GetSourcePolicies() []*pb1.Policy { +func (x *ResolveSourceMetaRequest) GetGit() *ResolveSourceGitRequest { if x != nil { - return x.SourcePolicies + return x.Git } return nil } -func (x *ResolveSourceMetaRequest) GetGit() *ResolveSourceGitRequest { +func (x *ResolveSourceMetaRequest) GetImage() *ResolveSourceImageRequest { if x != nil { - return x.Git + return x.Image + } + return nil +} + +func (x *ResolveSourceMetaRequest) GetSourcePolicies() []*pb1.Policy { + if x != nil { + return x.SourcePolicies } return nil } @@ -1060,17 +1068,146 @@ func (x *ResolveSourceMetaResponse) GetHTTP() *ResolveSourceHTTPResponse { return nil } +type ResolveSourceImageRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + NoConfig bool `protobuf:"varint,1,opt,name=NoConfig,proto3" json:"NoConfig,omitempty"` + AttestationChain bool `protobuf:"varint,2,opt,name=AttestationChain,proto3" json:"AttestationChain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveSourceImageRequest) Reset() { + *x = ResolveSourceImageRequest{} + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveSourceImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveSourceImageRequest) ProtoMessage() {} + +func (x *ResolveSourceImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveSourceImageRequest.ProtoReflect.Descriptor instead. +func (*ResolveSourceImageRequest) Descriptor() ([]byte, []int) { + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{15} +} + +func (x *ResolveSourceImageRequest) GetNoConfig() bool { + if x != nil { + return x.NoConfig + } + return false +} + +func (x *ResolveSourceImageRequest) GetAttestationChain() bool { + if x != nil { + return x.AttestationChain + } + return false +} + +type AttestationChain struct { + state protoimpl.MessageState `protogen:"open.v1"` + Root string `protobuf:"bytes,1,opt,name=Root,proto3" json:"Root,omitempty"` + ImageManifest string `protobuf:"bytes,2,opt,name=ImageManifest,proto3" json:"ImageManifest,omitempty"` + AttestationManifest string `protobuf:"bytes,3,opt,name=AttestationManifest,proto3" json:"AttestationManifest,omitempty"` + SignatureManifests []string `protobuf:"bytes,4,rep,name=SignatureManifests,proto3" json:"SignatureManifests,omitempty"` + Blobs map[string]*Blob `protobuf:"bytes,5,rep,name=Blobs,proto3" json:"Blobs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AttestationChain) Reset() { + *x = AttestationChain{} + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AttestationChain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttestationChain) ProtoMessage() {} + +func (x *AttestationChain) ProtoReflect() protoreflect.Message { + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttestationChain.ProtoReflect.Descriptor instead. +func (*AttestationChain) Descriptor() ([]byte, []int) { + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{16} +} + +func (x *AttestationChain) GetRoot() string { + if x != nil { + return x.Root + } + return "" +} + +func (x *AttestationChain) GetImageManifest() string { + if x != nil { + return x.ImageManifest + } + return "" +} + +func (x *AttestationChain) GetAttestationManifest() string { + if x != nil { + return x.AttestationManifest + } + return "" +} + +func (x *AttestationChain) GetSignatureManifests() []string { + if x != nil { + return x.SignatureManifests + } + return nil +} + +func (x *AttestationChain) GetBlobs() map[string]*Blob { + if x != nil { + return x.Blobs + } + return nil +} + type ResolveSourceImageResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` - Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` + Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + AttestationChain *AttestationChain `protobuf:"bytes,3,opt,name=AttestationChain,proto3" json:"AttestationChain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResolveSourceImageResponse) Reset() { *x = ResolveSourceImageResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[15] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1082,7 +1219,7 @@ func (x *ResolveSourceImageResponse) String() string { func (*ResolveSourceImageResponse) ProtoMessage() {} func (x *ResolveSourceImageResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[15] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1095,7 +1232,7 @@ func (x *ResolveSourceImageResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveSourceImageResponse.ProtoReflect.Descriptor instead. func (*ResolveSourceImageResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{15} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{17} } func (x *ResolveSourceImageResponse) GetDigest() string { @@ -1112,6 +1249,13 @@ func (x *ResolveSourceImageResponse) GetConfig() []byte { return nil } +func (x *ResolveSourceImageResponse) GetAttestationChain() *AttestationChain { + if x != nil { + return x.AttestationChain + } + return nil +} + type ResolveSourceGitRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Return full commit and tag object bytes. @@ -1122,7 +1266,7 @@ type ResolveSourceGitRequest struct { func (x *ResolveSourceGitRequest) Reset() { *x = ResolveSourceGitRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[16] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1134,7 +1278,7 @@ func (x *ResolveSourceGitRequest) String() string { func (*ResolveSourceGitRequest) ProtoMessage() {} func (x *ResolveSourceGitRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[16] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1147,7 +1291,7 @@ func (x *ResolveSourceGitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveSourceGitRequest.ProtoReflect.Descriptor instead. func (*ResolveSourceGitRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{16} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{18} } func (x *ResolveSourceGitRequest) GetReturnObject() bool { @@ -1170,7 +1314,7 @@ type ResolveSourceGitResponse struct { func (x *ResolveSourceGitResponse) Reset() { *x = ResolveSourceGitResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[17] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1182,7 +1326,7 @@ func (x *ResolveSourceGitResponse) String() string { func (*ResolveSourceGitResponse) ProtoMessage() {} func (x *ResolveSourceGitResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[17] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1195,7 +1339,7 @@ func (x *ResolveSourceGitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveSourceGitResponse.ProtoReflect.Descriptor instead. func (*ResolveSourceGitResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{17} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{19} } func (x *ResolveSourceGitResponse) GetChecksum() string { @@ -1244,7 +1388,7 @@ type ResolveSourceHTTPResponse struct { func (x *ResolveSourceHTTPResponse) Reset() { *x = ResolveSourceHTTPResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[18] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1256,7 +1400,7 @@ func (x *ResolveSourceHTTPResponse) String() string { func (*ResolveSourceHTTPResponse) ProtoMessage() {} func (x *ResolveSourceHTTPResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[18] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1269,7 +1413,7 @@ func (x *ResolveSourceHTTPResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveSourceHTTPResponse.ProtoReflect.Descriptor instead. func (*ResolveSourceHTTPResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{18} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{20} } func (x *ResolveSourceHTTPResponse) GetChecksum() string { @@ -1317,7 +1461,7 @@ type SolveRequest struct { func (x *SolveRequest) Reset() { *x = SolveRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[19] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1329,7 +1473,7 @@ func (x *SolveRequest) String() string { func (*SolveRequest) ProtoMessage() {} func (x *SolveRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[19] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1342,7 +1486,7 @@ func (x *SolveRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SolveRequest.ProtoReflect.Descriptor instead. func (*SolveRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{19} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{21} } func (x *SolveRequest) GetDefinition() *pb.Definition { @@ -1433,7 +1577,7 @@ type CacheOptionsEntry struct { func (x *CacheOptionsEntry) Reset() { *x = CacheOptionsEntry{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[20] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1445,7 +1589,7 @@ func (x *CacheOptionsEntry) String() string { func (*CacheOptionsEntry) ProtoMessage() {} func (x *CacheOptionsEntry) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[20] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1458,7 +1602,7 @@ func (x *CacheOptionsEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheOptionsEntry.ProtoReflect.Descriptor instead. func (*CacheOptionsEntry) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{20} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{22} } func (x *CacheOptionsEntry) GetType() string { @@ -1487,7 +1631,7 @@ type SolveResponse struct { func (x *SolveResponse) Reset() { *x = SolveResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[21] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1499,7 +1643,7 @@ func (x *SolveResponse) String() string { func (*SolveResponse) ProtoMessage() {} func (x *SolveResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[21] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1512,7 +1656,7 @@ func (x *SolveResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SolveResponse.ProtoReflect.Descriptor instead. func (*SolveResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{21} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{23} } func (x *SolveResponse) GetRef() string { @@ -1540,7 +1684,7 @@ type ReadFileRequest struct { func (x *ReadFileRequest) Reset() { *x = ReadFileRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[22] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1552,7 +1696,7 @@ func (x *ReadFileRequest) String() string { func (*ReadFileRequest) ProtoMessage() {} func (x *ReadFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[22] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1565,7 +1709,7 @@ func (x *ReadFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadFileRequest.ProtoReflect.Descriptor instead. func (*ReadFileRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{22} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{24} } func (x *ReadFileRequest) GetRef() string { @@ -1599,7 +1743,7 @@ type FileRange struct { func (x *FileRange) Reset() { *x = FileRange{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[23] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1611,7 +1755,7 @@ func (x *FileRange) String() string { func (*FileRange) ProtoMessage() {} func (x *FileRange) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[23] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1624,7 +1768,7 @@ func (x *FileRange) ProtoReflect() protoreflect.Message { // Deprecated: Use FileRange.ProtoReflect.Descriptor instead. func (*FileRange) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{23} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{25} } func (x *FileRange) GetOffset() int64 { @@ -1650,7 +1794,7 @@ type ReadFileResponse struct { func (x *ReadFileResponse) Reset() { *x = ReadFileResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[24] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1662,7 +1806,7 @@ func (x *ReadFileResponse) String() string { func (*ReadFileResponse) ProtoMessage() {} func (x *ReadFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[24] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1675,7 +1819,7 @@ func (x *ReadFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadFileResponse.ProtoReflect.Descriptor instead. func (*ReadFileResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{24} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{26} } func (x *ReadFileResponse) GetData() []byte { @@ -1696,7 +1840,7 @@ type ReadDirRequest struct { func (x *ReadDirRequest) Reset() { *x = ReadDirRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[25] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1708,7 +1852,7 @@ func (x *ReadDirRequest) String() string { func (*ReadDirRequest) ProtoMessage() {} func (x *ReadDirRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[25] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1721,7 +1865,7 @@ func (x *ReadDirRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadDirRequest.ProtoReflect.Descriptor instead. func (*ReadDirRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{25} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{27} } func (x *ReadDirRequest) GetRef() string { @@ -1754,7 +1898,7 @@ type ReadDirResponse struct { func (x *ReadDirResponse) Reset() { *x = ReadDirResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[26] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1766,7 +1910,7 @@ func (x *ReadDirResponse) String() string { func (*ReadDirResponse) ProtoMessage() {} func (x *ReadDirResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[26] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1779,7 +1923,7 @@ func (x *ReadDirResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadDirResponse.ProtoReflect.Descriptor instead. func (*ReadDirResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{26} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{28} } func (x *ReadDirResponse) GetEntries() []*types.Stat { @@ -1799,7 +1943,7 @@ type StatFileRequest struct { func (x *StatFileRequest) Reset() { *x = StatFileRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[27] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1811,7 +1955,7 @@ func (x *StatFileRequest) String() string { func (*StatFileRequest) ProtoMessage() {} func (x *StatFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[27] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1824,7 +1968,7 @@ func (x *StatFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatFileRequest.ProtoReflect.Descriptor instead. func (*StatFileRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{27} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{29} } func (x *StatFileRequest) GetRef() string { @@ -1850,7 +1994,7 @@ type StatFileResponse struct { func (x *StatFileResponse) Reset() { *x = StatFileResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[28] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1862,7 +2006,7 @@ func (x *StatFileResponse) String() string { func (*StatFileResponse) ProtoMessage() {} func (x *StatFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[28] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1875,7 +2019,7 @@ func (x *StatFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatFileResponse.ProtoReflect.Descriptor instead. func (*StatFileResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{28} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{30} } func (x *StatFileResponse) GetStat() *types.Stat { @@ -1894,7 +2038,7 @@ type EvaluateRequest struct { func (x *EvaluateRequest) Reset() { *x = EvaluateRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[29] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1906,7 +2050,7 @@ func (x *EvaluateRequest) String() string { func (*EvaluateRequest) ProtoMessage() {} func (x *EvaluateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[29] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1919,7 +2063,7 @@ func (x *EvaluateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EvaluateRequest.ProtoReflect.Descriptor instead. func (*EvaluateRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{29} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{31} } func (x *EvaluateRequest) GetRef() string { @@ -1937,7 +2081,7 @@ type EvaluateResponse struct { func (x *EvaluateResponse) Reset() { *x = EvaluateResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[30] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1949,7 +2093,7 @@ func (x *EvaluateResponse) String() string { func (*EvaluateResponse) ProtoMessage() {} func (x *EvaluateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[30] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1962,7 +2106,7 @@ func (x *EvaluateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EvaluateResponse.ProtoReflect.Descriptor instead. func (*EvaluateResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{30} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{32} } type PingRequest struct { @@ -1973,7 +2117,7 @@ type PingRequest struct { func (x *PingRequest) Reset() { *x = PingRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[31] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1985,7 +2129,7 @@ func (x *PingRequest) String() string { func (*PingRequest) ProtoMessage() {} func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[31] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1998,7 +2142,7 @@ func (x *PingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. func (*PingRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{31} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{33} } type PongResponse struct { @@ -2012,7 +2156,7 @@ type PongResponse struct { func (x *PongResponse) Reset() { *x = PongResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[32] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2024,7 +2168,7 @@ func (x *PongResponse) String() string { func (*PongResponse) ProtoMessage() {} func (x *PongResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[32] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2037,7 +2181,7 @@ func (x *PongResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PongResponse.ProtoReflect.Descriptor instead. func (*PongResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{32} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{34} } func (x *PongResponse) GetFrontendAPICaps() []*pb2.APICap { @@ -2076,7 +2220,7 @@ type WarnRequest struct { func (x *WarnRequest) Reset() { *x = WarnRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[33] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2088,7 +2232,7 @@ func (x *WarnRequest) String() string { func (*WarnRequest) ProtoMessage() {} func (x *WarnRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[33] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2101,7 +2245,7 @@ func (x *WarnRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WarnRequest.ProtoReflect.Descriptor instead. func (*WarnRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{33} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{35} } func (x *WarnRequest) GetDigest() string { @@ -2161,7 +2305,7 @@ type WarnResponse struct { func (x *WarnResponse) Reset() { *x = WarnResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[34] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2173,7 +2317,7 @@ func (x *WarnResponse) String() string { func (*WarnResponse) ProtoMessage() {} func (x *WarnResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[34] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2186,7 +2330,7 @@ func (x *WarnResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WarnResponse.ProtoReflect.Descriptor instead. func (*WarnResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{34} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{36} } type NewContainerRequest struct { @@ -2205,7 +2349,7 @@ type NewContainerRequest struct { func (x *NewContainerRequest) Reset() { *x = NewContainerRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[35] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2217,7 +2361,7 @@ func (x *NewContainerRequest) String() string { func (*NewContainerRequest) ProtoMessage() {} func (x *NewContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[35] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2230,7 +2374,7 @@ func (x *NewContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NewContainerRequest.ProtoReflect.Descriptor instead. func (*NewContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{35} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{37} } func (x *NewContainerRequest) GetContainerID() string { @@ -2290,7 +2434,7 @@ type NewContainerResponse struct { func (x *NewContainerResponse) Reset() { *x = NewContainerResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[36] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2302,7 +2446,7 @@ func (x *NewContainerResponse) String() string { func (*NewContainerResponse) ProtoMessage() {} func (x *NewContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[36] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2315,7 +2459,7 @@ func (x *NewContainerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NewContainerResponse.ProtoReflect.Descriptor instead. func (*NewContainerResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{36} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{38} } type ReleaseContainerRequest struct { @@ -2327,7 +2471,7 @@ type ReleaseContainerRequest struct { func (x *ReleaseContainerRequest) Reset() { *x = ReleaseContainerRequest{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[37] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2339,7 +2483,7 @@ func (x *ReleaseContainerRequest) String() string { func (*ReleaseContainerRequest) ProtoMessage() {} func (x *ReleaseContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[37] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2352,7 +2496,7 @@ func (x *ReleaseContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReleaseContainerRequest.ProtoReflect.Descriptor instead. func (*ReleaseContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{37} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{39} } func (x *ReleaseContainerRequest) GetContainerID() string { @@ -2370,7 +2514,7 @@ type ReleaseContainerResponse struct { func (x *ReleaseContainerResponse) Reset() { *x = ReleaseContainerResponse{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[38] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2382,7 +2526,7 @@ func (x *ReleaseContainerResponse) String() string { func (*ReleaseContainerResponse) ProtoMessage() {} func (x *ReleaseContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[38] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2395,7 +2539,7 @@ func (x *ReleaseContainerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReleaseContainerResponse.ProtoReflect.Descriptor instead. func (*ReleaseContainerResponse) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{38} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{40} } type ExecMessage struct { @@ -2417,7 +2561,7 @@ type ExecMessage struct { func (x *ExecMessage) Reset() { *x = ExecMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[39] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2429,7 +2573,7 @@ func (x *ExecMessage) String() string { func (*ExecMessage) ProtoMessage() {} func (x *ExecMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[39] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2442,7 +2586,7 @@ func (x *ExecMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecMessage.ProtoReflect.Descriptor instead. func (*ExecMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{39} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{41} } func (x *ExecMessage) GetProcessID() string { @@ -2594,7 +2738,7 @@ type InitMessage struct { func (x *InitMessage) Reset() { *x = InitMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[40] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2606,7 +2750,7 @@ func (x *InitMessage) String() string { func (*InitMessage) ProtoMessage() {} func (x *InitMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[40] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2619,7 +2763,7 @@ func (x *InitMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InitMessage.ProtoReflect.Descriptor instead. func (*InitMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{40} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{42} } func (x *InitMessage) GetContainerID() string { @@ -2674,7 +2818,7 @@ type ExitMessage struct { func (x *ExitMessage) Reset() { *x = ExitMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[41] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2686,7 +2830,7 @@ func (x *ExitMessage) String() string { func (*ExitMessage) ProtoMessage() {} func (x *ExitMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[41] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2699,7 +2843,7 @@ func (x *ExitMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ExitMessage.ProtoReflect.Descriptor instead. func (*ExitMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{41} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{43} } func (x *ExitMessage) GetCode() uint32 { @@ -2724,7 +2868,7 @@ type StartedMessage struct { func (x *StartedMessage) Reset() { *x = StartedMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[42] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2736,7 +2880,7 @@ func (x *StartedMessage) String() string { func (*StartedMessage) ProtoMessage() {} func (x *StartedMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[42] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2749,7 +2893,7 @@ func (x *StartedMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use StartedMessage.ProtoReflect.Descriptor instead. func (*StartedMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{42} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{44} } type DoneMessage struct { @@ -2760,7 +2904,7 @@ type DoneMessage struct { func (x *DoneMessage) Reset() { *x = DoneMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[43] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2772,7 +2916,7 @@ func (x *DoneMessage) String() string { func (*DoneMessage) ProtoMessage() {} func (x *DoneMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[43] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2785,7 +2929,7 @@ func (x *DoneMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use DoneMessage.ProtoReflect.Descriptor instead. func (*DoneMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{43} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{45} } type FdMessage struct { @@ -2799,7 +2943,7 @@ type FdMessage struct { func (x *FdMessage) Reset() { *x = FdMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[44] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2811,7 +2955,7 @@ func (x *FdMessage) String() string { func (*FdMessage) ProtoMessage() {} func (x *FdMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[44] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2824,7 +2968,7 @@ func (x *FdMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use FdMessage.ProtoReflect.Descriptor instead. func (*FdMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{44} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{46} } func (x *FdMessage) GetFd() uint32 { @@ -2858,7 +3002,7 @@ type ResizeMessage struct { func (x *ResizeMessage) Reset() { *x = ResizeMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[45] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2870,7 +3014,7 @@ func (x *ResizeMessage) String() string { func (*ResizeMessage) ProtoMessage() {} func (x *ResizeMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[45] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2883,7 +3027,7 @@ func (x *ResizeMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ResizeMessage.ProtoReflect.Descriptor instead. func (*ResizeMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{45} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{47} } func (x *ResizeMessage) GetRows() uint32 { @@ -2911,7 +3055,7 @@ type SignalMessage struct { func (x *SignalMessage) Reset() { *x = SignalMessage{} - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[46] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2923,7 +3067,7 @@ func (x *SignalMessage) String() string { func (*SignalMessage) ProtoMessage() {} func (x *SignalMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[46] + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2936,7 +3080,7 @@ func (x *SignalMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SignalMessage.ProtoReflect.Descriptor instead. func (*SignalMessage) Descriptor() ([]byte, []int) { - return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{46} + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{48} } func (x *SignalMessage) GetName() string { @@ -2946,6 +3090,126 @@ func (x *SignalMessage) GetName() string { return "" } +type Blob struct { + state protoimpl.MessageState `protogen:"open.v1"` + Descriptor_ *Descriptor `protobuf:"bytes,1,opt,name=descriptor,proto3" json:"descriptor,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Blob) Reset() { + *x = Blob{} + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Blob) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Blob) ProtoMessage() {} + +func (x *Blob) ProtoReflect() protoreflect.Message { + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Blob.ProtoReflect.Descriptor instead. +func (*Blob) Descriptor() ([]byte, []int) { + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{49} +} + +func (x *Blob) GetDescriptor_() *Descriptor { + if x != nil { + return x.Descriptor_ + } + return nil +} + +func (x *Blob) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type Descriptor struct { + state protoimpl.MessageState `protogen:"open.v1"` + MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` + Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Descriptor) Reset() { + *x = Descriptor{} + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Descriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Descriptor) ProtoMessage() {} + +func (x *Descriptor) ProtoReflect() protoreflect.Message { + mi := &file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Descriptor.ProtoReflect.Descriptor instead. +func (*Descriptor) Descriptor() ([]byte, []int) { + return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{50} +} + +func (x *Descriptor) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *Descriptor) GetDigest() string { + if x != nil { + return x.Digest + } + return "" +} + +func (x *Descriptor) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *Descriptor) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + var File_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto protoreflect.FileDescriptor const file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = "" + @@ -3017,22 +3281,37 @@ const file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = "\x1aResolveImageConfigResponse\x12\x16\n" + "\x06Digest\x18\x01 \x01(\tR\x06Digest\x12\x16\n" + "\x06Config\x18\x02 \x01(\fR\x06Config\x12\x10\n" + - "\x03Ref\x18\x03 \x01(\tR\x03Ref\"\xbb\x02\n" + + "\x03Ref\x18\x03 \x01(\tR\x03Ref\"\x87\x03\n" + "\x18ResolveSourceMetaRequest\x12$\n" + "\x06Source\x18\x01 \x01(\v2\f.pb.SourceOpR\x06Source\x12(\n" + "\bPlatform\x18\x02 \x01(\v2\f.pb.PlatformR\bPlatform\x12\x18\n" + "\aLogName\x18\x03 \x01(\tR\aLogName\x12 \n" + - "\vResolveMode\x18\x04 \x01(\tR\vResolveMode\x12M\n" + - "\x0eSourcePolicies\x18\b \x03(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\x0eSourcePolicies\x12D\n" + - "\x03Git\x18\x05 \x01(\v22.moby.buildkit.v1.frontend.ResolveSourceGitRequestR\x03Git\"\x9f\x02\n" + + "\vResolveMode\x18\x04 \x01(\tR\vResolveMode\x12D\n" + + "\x03Git\x18\x05 \x01(\v22.moby.buildkit.v1.frontend.ResolveSourceGitRequestR\x03Git\x12J\n" + + "\x05Image\x18\x06 \x01(\v24.moby.buildkit.v1.frontend.ResolveSourceImageRequestR\x05Image\x12M\n" + + "\x0eSourcePolicies\x18\b \x03(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\x0eSourcePolicies\"\x9f\x02\n" + "\x19ResolveSourceMetaResponse\x12$\n" + "\x06Source\x18\x01 \x01(\v2\f.pb.SourceOpR\x06Source\x12K\n" + "\x05Image\x18\x02 \x01(\v25.moby.buildkit.v1.frontend.ResolveSourceImageResponseR\x05Image\x12E\n" + "\x03Git\x18\x03 \x01(\v23.moby.buildkit.v1.frontend.ResolveSourceGitResponseR\x03Git\x12H\n" + - "\x04HTTP\x18\x04 \x01(\v24.moby.buildkit.v1.frontend.ResolveSourceHTTPResponseR\x04HTTP\"L\n" + + "\x04HTTP\x18\x04 \x01(\v24.moby.buildkit.v1.frontend.ResolveSourceHTTPResponseR\x04HTTP\"c\n" + + "\x19ResolveSourceImageRequest\x12\x1a\n" + + "\bNoConfig\x18\x01 \x01(\bR\bNoConfig\x12*\n" + + "\x10AttestationChain\x18\x02 \x01(\bR\x10AttestationChain\"\xd7\x02\n" + + "\x10AttestationChain\x12\x12\n" + + "\x04Root\x18\x01 \x01(\tR\x04Root\x12$\n" + + "\rImageManifest\x18\x02 \x01(\tR\rImageManifest\x120\n" + + "\x13AttestationManifest\x18\x03 \x01(\tR\x13AttestationManifest\x12.\n" + + "\x12SignatureManifests\x18\x04 \x03(\tR\x12SignatureManifests\x12L\n" + + "\x05Blobs\x18\x05 \x03(\v26.moby.buildkit.v1.frontend.AttestationChain.BlobsEntryR\x05Blobs\x1aY\n" + + "\n" + + "BlobsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x125\n" + + "\x05value\x18\x02 \x01(\v2\x1f.moby.buildkit.v1.frontend.BlobR\x05value:\x028\x01\"\xa5\x01\n" + "\x1aResolveSourceImageResponse\x12\x16\n" + "\x06Digest\x18\x01 \x01(\tR\x06Digest\x12\x16\n" + - "\x06Config\x18\x02 \x01(\fR\x06Config\"=\n" + + "\x06Config\x18\x02 \x01(\fR\x06Config\x12W\n" + + "\x10AttestationChain\x18\x03 \x01(\v2+.moby.buildkit.v1.frontend.AttestationChainR\x10AttestationChain\"=\n" + "\x17ResolveSourceGitRequest\x12\"\n" + "\fReturnObject\x18\x01 \x01(\bR\fReturnObject\"\xb2\x01\n" + "\x18ResolveSourceGitResponse\x12\x1a\n" + @@ -3158,7 +3437,22 @@ const file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = "\x04Rows\x18\x01 \x01(\rR\x04Rows\x12\x12\n" + "\x04Cols\x18\x02 \x01(\rR\x04Cols\"#\n" + "\rSignalMessage\x12\x12\n" + - "\x04Name\x18\x01 \x01(\tR\x04Name*)\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name\"a\n" + + "\x04Blob\x12E\n" + + "\n" + + "descriptor\x18\x01 \x01(\v2%.moby.buildkit.v1.frontend.DescriptorR\n" + + "descriptor\x12\x12\n" + + "\x04data\x18\x02 \x01(\fR\x04data\"\xf1\x01\n" + + "\n" + + "Descriptor\x12\x1d\n" + + "\n" + + "media_type\x18\x01 \x01(\tR\tmediaType\x12\x16\n" + + "\x06digest\x18\x02 \x01(\tR\x06digest\x12\x12\n" + + "\x04size\x18\x03 \x01(\x03R\x04size\x12X\n" + + "\vannotations\x18\x05 \x03(\v26.moby.buildkit.v1.frontend.Descriptor.AnnotationsEntryR\vannotations\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*)\n" + "\x0fAttestationKind\x12\n" + "\n" + "\x06InToto\x10\x00\x12\n" + @@ -3196,7 +3490,7 @@ func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP } var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 56) +var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 62) var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_goTypes = []any{ (AttestationKind)(0), // 0: moby.buildkit.v1.frontend.AttestationKind (InTotoSubjectKind)(0), // 1: moby.buildkit.v1.frontend.InTotoSubjectKind @@ -3215,163 +3509,175 @@ var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_goTypes = [] (*ResolveImageConfigResponse)(nil), // 14: moby.buildkit.v1.frontend.ResolveImageConfigResponse (*ResolveSourceMetaRequest)(nil), // 15: moby.buildkit.v1.frontend.ResolveSourceMetaRequest (*ResolveSourceMetaResponse)(nil), // 16: moby.buildkit.v1.frontend.ResolveSourceMetaResponse - (*ResolveSourceImageResponse)(nil), // 17: moby.buildkit.v1.frontend.ResolveSourceImageResponse - (*ResolveSourceGitRequest)(nil), // 18: moby.buildkit.v1.frontend.ResolveSourceGitRequest - (*ResolveSourceGitResponse)(nil), // 19: moby.buildkit.v1.frontend.ResolveSourceGitResponse - (*ResolveSourceHTTPResponse)(nil), // 20: moby.buildkit.v1.frontend.ResolveSourceHTTPResponse - (*SolveRequest)(nil), // 21: moby.buildkit.v1.frontend.SolveRequest - (*CacheOptionsEntry)(nil), // 22: moby.buildkit.v1.frontend.CacheOptionsEntry - (*SolveResponse)(nil), // 23: moby.buildkit.v1.frontend.SolveResponse - (*ReadFileRequest)(nil), // 24: moby.buildkit.v1.frontend.ReadFileRequest - (*FileRange)(nil), // 25: moby.buildkit.v1.frontend.FileRange - (*ReadFileResponse)(nil), // 26: moby.buildkit.v1.frontend.ReadFileResponse - (*ReadDirRequest)(nil), // 27: moby.buildkit.v1.frontend.ReadDirRequest - (*ReadDirResponse)(nil), // 28: moby.buildkit.v1.frontend.ReadDirResponse - (*StatFileRequest)(nil), // 29: moby.buildkit.v1.frontend.StatFileRequest - (*StatFileResponse)(nil), // 30: moby.buildkit.v1.frontend.StatFileResponse - (*EvaluateRequest)(nil), // 31: moby.buildkit.v1.frontend.EvaluateRequest - (*EvaluateResponse)(nil), // 32: moby.buildkit.v1.frontend.EvaluateResponse - (*PingRequest)(nil), // 33: moby.buildkit.v1.frontend.PingRequest - (*PongResponse)(nil), // 34: moby.buildkit.v1.frontend.PongResponse - (*WarnRequest)(nil), // 35: moby.buildkit.v1.frontend.WarnRequest - (*WarnResponse)(nil), // 36: moby.buildkit.v1.frontend.WarnResponse - (*NewContainerRequest)(nil), // 37: moby.buildkit.v1.frontend.NewContainerRequest - (*NewContainerResponse)(nil), // 38: moby.buildkit.v1.frontend.NewContainerResponse - (*ReleaseContainerRequest)(nil), // 39: moby.buildkit.v1.frontend.ReleaseContainerRequest - (*ReleaseContainerResponse)(nil), // 40: moby.buildkit.v1.frontend.ReleaseContainerResponse - (*ExecMessage)(nil), // 41: moby.buildkit.v1.frontend.ExecMessage - (*InitMessage)(nil), // 42: moby.buildkit.v1.frontend.InitMessage - (*ExitMessage)(nil), // 43: moby.buildkit.v1.frontend.ExitMessage - (*StartedMessage)(nil), // 44: moby.buildkit.v1.frontend.StartedMessage - (*DoneMessage)(nil), // 45: moby.buildkit.v1.frontend.DoneMessage - (*FdMessage)(nil), // 46: moby.buildkit.v1.frontend.FdMessage - (*ResizeMessage)(nil), // 47: moby.buildkit.v1.frontend.ResizeMessage - (*SignalMessage)(nil), // 48: moby.buildkit.v1.frontend.SignalMessage - nil, // 49: moby.buildkit.v1.frontend.Result.MetadataEntry - nil, // 50: moby.buildkit.v1.frontend.Result.AttestationsEntry - nil, // 51: moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry - nil, // 52: moby.buildkit.v1.frontend.RefMap.RefsEntry - nil, // 53: moby.buildkit.v1.frontend.Attestation.MetadataEntry - nil, // 54: moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry - nil, // 55: moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntry - nil, // 56: moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry - nil, // 57: moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntry - (*pb.Definition)(nil), // 58: pb.Definition - (*status.Status)(nil), // 59: google.rpc.Status - (*pb.Platform)(nil), // 60: pb.Platform - (*pb1.Policy)(nil), // 61: moby.buildkit.v1.sourcepolicy.Policy - (*pb.SourceOp)(nil), // 62: pb.SourceOp - (*timestamp.Timestamp)(nil), // 63: google.protobuf.Timestamp - (*types.Stat)(nil), // 64: fsutil.types.Stat - (*pb2.APICap)(nil), // 65: moby.buildkit.v1.apicaps.APICap - (*types1.WorkerRecord)(nil), // 66: moby.buildkit.v1.types.WorkerRecord - (*pb.SourceInfo)(nil), // 67: pb.SourceInfo - (*pb.Range)(nil), // 68: pb.Range - (*pb.Mount)(nil), // 69: pb.Mount - (pb.NetMode)(0), // 70: pb.NetMode - (*pb.WorkerConstraints)(nil), // 71: pb.WorkerConstraints - (*pb.HostIP)(nil), // 72: pb.HostIP - (*pb.Meta)(nil), // 73: pb.Meta - (pb.SecurityMode)(0), // 74: pb.SecurityMode - (*pb.SecretEnv)(nil), // 75: pb.SecretEnv + (*ResolveSourceImageRequest)(nil), // 17: moby.buildkit.v1.frontend.ResolveSourceImageRequest + (*AttestationChain)(nil), // 18: moby.buildkit.v1.frontend.AttestationChain + (*ResolveSourceImageResponse)(nil), // 19: moby.buildkit.v1.frontend.ResolveSourceImageResponse + (*ResolveSourceGitRequest)(nil), // 20: moby.buildkit.v1.frontend.ResolveSourceGitRequest + (*ResolveSourceGitResponse)(nil), // 21: moby.buildkit.v1.frontend.ResolveSourceGitResponse + (*ResolveSourceHTTPResponse)(nil), // 22: moby.buildkit.v1.frontend.ResolveSourceHTTPResponse + (*SolveRequest)(nil), // 23: moby.buildkit.v1.frontend.SolveRequest + (*CacheOptionsEntry)(nil), // 24: moby.buildkit.v1.frontend.CacheOptionsEntry + (*SolveResponse)(nil), // 25: moby.buildkit.v1.frontend.SolveResponse + (*ReadFileRequest)(nil), // 26: moby.buildkit.v1.frontend.ReadFileRequest + (*FileRange)(nil), // 27: moby.buildkit.v1.frontend.FileRange + (*ReadFileResponse)(nil), // 28: moby.buildkit.v1.frontend.ReadFileResponse + (*ReadDirRequest)(nil), // 29: moby.buildkit.v1.frontend.ReadDirRequest + (*ReadDirResponse)(nil), // 30: moby.buildkit.v1.frontend.ReadDirResponse + (*StatFileRequest)(nil), // 31: moby.buildkit.v1.frontend.StatFileRequest + (*StatFileResponse)(nil), // 32: moby.buildkit.v1.frontend.StatFileResponse + (*EvaluateRequest)(nil), // 33: moby.buildkit.v1.frontend.EvaluateRequest + (*EvaluateResponse)(nil), // 34: moby.buildkit.v1.frontend.EvaluateResponse + (*PingRequest)(nil), // 35: moby.buildkit.v1.frontend.PingRequest + (*PongResponse)(nil), // 36: moby.buildkit.v1.frontend.PongResponse + (*WarnRequest)(nil), // 37: moby.buildkit.v1.frontend.WarnRequest + (*WarnResponse)(nil), // 38: moby.buildkit.v1.frontend.WarnResponse + (*NewContainerRequest)(nil), // 39: moby.buildkit.v1.frontend.NewContainerRequest + (*NewContainerResponse)(nil), // 40: moby.buildkit.v1.frontend.NewContainerResponse + (*ReleaseContainerRequest)(nil), // 41: moby.buildkit.v1.frontend.ReleaseContainerRequest + (*ReleaseContainerResponse)(nil), // 42: moby.buildkit.v1.frontend.ReleaseContainerResponse + (*ExecMessage)(nil), // 43: moby.buildkit.v1.frontend.ExecMessage + (*InitMessage)(nil), // 44: moby.buildkit.v1.frontend.InitMessage + (*ExitMessage)(nil), // 45: moby.buildkit.v1.frontend.ExitMessage + (*StartedMessage)(nil), // 46: moby.buildkit.v1.frontend.StartedMessage + (*DoneMessage)(nil), // 47: moby.buildkit.v1.frontend.DoneMessage + (*FdMessage)(nil), // 48: moby.buildkit.v1.frontend.FdMessage + (*ResizeMessage)(nil), // 49: moby.buildkit.v1.frontend.ResizeMessage + (*SignalMessage)(nil), // 50: moby.buildkit.v1.frontend.SignalMessage + (*Blob)(nil), // 51: moby.buildkit.v1.frontend.Blob + (*Descriptor)(nil), // 52: moby.buildkit.v1.frontend.Descriptor + nil, // 53: moby.buildkit.v1.frontend.Result.MetadataEntry + nil, // 54: moby.buildkit.v1.frontend.Result.AttestationsEntry + nil, // 55: moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry + nil, // 56: moby.buildkit.v1.frontend.RefMap.RefsEntry + nil, // 57: moby.buildkit.v1.frontend.Attestation.MetadataEntry + nil, // 58: moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry + nil, // 59: moby.buildkit.v1.frontend.AttestationChain.BlobsEntry + nil, // 60: moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntry + nil, // 61: moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry + nil, // 62: moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntry + nil, // 63: moby.buildkit.v1.frontend.Descriptor.AnnotationsEntry + (*pb.Definition)(nil), // 64: pb.Definition + (*status.Status)(nil), // 65: google.rpc.Status + (*pb.Platform)(nil), // 66: pb.Platform + (*pb1.Policy)(nil), // 67: moby.buildkit.v1.sourcepolicy.Policy + (*pb.SourceOp)(nil), // 68: pb.SourceOp + (*timestamp.Timestamp)(nil), // 69: google.protobuf.Timestamp + (*types.Stat)(nil), // 70: fsutil.types.Stat + (*pb2.APICap)(nil), // 71: moby.buildkit.v1.apicaps.APICap + (*types1.WorkerRecord)(nil), // 72: moby.buildkit.v1.types.WorkerRecord + (*pb.SourceInfo)(nil), // 73: pb.SourceInfo + (*pb.Range)(nil), // 74: pb.Range + (*pb.Mount)(nil), // 75: pb.Mount + (pb.NetMode)(0), // 76: pb.NetMode + (*pb.WorkerConstraints)(nil), // 77: pb.WorkerConstraints + (*pb.HostIP)(nil), // 78: pb.HostIP + (*pb.Meta)(nil), // 79: pb.Meta + (pb.SecurityMode)(0), // 80: pb.SecurityMode + (*pb.SecretEnv)(nil), // 81: pb.SecretEnv } var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_depIdxs = []int32{ 3, // 0: moby.buildkit.v1.frontend.Result.refsDeprecated:type_name -> moby.buildkit.v1.frontend.RefMapDeprecated 4, // 1: moby.buildkit.v1.frontend.Result.ref:type_name -> moby.buildkit.v1.frontend.Ref 5, // 2: moby.buildkit.v1.frontend.Result.refs:type_name -> moby.buildkit.v1.frontend.RefMap - 49, // 3: moby.buildkit.v1.frontend.Result.metadata:type_name -> moby.buildkit.v1.frontend.Result.MetadataEntry - 50, // 4: moby.buildkit.v1.frontend.Result.attestations:type_name -> moby.buildkit.v1.frontend.Result.AttestationsEntry - 51, // 5: moby.buildkit.v1.frontend.RefMapDeprecated.refs:type_name -> moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry - 58, // 6: moby.buildkit.v1.frontend.Ref.def:type_name -> pb.Definition - 52, // 7: moby.buildkit.v1.frontend.RefMap.refs:type_name -> moby.buildkit.v1.frontend.RefMap.RefsEntry + 53, // 3: moby.buildkit.v1.frontend.Result.metadata:type_name -> moby.buildkit.v1.frontend.Result.MetadataEntry + 54, // 4: moby.buildkit.v1.frontend.Result.attestations:type_name -> moby.buildkit.v1.frontend.Result.AttestationsEntry + 55, // 5: moby.buildkit.v1.frontend.RefMapDeprecated.refs:type_name -> moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry + 64, // 6: moby.buildkit.v1.frontend.Ref.def:type_name -> pb.Definition + 56, // 7: moby.buildkit.v1.frontend.RefMap.refs:type_name -> moby.buildkit.v1.frontend.RefMap.RefsEntry 7, // 8: moby.buildkit.v1.frontend.Attestations.attestation:type_name -> moby.buildkit.v1.frontend.Attestation 0, // 9: moby.buildkit.v1.frontend.Attestation.kind:type_name -> moby.buildkit.v1.frontend.AttestationKind - 53, // 10: moby.buildkit.v1.frontend.Attestation.metadata:type_name -> moby.buildkit.v1.frontend.Attestation.MetadataEntry + 57, // 10: moby.buildkit.v1.frontend.Attestation.metadata:type_name -> moby.buildkit.v1.frontend.Attestation.MetadataEntry 4, // 11: moby.buildkit.v1.frontend.Attestation.ref:type_name -> moby.buildkit.v1.frontend.Ref 8, // 12: moby.buildkit.v1.frontend.Attestation.inTotoSubjects:type_name -> moby.buildkit.v1.frontend.InTotoSubject 1, // 13: moby.buildkit.v1.frontend.InTotoSubject.kind:type_name -> moby.buildkit.v1.frontend.InTotoSubjectKind 2, // 14: moby.buildkit.v1.frontend.ReturnRequest.result:type_name -> moby.buildkit.v1.frontend.Result - 59, // 15: moby.buildkit.v1.frontend.ReturnRequest.error:type_name -> google.rpc.Status - 54, // 16: moby.buildkit.v1.frontend.InputsResponse.Definitions:type_name -> moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry - 60, // 17: moby.buildkit.v1.frontend.ResolveImageConfigRequest.Platform:type_name -> pb.Platform - 61, // 18: moby.buildkit.v1.frontend.ResolveImageConfigRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy - 62, // 19: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Source:type_name -> pb.SourceOp - 60, // 20: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Platform:type_name -> pb.Platform - 61, // 21: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy - 18, // 22: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Git:type_name -> moby.buildkit.v1.frontend.ResolveSourceGitRequest - 62, // 23: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Source:type_name -> pb.SourceOp - 17, // 24: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Image:type_name -> moby.buildkit.v1.frontend.ResolveSourceImageResponse - 19, // 25: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Git:type_name -> moby.buildkit.v1.frontend.ResolveSourceGitResponse - 20, // 26: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.HTTP:type_name -> moby.buildkit.v1.frontend.ResolveSourceHTTPResponse - 63, // 27: moby.buildkit.v1.frontend.ResolveSourceHTTPResponse.LastModified:type_name -> google.protobuf.Timestamp - 58, // 28: moby.buildkit.v1.frontend.SolveRequest.Definition:type_name -> pb.Definition - 55, // 29: moby.buildkit.v1.frontend.SolveRequest.FrontendOpt:type_name -> moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntry - 22, // 30: moby.buildkit.v1.frontend.SolveRequest.CacheImports:type_name -> moby.buildkit.v1.frontend.CacheOptionsEntry - 56, // 31: moby.buildkit.v1.frontend.SolveRequest.FrontendInputs:type_name -> moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry - 61, // 32: moby.buildkit.v1.frontend.SolveRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy - 57, // 33: moby.buildkit.v1.frontend.CacheOptionsEntry.Attrs:type_name -> moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntry - 2, // 34: moby.buildkit.v1.frontend.SolveResponse.result:type_name -> moby.buildkit.v1.frontend.Result - 25, // 35: moby.buildkit.v1.frontend.ReadFileRequest.Range:type_name -> moby.buildkit.v1.frontend.FileRange - 64, // 36: moby.buildkit.v1.frontend.ReadDirResponse.entries:type_name -> fsutil.types.Stat - 64, // 37: moby.buildkit.v1.frontend.StatFileResponse.stat:type_name -> fsutil.types.Stat - 65, // 38: moby.buildkit.v1.frontend.PongResponse.FrontendAPICaps:type_name -> moby.buildkit.v1.apicaps.APICap - 65, // 39: moby.buildkit.v1.frontend.PongResponse.LLBCaps:type_name -> moby.buildkit.v1.apicaps.APICap - 66, // 40: moby.buildkit.v1.frontend.PongResponse.Workers:type_name -> moby.buildkit.v1.types.WorkerRecord - 67, // 41: moby.buildkit.v1.frontend.WarnRequest.info:type_name -> pb.SourceInfo - 68, // 42: moby.buildkit.v1.frontend.WarnRequest.ranges:type_name -> pb.Range - 69, // 43: moby.buildkit.v1.frontend.NewContainerRequest.Mounts:type_name -> pb.Mount - 70, // 44: moby.buildkit.v1.frontend.NewContainerRequest.Network:type_name -> pb.NetMode - 60, // 45: moby.buildkit.v1.frontend.NewContainerRequest.platform:type_name -> pb.Platform - 71, // 46: moby.buildkit.v1.frontend.NewContainerRequest.constraints:type_name -> pb.WorkerConstraints - 72, // 47: moby.buildkit.v1.frontend.NewContainerRequest.extraHosts:type_name -> pb.HostIP - 42, // 48: moby.buildkit.v1.frontend.ExecMessage.Init:type_name -> moby.buildkit.v1.frontend.InitMessage - 46, // 49: moby.buildkit.v1.frontend.ExecMessage.File:type_name -> moby.buildkit.v1.frontend.FdMessage - 47, // 50: moby.buildkit.v1.frontend.ExecMessage.Resize:type_name -> moby.buildkit.v1.frontend.ResizeMessage - 44, // 51: moby.buildkit.v1.frontend.ExecMessage.Started:type_name -> moby.buildkit.v1.frontend.StartedMessage - 43, // 52: moby.buildkit.v1.frontend.ExecMessage.Exit:type_name -> moby.buildkit.v1.frontend.ExitMessage - 45, // 53: moby.buildkit.v1.frontend.ExecMessage.Done:type_name -> moby.buildkit.v1.frontend.DoneMessage - 48, // 54: moby.buildkit.v1.frontend.ExecMessage.Signal:type_name -> moby.buildkit.v1.frontend.SignalMessage - 73, // 55: moby.buildkit.v1.frontend.InitMessage.Meta:type_name -> pb.Meta - 74, // 56: moby.buildkit.v1.frontend.InitMessage.Security:type_name -> pb.SecurityMode - 75, // 57: moby.buildkit.v1.frontend.InitMessage.secretenv:type_name -> pb.SecretEnv - 59, // 58: moby.buildkit.v1.frontend.ExitMessage.Error:type_name -> google.rpc.Status - 6, // 59: moby.buildkit.v1.frontend.Result.AttestationsEntry.value:type_name -> moby.buildkit.v1.frontend.Attestations - 4, // 60: moby.buildkit.v1.frontend.RefMap.RefsEntry.value:type_name -> moby.buildkit.v1.frontend.Ref - 58, // 61: moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry.value:type_name -> pb.Definition - 58, // 62: moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry.value:type_name -> pb.Definition - 13, // 63: moby.buildkit.v1.frontend.LLBBridge.ResolveImageConfig:input_type -> moby.buildkit.v1.frontend.ResolveImageConfigRequest - 15, // 64: moby.buildkit.v1.frontend.LLBBridge.ResolveSourceMeta:input_type -> moby.buildkit.v1.frontend.ResolveSourceMetaRequest - 21, // 65: moby.buildkit.v1.frontend.LLBBridge.Solve:input_type -> moby.buildkit.v1.frontend.SolveRequest - 24, // 66: moby.buildkit.v1.frontend.LLBBridge.ReadFile:input_type -> moby.buildkit.v1.frontend.ReadFileRequest - 27, // 67: moby.buildkit.v1.frontend.LLBBridge.ReadDir:input_type -> moby.buildkit.v1.frontend.ReadDirRequest - 29, // 68: moby.buildkit.v1.frontend.LLBBridge.StatFile:input_type -> moby.buildkit.v1.frontend.StatFileRequest - 31, // 69: moby.buildkit.v1.frontend.LLBBridge.Evaluate:input_type -> moby.buildkit.v1.frontend.EvaluateRequest - 33, // 70: moby.buildkit.v1.frontend.LLBBridge.Ping:input_type -> moby.buildkit.v1.frontend.PingRequest - 9, // 71: moby.buildkit.v1.frontend.LLBBridge.Return:input_type -> moby.buildkit.v1.frontend.ReturnRequest - 11, // 72: moby.buildkit.v1.frontend.LLBBridge.Inputs:input_type -> moby.buildkit.v1.frontend.InputsRequest - 37, // 73: moby.buildkit.v1.frontend.LLBBridge.NewContainer:input_type -> moby.buildkit.v1.frontend.NewContainerRequest - 39, // 74: moby.buildkit.v1.frontend.LLBBridge.ReleaseContainer:input_type -> moby.buildkit.v1.frontend.ReleaseContainerRequest - 41, // 75: moby.buildkit.v1.frontend.LLBBridge.ExecProcess:input_type -> moby.buildkit.v1.frontend.ExecMessage - 35, // 76: moby.buildkit.v1.frontend.LLBBridge.Warn:input_type -> moby.buildkit.v1.frontend.WarnRequest - 14, // 77: moby.buildkit.v1.frontend.LLBBridge.ResolveImageConfig:output_type -> moby.buildkit.v1.frontend.ResolveImageConfigResponse - 16, // 78: moby.buildkit.v1.frontend.LLBBridge.ResolveSourceMeta:output_type -> moby.buildkit.v1.frontend.ResolveSourceMetaResponse - 23, // 79: moby.buildkit.v1.frontend.LLBBridge.Solve:output_type -> moby.buildkit.v1.frontend.SolveResponse - 26, // 80: moby.buildkit.v1.frontend.LLBBridge.ReadFile:output_type -> moby.buildkit.v1.frontend.ReadFileResponse - 28, // 81: moby.buildkit.v1.frontend.LLBBridge.ReadDir:output_type -> moby.buildkit.v1.frontend.ReadDirResponse - 30, // 82: moby.buildkit.v1.frontend.LLBBridge.StatFile:output_type -> moby.buildkit.v1.frontend.StatFileResponse - 32, // 83: moby.buildkit.v1.frontend.LLBBridge.Evaluate:output_type -> moby.buildkit.v1.frontend.EvaluateResponse - 34, // 84: moby.buildkit.v1.frontend.LLBBridge.Ping:output_type -> moby.buildkit.v1.frontend.PongResponse - 10, // 85: moby.buildkit.v1.frontend.LLBBridge.Return:output_type -> moby.buildkit.v1.frontend.ReturnResponse - 12, // 86: moby.buildkit.v1.frontend.LLBBridge.Inputs:output_type -> moby.buildkit.v1.frontend.InputsResponse - 38, // 87: moby.buildkit.v1.frontend.LLBBridge.NewContainer:output_type -> moby.buildkit.v1.frontend.NewContainerResponse - 40, // 88: moby.buildkit.v1.frontend.LLBBridge.ReleaseContainer:output_type -> moby.buildkit.v1.frontend.ReleaseContainerResponse - 41, // 89: moby.buildkit.v1.frontend.LLBBridge.ExecProcess:output_type -> moby.buildkit.v1.frontend.ExecMessage - 36, // 90: moby.buildkit.v1.frontend.LLBBridge.Warn:output_type -> moby.buildkit.v1.frontend.WarnResponse - 77, // [77:91] is the sub-list for method output_type - 63, // [63:77] is the sub-list for method input_type - 63, // [63:63] is the sub-list for extension type_name - 63, // [63:63] is the sub-list for extension extendee - 0, // [0:63] is the sub-list for field type_name + 65, // 15: moby.buildkit.v1.frontend.ReturnRequest.error:type_name -> google.rpc.Status + 58, // 16: moby.buildkit.v1.frontend.InputsResponse.Definitions:type_name -> moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry + 66, // 17: moby.buildkit.v1.frontend.ResolveImageConfigRequest.Platform:type_name -> pb.Platform + 67, // 18: moby.buildkit.v1.frontend.ResolveImageConfigRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy + 68, // 19: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Source:type_name -> pb.SourceOp + 66, // 20: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Platform:type_name -> pb.Platform + 20, // 21: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Git:type_name -> moby.buildkit.v1.frontend.ResolveSourceGitRequest + 17, // 22: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.Image:type_name -> moby.buildkit.v1.frontend.ResolveSourceImageRequest + 67, // 23: moby.buildkit.v1.frontend.ResolveSourceMetaRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy + 68, // 24: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Source:type_name -> pb.SourceOp + 19, // 25: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Image:type_name -> moby.buildkit.v1.frontend.ResolveSourceImageResponse + 21, // 26: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.Git:type_name -> moby.buildkit.v1.frontend.ResolveSourceGitResponse + 22, // 27: moby.buildkit.v1.frontend.ResolveSourceMetaResponse.HTTP:type_name -> moby.buildkit.v1.frontend.ResolveSourceHTTPResponse + 59, // 28: moby.buildkit.v1.frontend.AttestationChain.Blobs:type_name -> moby.buildkit.v1.frontend.AttestationChain.BlobsEntry + 18, // 29: moby.buildkit.v1.frontend.ResolveSourceImageResponse.AttestationChain:type_name -> moby.buildkit.v1.frontend.AttestationChain + 69, // 30: moby.buildkit.v1.frontend.ResolveSourceHTTPResponse.LastModified:type_name -> google.protobuf.Timestamp + 64, // 31: moby.buildkit.v1.frontend.SolveRequest.Definition:type_name -> pb.Definition + 60, // 32: moby.buildkit.v1.frontend.SolveRequest.FrontendOpt:type_name -> moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntry + 24, // 33: moby.buildkit.v1.frontend.SolveRequest.CacheImports:type_name -> moby.buildkit.v1.frontend.CacheOptionsEntry + 61, // 34: moby.buildkit.v1.frontend.SolveRequest.FrontendInputs:type_name -> moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry + 67, // 35: moby.buildkit.v1.frontend.SolveRequest.SourcePolicies:type_name -> moby.buildkit.v1.sourcepolicy.Policy + 62, // 36: moby.buildkit.v1.frontend.CacheOptionsEntry.Attrs:type_name -> moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntry + 2, // 37: moby.buildkit.v1.frontend.SolveResponse.result:type_name -> moby.buildkit.v1.frontend.Result + 27, // 38: moby.buildkit.v1.frontend.ReadFileRequest.Range:type_name -> moby.buildkit.v1.frontend.FileRange + 70, // 39: moby.buildkit.v1.frontend.ReadDirResponse.entries:type_name -> fsutil.types.Stat + 70, // 40: moby.buildkit.v1.frontend.StatFileResponse.stat:type_name -> fsutil.types.Stat + 71, // 41: moby.buildkit.v1.frontend.PongResponse.FrontendAPICaps:type_name -> moby.buildkit.v1.apicaps.APICap + 71, // 42: moby.buildkit.v1.frontend.PongResponse.LLBCaps:type_name -> moby.buildkit.v1.apicaps.APICap + 72, // 43: moby.buildkit.v1.frontend.PongResponse.Workers:type_name -> moby.buildkit.v1.types.WorkerRecord + 73, // 44: moby.buildkit.v1.frontend.WarnRequest.info:type_name -> pb.SourceInfo + 74, // 45: moby.buildkit.v1.frontend.WarnRequest.ranges:type_name -> pb.Range + 75, // 46: moby.buildkit.v1.frontend.NewContainerRequest.Mounts:type_name -> pb.Mount + 76, // 47: moby.buildkit.v1.frontend.NewContainerRequest.Network:type_name -> pb.NetMode + 66, // 48: moby.buildkit.v1.frontend.NewContainerRequest.platform:type_name -> pb.Platform + 77, // 49: moby.buildkit.v1.frontend.NewContainerRequest.constraints:type_name -> pb.WorkerConstraints + 78, // 50: moby.buildkit.v1.frontend.NewContainerRequest.extraHosts:type_name -> pb.HostIP + 44, // 51: moby.buildkit.v1.frontend.ExecMessage.Init:type_name -> moby.buildkit.v1.frontend.InitMessage + 48, // 52: moby.buildkit.v1.frontend.ExecMessage.File:type_name -> moby.buildkit.v1.frontend.FdMessage + 49, // 53: moby.buildkit.v1.frontend.ExecMessage.Resize:type_name -> moby.buildkit.v1.frontend.ResizeMessage + 46, // 54: moby.buildkit.v1.frontend.ExecMessage.Started:type_name -> moby.buildkit.v1.frontend.StartedMessage + 45, // 55: moby.buildkit.v1.frontend.ExecMessage.Exit:type_name -> moby.buildkit.v1.frontend.ExitMessage + 47, // 56: moby.buildkit.v1.frontend.ExecMessage.Done:type_name -> moby.buildkit.v1.frontend.DoneMessage + 50, // 57: moby.buildkit.v1.frontend.ExecMessage.Signal:type_name -> moby.buildkit.v1.frontend.SignalMessage + 79, // 58: moby.buildkit.v1.frontend.InitMessage.Meta:type_name -> pb.Meta + 80, // 59: moby.buildkit.v1.frontend.InitMessage.Security:type_name -> pb.SecurityMode + 81, // 60: moby.buildkit.v1.frontend.InitMessage.secretenv:type_name -> pb.SecretEnv + 65, // 61: moby.buildkit.v1.frontend.ExitMessage.Error:type_name -> google.rpc.Status + 52, // 62: moby.buildkit.v1.frontend.Blob.descriptor:type_name -> moby.buildkit.v1.frontend.Descriptor + 63, // 63: moby.buildkit.v1.frontend.Descriptor.annotations:type_name -> moby.buildkit.v1.frontend.Descriptor.AnnotationsEntry + 6, // 64: moby.buildkit.v1.frontend.Result.AttestationsEntry.value:type_name -> moby.buildkit.v1.frontend.Attestations + 4, // 65: moby.buildkit.v1.frontend.RefMap.RefsEntry.value:type_name -> moby.buildkit.v1.frontend.Ref + 64, // 66: moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry.value:type_name -> pb.Definition + 51, // 67: moby.buildkit.v1.frontend.AttestationChain.BlobsEntry.value:type_name -> moby.buildkit.v1.frontend.Blob + 64, // 68: moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry.value:type_name -> pb.Definition + 13, // 69: moby.buildkit.v1.frontend.LLBBridge.ResolveImageConfig:input_type -> moby.buildkit.v1.frontend.ResolveImageConfigRequest + 15, // 70: moby.buildkit.v1.frontend.LLBBridge.ResolveSourceMeta:input_type -> moby.buildkit.v1.frontend.ResolveSourceMetaRequest + 23, // 71: moby.buildkit.v1.frontend.LLBBridge.Solve:input_type -> moby.buildkit.v1.frontend.SolveRequest + 26, // 72: moby.buildkit.v1.frontend.LLBBridge.ReadFile:input_type -> moby.buildkit.v1.frontend.ReadFileRequest + 29, // 73: moby.buildkit.v1.frontend.LLBBridge.ReadDir:input_type -> moby.buildkit.v1.frontend.ReadDirRequest + 31, // 74: moby.buildkit.v1.frontend.LLBBridge.StatFile:input_type -> moby.buildkit.v1.frontend.StatFileRequest + 33, // 75: moby.buildkit.v1.frontend.LLBBridge.Evaluate:input_type -> moby.buildkit.v1.frontend.EvaluateRequest + 35, // 76: moby.buildkit.v1.frontend.LLBBridge.Ping:input_type -> moby.buildkit.v1.frontend.PingRequest + 9, // 77: moby.buildkit.v1.frontend.LLBBridge.Return:input_type -> moby.buildkit.v1.frontend.ReturnRequest + 11, // 78: moby.buildkit.v1.frontend.LLBBridge.Inputs:input_type -> moby.buildkit.v1.frontend.InputsRequest + 39, // 79: moby.buildkit.v1.frontend.LLBBridge.NewContainer:input_type -> moby.buildkit.v1.frontend.NewContainerRequest + 41, // 80: moby.buildkit.v1.frontend.LLBBridge.ReleaseContainer:input_type -> moby.buildkit.v1.frontend.ReleaseContainerRequest + 43, // 81: moby.buildkit.v1.frontend.LLBBridge.ExecProcess:input_type -> moby.buildkit.v1.frontend.ExecMessage + 37, // 82: moby.buildkit.v1.frontend.LLBBridge.Warn:input_type -> moby.buildkit.v1.frontend.WarnRequest + 14, // 83: moby.buildkit.v1.frontend.LLBBridge.ResolveImageConfig:output_type -> moby.buildkit.v1.frontend.ResolveImageConfigResponse + 16, // 84: moby.buildkit.v1.frontend.LLBBridge.ResolveSourceMeta:output_type -> moby.buildkit.v1.frontend.ResolveSourceMetaResponse + 25, // 85: moby.buildkit.v1.frontend.LLBBridge.Solve:output_type -> moby.buildkit.v1.frontend.SolveResponse + 28, // 86: moby.buildkit.v1.frontend.LLBBridge.ReadFile:output_type -> moby.buildkit.v1.frontend.ReadFileResponse + 30, // 87: moby.buildkit.v1.frontend.LLBBridge.ReadDir:output_type -> moby.buildkit.v1.frontend.ReadDirResponse + 32, // 88: moby.buildkit.v1.frontend.LLBBridge.StatFile:output_type -> moby.buildkit.v1.frontend.StatFileResponse + 34, // 89: moby.buildkit.v1.frontend.LLBBridge.Evaluate:output_type -> moby.buildkit.v1.frontend.EvaluateResponse + 36, // 90: moby.buildkit.v1.frontend.LLBBridge.Ping:output_type -> moby.buildkit.v1.frontend.PongResponse + 10, // 91: moby.buildkit.v1.frontend.LLBBridge.Return:output_type -> moby.buildkit.v1.frontend.ReturnResponse + 12, // 92: moby.buildkit.v1.frontend.LLBBridge.Inputs:output_type -> moby.buildkit.v1.frontend.InputsResponse + 40, // 93: moby.buildkit.v1.frontend.LLBBridge.NewContainer:output_type -> moby.buildkit.v1.frontend.NewContainerResponse + 42, // 94: moby.buildkit.v1.frontend.LLBBridge.ReleaseContainer:output_type -> moby.buildkit.v1.frontend.ReleaseContainerResponse + 43, // 95: moby.buildkit.v1.frontend.LLBBridge.ExecProcess:output_type -> moby.buildkit.v1.frontend.ExecMessage + 38, // 96: moby.buildkit.v1.frontend.LLBBridge.Warn:output_type -> moby.buildkit.v1.frontend.WarnResponse + 83, // [83:97] is the sub-list for method output_type + 69, // [69:83] is the sub-list for method input_type + 69, // [69:69] is the sub-list for extension type_name + 69, // [69:69] is the sub-list for extension extendee + 0, // [0:69] is the sub-list for field type_name } func init() { file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_init() } @@ -3385,7 +3691,7 @@ func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_init() { (*Result_Ref)(nil), (*Result_Refs)(nil), } - file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[39].OneofWrappers = []any{ + file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes[41].OneofWrappers = []any{ (*ExecMessage_Init)(nil), (*ExecMessage_File)(nil), (*ExecMessage_Resize)(nil), @@ -3400,7 +3706,7 @@ func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc), len(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc)), NumEnums: 2, - NumMessages: 56, + NumMessages: 62, NumExtensions: 0, NumServices: 1, }, diff --git a/frontend/gateway/pb/gateway.proto b/frontend/gateway/pb/gateway.proto index f9744f2b72ea..3add95c654ad 100644 --- a/frontend/gateway/pb/gateway.proto +++ b/frontend/gateway/pb/gateway.proto @@ -135,8 +135,9 @@ message ResolveSourceMetaRequest { pb.Platform Platform = 2; string LogName = 3; string ResolveMode = 4; - repeated moby.buildkit.v1.sourcepolicy.Policy SourcePolicies = 8; ResolveSourceGitRequest Git = 5; + ResolveSourceImageRequest Image = 6; + repeated moby.buildkit.v1.sourcepolicy.Policy SourcePolicies = 8; } message ResolveSourceMetaResponse { @@ -146,9 +147,23 @@ message ResolveSourceMetaResponse { ResolveSourceHTTPResponse HTTP = 4; } +message ResolveSourceImageRequest { + bool NoConfig = 1; + bool AttestationChain = 2; +} + +message AttestationChain { + string Root = 1; + string ImageManifest = 2; + string AttestationManifest = 3; + repeated string SignatureManifests = 4; + map Blobs = 5; +} + message ResolveSourceImageResponse { string Digest = 1; bytes Config = 2; + AttestationChain AttestationChain = 3; } message ResolveSourceGitRequest { @@ -348,3 +363,15 @@ message SignalMessage { // are platform dependent. string Name = 1; } + +message Blob { + Descriptor descriptor = 1; + bytes data = 2; +} + +message Descriptor { + string media_type = 1; + string digest = 2; + int64 size = 3; + map annotations = 5; +} \ No newline at end of file diff --git a/frontend/gateway/pb/gateway_vtproto.pb.go b/frontend/gateway/pb/gateway_vtproto.pb.go index f8430fa51c59..585416809c90 100644 --- a/frontend/gateway/pb/gateway_vtproto.pb.go +++ b/frontend/gateway/pb/gateway_vtproto.pb.go @@ -386,6 +386,7 @@ func (m *ResolveSourceMetaRequest) CloneVT() *ResolveSourceMetaRequest { r.LogName = m.LogName r.ResolveMode = m.ResolveMode r.Git = m.Git.CloneVT() + r.Image = m.Image.CloneVT() if rhs := m.SourcePolicies; rhs != nil { tmpContainer := make([]*pb1.Policy, len(rhs)) for k, v := range rhs { @@ -424,12 +425,62 @@ func (m *ResolveSourceMetaResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *ResolveSourceImageRequest) CloneVT() *ResolveSourceImageRequest { + if m == nil { + return (*ResolveSourceImageRequest)(nil) + } + r := new(ResolveSourceImageRequest) + r.NoConfig = m.NoConfig + r.AttestationChain = m.AttestationChain + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResolveSourceImageRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *AttestationChain) CloneVT() *AttestationChain { + if m == nil { + return (*AttestationChain)(nil) + } + r := new(AttestationChain) + r.Root = m.Root + r.ImageManifest = m.ImageManifest + r.AttestationManifest = m.AttestationManifest + if rhs := m.SignatureManifests; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.SignatureManifests = tmpContainer + } + if rhs := m.Blobs; rhs != nil { + tmpContainer := make(map[string]*Blob, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Blobs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *AttestationChain) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *ResolveSourceImageResponse) CloneVT() *ResolveSourceImageResponse { if m == nil { return (*ResolveSourceImageResponse)(nil) } r := new(ResolveSourceImageResponse) r.Digest = m.Digest + r.AttestationChain = m.AttestationChain.CloneVT() if rhs := m.Config; rhs != nil { tmpBytes := make([]byte, len(rhs)) copy(tmpBytes, rhs) @@ -1209,6 +1260,54 @@ func (m *SignalMessage) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *Blob) CloneVT() *Blob { + if m == nil { + return (*Blob)(nil) + } + r := new(Blob) + r.Descriptor_ = m.Descriptor_.CloneVT() + if rhs := m.Data; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Data = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Blob) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Descriptor) CloneVT() *Descriptor { + if m == nil { + return (*Descriptor)(nil) + } + r := new(Descriptor) + r.MediaType = m.MediaType + r.Digest = m.Digest + r.Size = m.Size + if rhs := m.Annotations; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Annotations = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Descriptor) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *Result) EqualVT(that *Result) bool { if this == that { return true @@ -1760,6 +1859,9 @@ func (this *ResolveSourceMetaRequest) EqualVT(that *ResolveSourceMetaRequest) bo if !this.Git.EqualVT(that.Git) { return false } + if !this.Image.EqualVT(that.Image) { + return false + } if len(this.SourcePolicies) != len(that.SourcePolicies) { return false } @@ -1815,6 +1917,82 @@ func (this *ResolveSourceMetaResponse) EqualMessageVT(thatMsg proto.Message) boo } return this.EqualVT(that) } +func (this *ResolveSourceImageRequest) EqualVT(that *ResolveSourceImageRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.NoConfig != that.NoConfig { + return false + } + if this.AttestationChain != that.AttestationChain { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ResolveSourceImageRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResolveSourceImageRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *AttestationChain) EqualVT(that *AttestationChain) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Root != that.Root { + return false + } + if this.ImageManifest != that.ImageManifest { + return false + } + if this.AttestationManifest != that.AttestationManifest { + return false + } + if len(this.SignatureManifests) != len(that.SignatureManifests) { + return false + } + for i, vx := range this.SignatureManifests { + vy := that.SignatureManifests[i] + if vx != vy { + return false + } + } + if len(this.Blobs) != len(that.Blobs) { + return false + } + for i, vx := range this.Blobs { + vy, ok := that.Blobs[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &Blob{} + } + if q == nil { + q = &Blob{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *AttestationChain) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*AttestationChain) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *ResolveSourceImageResponse) EqualVT(that *ResolveSourceImageResponse) bool { if this == that { return true @@ -1827,6 +2005,9 @@ func (this *ResolveSourceImageResponse) EqualVT(that *ResolveSourceImageResponse if string(this.Config) != string(that.Config) { return false } + if !this.AttestationChain.EqualVT(that.AttestationChain) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -2932,6 +3113,65 @@ func (this *SignalMessage) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *Blob) EqualVT(that *Blob) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Descriptor_.EqualVT(that.Descriptor_) { + return false + } + if string(this.Data) != string(that.Data) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Blob) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Blob) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Descriptor) EqualVT(that *Descriptor) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MediaType != that.MediaType { + return false + } + if this.Digest != that.Digest { + return false + } + if this.Size != that.Size { + return false + } + if len(this.Annotations) != len(that.Annotations) { + return false + } + for i, vx := range this.Annotations { + vy, ok := that.Annotations[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Descriptor) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Descriptor) + if !ok { + return false + } + return this.EqualVT(that) +} func (m *Result) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -3824,6 +4064,16 @@ func (m *ResolveSourceMetaRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err dAtA[i] = 0x42 } } + if m.Image != nil { + size, err := m.Image.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } if m.Git != nil { size, err := m.Git.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -3944,7 +4194,7 @@ func (m *ResolveSourceMetaResponse) MarshalToSizedBufferVT(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *ResolveSourceImageResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ResolveSourceImageRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3957,12 +4207,12 @@ func (m *ResolveSourceImageResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResolveSourceImageResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ResolveSourceImageRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ResolveSourceImageResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ResolveSourceImageRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3974,24 +4224,30 @@ func (m *ResolveSourceImageResponse) MarshalToSizedBufferVT(dAtA []byte) (int, e i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Config) > 0 { - i -= len(m.Config) - copy(dAtA[i:], m.Config) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Config))) + if m.AttestationChain { i-- - dAtA[i] = 0x12 + if m.AttestationChain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 } - if len(m.Digest) > 0 { - i -= len(m.Digest) - copy(dAtA[i:], m.Digest) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Digest))) + if m.NoConfig { i-- - dAtA[i] = 0xa + if m.NoConfig { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *ResolveSourceGitRequest) MarshalVT() (dAtA []byte, err error) { +func (m *AttestationChain) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -4004,12 +4260,12 @@ func (m *ResolveSourceGitRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResolveSourceGitRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *AttestationChain) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ResolveSourceGitRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *AttestationChain) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4021,20 +4277,62 @@ func (m *ResolveSourceGitRequest) MarshalToSizedBufferVT(dAtA []byte) (int, erro i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.ReturnObject { - i-- - if m.ReturnObject { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Blobs) > 0 { + for k := range m.Blobs { + v := m.Blobs[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.SignatureManifests) > 0 { + for iNdEx := len(m.SignatureManifests) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SignatureManifests[iNdEx]) + copy(dAtA[i:], m.SignatureManifests[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SignatureManifests[iNdEx]))) + i-- + dAtA[i] = 0x22 } + } + if len(m.AttestationManifest) > 0 { + i -= len(m.AttestationManifest) + copy(dAtA[i:], m.AttestationManifest) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AttestationManifest))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x1a + } + if len(m.ImageManifest) > 0 { + i -= len(m.ImageManifest) + copy(dAtA[i:], m.ImageManifest) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ImageManifest))) + i-- + dAtA[i] = 0x12 + } + if len(m.Root) > 0 { + i -= len(m.Root) + copy(dAtA[i:], m.Root) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Root))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ResolveSourceGitResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ResolveSourceImageResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -4047,12 +4345,12 @@ func (m *ResolveSourceGitResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResolveSourceGitResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ResolveSourceImageResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ResolveSourceGitResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ResolveSourceImageResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4064,7 +4362,107 @@ func (m *ResolveSourceGitResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.TagObject) > 0 { + if m.AttestationChain != nil { + size, err := m.AttestationChain.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Config) > 0 { + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x12 + } + if len(m.Digest) > 0 { + i -= len(m.Digest) + copy(dAtA[i:], m.Digest) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Digest))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ResolveSourceGitRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResolveSourceGitRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResolveSourceGitRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ReturnObject { + i-- + if m.ReturnObject { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ResolveSourceGitResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResolveSourceGitResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResolveSourceGitResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.TagObject) > 0 { i -= len(m.TagObject) copy(dAtA[i:], m.TagObject) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TagObject))) @@ -5854,6 +6252,127 @@ func (m *SignalMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Blob) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Blob) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Blob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Descriptor_ != nil { + size, err := m.Descriptor_.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Descriptor) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Descriptor) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Descriptor) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x18 + } + if len(m.Digest) > 0 { + i -= len(m.Digest) + copy(dAtA[i:], m.Digest) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Digest))) + i-- + dAtA[i] = 0x12 + } + if len(m.MediaType) > 0 { + i -= len(m.MediaType) + copy(dAtA[i:], m.MediaType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MediaType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Result) SizeVT() (n int) { if m == nil { return 0 @@ -6237,6 +6756,10 @@ func (m *ResolveSourceMetaRequest) SizeVT() (n int) { l = m.Git.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Image != nil { + l = m.Image.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } if len(m.SourcePolicies) > 0 { for _, e := range m.SourcePolicies { l = e.SizeVT() @@ -6273,6 +6796,63 @@ func (m *ResolveSourceMetaResponse) SizeVT() (n int) { return n } +func (m *ResolveSourceImageRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoConfig { + n += 2 + } + if m.AttestationChain { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *AttestationChain) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Root) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.ImageManifest) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.AttestationManifest) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.SignatureManifests) > 0 { + for _, s := range m.SignatureManifests { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Blobs) > 0 { + for k, v := range m.Blobs { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + func (m *ResolveSourceImageResponse) SizeVT() (n int) { if m == nil { return 0 @@ -6287,6 +6867,10 @@ func (m *ResolveSourceImageResponse) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.AttestationChain != nil { + l = m.AttestationChain.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -7030,8 +7614,55 @@ func (m *SignalMessage) SizeVT() (n int) { return n } -func (m *Result) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) +func (m *Blob) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Descriptor_ != nil { + l = m.Descriptor_.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Descriptor) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MediaType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Digest) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Size != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Result) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx @@ -9584,6 +10215,42 @@ func (m *ResolveSourceMetaRequest) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Image == nil { + m.Image = &ResolveSourceImageRequest{} + } + if err := m.Image.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SourcePolicies", wireType) @@ -9835,7 +10502,7 @@ func (m *ResolveSourceMetaResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ResolveSourceImageResponse) UnmarshalVT(dAtA []byte) error { +func (m *ResolveSourceImageRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9858,17 +10525,17 @@ func (m *ResolveSourceImageResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResolveSourceImageResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ResolveSourceImageRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveSourceImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResolveSourceImageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoConfig", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9878,112 +10545,15 @@ func (m *ResolveSourceImageResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Digest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.NoConfig = bool(v != 0) case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Config = append(m.Config[:0], dAtA[iNdEx:postIndex]...) - if m.Config == nil { - m.Config = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResolveSourceGitRequest) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResolveSourceGitRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveSourceGitRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReturnObject", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttestationChain", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -10000,7 +10570,7 @@ func (m *ResolveSourceGitRequest) UnmarshalVT(dAtA []byte) error { break } } - m.ReturnObject = bool(v != 0) + m.AttestationChain = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -10023,7 +10593,7 @@ func (m *ResolveSourceGitRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { +func (m *AttestationChain) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10046,15 +10616,15 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResolveSourceGitResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AttestationChain: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveSourceGitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AttestationChain: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10082,11 +10652,11 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Checksum = string(dAtA[iNdEx:postIndex]) + m.Root = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ImageManifest", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10114,11 +10684,11 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ref = string(dAtA[iNdEx:postIndex]) + m.ImageManifest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitChecksum", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttestationManifest", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10146,13 +10716,13 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CommitChecksum = string(dAtA[iNdEx:postIndex]) + m.AttestationManifest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitObject", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignatureManifests", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10162,31 +10732,29 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.CommitObject = append(m.CommitObject[:0], dAtA[iNdEx:postIndex]...) - if m.CommitObject == nil { - m.CommitObject = []byte{} - } + m.SignatureManifests = append(m.SignatureManifests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TagObject", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Blobs", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10196,60 +10764,155 @@ func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.TagObject = append(m.TagObject[:0], dAtA[iNdEx:postIndex]...) - if m.TagObject == nil { - m.TagObject = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.Blobs == nil { + m.Blobs = make(map[string]*Blob) + } + var mapkey string + var mapvalue *Blob + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Blob{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Blobs[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResolveSourceImageResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ @@ -10261,15 +10924,15 @@ func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResolveSourceHTTPResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ResolveSourceImageResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveSourceHTTPResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResolveSourceImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10297,13 +10960,13 @@ func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Checksum = string(dAtA[iNdEx:postIndex]) + m.Digest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10313,27 +10976,29 @@ func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Filename = string(dAtA[iNdEx:postIndex]) + m.Config = append(m.Config[:0], dAtA[iNdEx:postIndex]...) + if m.Config == nil { + m.Config = []byte{} + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastModified", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttestationChain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10360,10 +11025,10 @@ func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LastModified == nil { - m.LastModified = ×tamp.Timestamp{} + if m.AttestationChain == nil { + m.AttestationChain = &AttestationChain{} } - if err := (*timestamppb.Timestamp)(m.LastModified).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AttestationChain.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -10389,7 +11054,7 @@ func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { +func (m *ResolveSourceGitRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10412,17 +11077,17 @@ func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SolveRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ResolveSourceGitRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SolveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResolveSourceGitRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReturnObject", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10432,31 +11097,66 @@ func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength + m.ReturnObject = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Definition == nil { - m.Definition = &pb.Definition{} + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResolveSourceGitResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - if err := m.Definition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 2: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResolveSourceGitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResolveSourceGitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Frontend", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10484,13 +11184,13 @@ func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Frontend = string(dAtA[iNdEx:postIndex]) + m.Checksum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrontendOpt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10500,28 +11200,430 @@ func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.FrontendOpt == nil { - m.FrontendOpt = make(map[string]string) + m.Ref = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitChecksum", wireType) } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommitChecksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitObject", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommitObject = append(m.CommitObject[:0], dAtA[iNdEx:postIndex]...) + if m.CommitObject == nil { + m.CommitObject = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TagObject", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TagObject = append(m.TagObject[:0], dAtA[iNdEx:postIndex]...) + if m.TagObject == nil { + m.TagObject = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResolveSourceHTTPResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResolveSourceHTTPResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResolveSourceHTTPResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastModified", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastModified == nil { + m.LastModified = ×tamp.Timestamp{} + } + if err := (*timestamppb.Timestamp)(m.LastModified).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SolveRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SolveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SolveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Definition == nil { + m.Definition = &pb.Definition{} + } + if err := m.Definition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Frontend", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Frontend = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontendOpt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrontendOpt == nil { + m.FrontendOpt = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -13735,7 +14837,111 @@ func (m *InitMessage) UnmarshalVT(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Security", wireType) } - m.Security = 0 + m.Security = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Security |= pb.SecurityMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Secretenv", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Secretenv = append(m.Secretenv, &pb.SecretEnv{}) + if err := m.Secretenv[len(m.Secretenv)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExitMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExitMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13745,14 +14951,14 @@ func (m *InitMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Security |= pb.SecurityMode(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secretenv", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13779,9 +14985,19 @@ func (m *InitMessage) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Secretenv = append(m.Secretenv, &pb.SecretEnv{}) - if err := m.Secretenv[len(m.Secretenv)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Error == nil { + m.Error = &status.Status{} + } + if unmarshal, ok := interface{}(m.Error).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Error); err != nil { + return err + } } iNdEx = postIndex default: @@ -13806,7 +15022,7 @@ func (m *InitMessage) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { +func (m *StartedMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13829,17 +15045,119 @@ func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExitMessage: wiretype end group for non-group") + return fmt.Errorf("proto: StartedMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExitMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StartedMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DoneMessage) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DoneMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DoneMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FdMessage) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FdMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FdMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fd", wireType) } - m.Code = 0 + m.Fd = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13849,16 +15167,36 @@ func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + m.Fd |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EOF", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EOF = bool(v != 0) + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13868,34 +15206,24 @@ func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Error == nil { - m.Error = &status.Status{} - } - if unmarshal, ok := interface{}(m.Error).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Error); err != nil { - return err - } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } iNdEx = postIndex default: @@ -13920,7 +15248,7 @@ func (m *ExitMessage) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StartedMessage) UnmarshalVT(dAtA []byte) error { +func (m *ResizeMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13943,12 +15271,50 @@ func (m *StartedMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StartedMessage: wiretype end group for non-group") + return fmt.Errorf("proto: ResizeMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StartedMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResizeMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rows", wireType) + } + m.Rows = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rows |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cols", wireType) + } + m.Cols = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Cols |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13971,7 +15337,7 @@ func (m *StartedMessage) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *DoneMessage) UnmarshalVT(dAtA []byte) error { +func (m *SignalMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13994,12 +15360,44 @@ func (m *DoneMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DoneMessage: wiretype end group for non-group") + return fmt.Errorf("proto: SignalMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DoneMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignalMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -14022,7 +15420,7 @@ func (m *DoneMessage) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FdMessage) UnmarshalVT(dAtA []byte) error { +func (m *Blob) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14045,17 +15443,17 @@ func (m *FdMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FdMessage: wiretype end group for non-group") + return fmt.Errorf("proto: Blob: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FdMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Blob: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fd", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Descriptor_", wireType) } - m.Fd = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14065,32 +15463,29 @@ func (m *FdMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Fd |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EOF", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - m.EOF = bool(v != 0) - case 3: + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Descriptor_ == nil { + m.Descriptor_ = &Descriptor{} + } + if err := m.Descriptor_.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } @@ -14146,7 +15541,7 @@ func (m *FdMessage) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ResizeMessage) UnmarshalVT(dAtA []byte) error { +func (m *Descriptor) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14169,17 +15564,17 @@ func (m *ResizeMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResizeMessage: wiretype end group for non-group") + return fmt.Errorf("proto: Descriptor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResizeMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Descriptor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rows", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType) } - m.Rows = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14189,16 +15584,29 @@ func (m *ResizeMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Rows |= uint32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MediaType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cols", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) } - m.Cols = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14208,67 +15616,48 @@ func (m *ResizeMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Cols |= uint32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + intStringLen + if postIndex < 0 { return protohelpers.ErrInvalidLength } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignalMessage) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.Digest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignalMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignalMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14278,23 +15667,118 @@ func (m *SignalMessage) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex diff --git a/go.mod b/go.mod index 472f624fd582..96906ac40cd7 100644 --- a/go.mod +++ b/go.mod @@ -52,6 +52,7 @@ require ( github.com/moby/go-archive v0.1.0 github.com/moby/locker v1.0.1 github.com/moby/patternmatcher v0.6.0 + github.com/moby/policy-helpers v0.0.0-20251105011237-bcaa71c99f14 github.com/moby/profiles/seccomp v0.1.0 github.com/moby/sys/mountinfo v0.7.2 github.com/moby/sys/reexec v0.1.0 @@ -102,7 +103,7 @@ require ( golang.org/x/crypto v0.42.0 golang.org/x/exp v0.0.0-20250911091902-df9299821621 golang.org/x/mod v0.29.0 - golang.org/x/net v0.43.0 + golang.org/x/net v0.44.0 golang.org/x/sync v0.17.0 golang.org/x/sys v0.37.0 golang.org/x/time v0.14.0 @@ -145,6 +146,7 @@ require ( github.com/dimchansky/utfbom v1.1.1 // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-metrics v0.0.1 // indirect + github.com/fatih/color v1.18.0 // indirect github.com/felixge/fgprof v0.9.3 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect @@ -159,6 +161,7 @@ require ( github.com/hanwen/go-fuse/v2 v2.8.0 // indirect github.com/hashicorp/go-retryablehttp v0.7.8 // indirect github.com/kylelemons/godebug v1.1.0 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect github.com/moby/sys/capability v0.4.0 // indirect github.com/moby/sys/mount v0.3.4 // indirect github.com/moby/sys/sequential v0.6.0 // indirect @@ -176,7 +179,7 @@ require ( github.com/vbatts/tar-split v0.12.1 // indirect github.com/vishvananda/netns v0.0.5 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/otel/metric v1.38.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect golang.org/x/text v0.29.0 // indirect diff --git a/go.sum b/go.sum index be355a66ac61..dc725a7a0077 100644 --- a/go.sum +++ b/go.sum @@ -77,6 +77,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= @@ -160,8 +161,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -264,8 +265,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -279,6 +280,8 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/policy-helpers v0.0.0-20251105011237-bcaa71c99f14 h1:JO22uXMy3CN7wh7A/wrtYQWV1WYQMg2gh6d8YO325k4= +github.com/moby/policy-helpers v0.0.0-20251105011237-bcaa71c99f14/go.mod h1:HJfK0E8dR+Jpk5anJ3oADg2dRSom1gJK17sqEiiMS7w= github.com/moby/profiles/seccomp v0.1.0 h1:kVf1lc5ytNB1XPxEdZUVF+oPpbBYJHR50eEvPt/9k8A= github.com/moby/profiles/seccomp v0.1.0/go.mod h1:Kqk57vxH6/wuOc5bmqRiSXJ6iEz8Pvo3LQRkv0ytFWs= github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= @@ -356,8 +359,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= @@ -425,8 +428,8 @@ go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 h1:lREC4C0ilyP4WibDhQ7Gg2ygAQFP8oR07Fst/5cafwI= @@ -494,8 +497,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/solver/llbsolver/bridge.go b/solver/llbsolver/bridge.go index 323863e5c1f6..278337f466f5 100644 --- a/solver/llbsolver/bridge.go +++ b/solver/llbsolver/bridge.go @@ -30,6 +30,7 @@ import ( "github.com/moby/buildkit/util/progress" "github.com/moby/buildkit/worker" digest "github.com/opencontainers/go-digest" + ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) @@ -357,8 +358,16 @@ func (b *llbBridge) ResolveSourceMetadata(ctx context.Context, op *pb.SourceOp, opt.LogName = fmt.Sprintf("resolve image config for %s", op.Identifier) } id := op.Identifier - if opt.Platform != nil { - id += platforms.FormatAll(*opt.Platform) + + var platform *ocispecs.Platform + if opt.ImageOpt != nil && opt.ImageOpt.Platform != nil { + platform = opt.ImageOpt.Platform + } else if opt.OCILayoutOpt != nil && opt.OCILayoutOpt.Platform != nil { + platform = opt.OCILayoutOpt.Platform + } + + if platform != nil { + id += platforms.FormatAll(*platform) } else { id += platforms.FormatAll(platforms.DefaultSpec()) } diff --git a/solver/llbsolver/provenance.go b/solver/llbsolver/provenance.go index ae8202f082f1..dc974369d51d 100644 --- a/solver/llbsolver/provenance.go +++ b/solver/llbsolver/provenance.go @@ -146,9 +146,15 @@ func (b *provenanceBridge) ResolveSourceMetadata(ctx context.Context, op *pb.Sou ref := strings.TrimPrefix(resp.Op.Identifier, "docker-image://") ref = strings.TrimPrefix(ref, "oci-layout://") b.mu.Lock() + var platform *ocispecs.Platform + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + platform = imgOpt.Platform + } else if ociOpt := opt.OCILayoutOpt; ociOpt != nil && ociOpt.Platform != nil { + platform = ociOpt.Platform + } b.images = append(b.images, provenancetypes.ImageSource{ Ref: ref, - Platform: opt.Platform, + Platform: platform, Digest: img.Digest, Local: local, }) diff --git a/source/containerimage/source.go b/source/containerimage/source.go index 073d384665ff..ac118f829a1d 100644 --- a/source/containerimage/source.go +++ b/source/containerimage/source.go @@ -9,7 +9,6 @@ import ( "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/containerd/v2/pkg/reference" "github.com/containerd/platforms" @@ -22,11 +21,13 @@ import ( "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/source" srctypes "github.com/moby/buildkit/source/types" + "github.com/moby/buildkit/util/contentutil" "github.com/moby/buildkit/util/flightcontrol" "github.com/moby/buildkit/util/imageutil" "github.com/moby/buildkit/util/pull" "github.com/moby/buildkit/util/resolver" "github.com/moby/buildkit/util/tracing" + policyimage "github.com/moby/policy-helpers/image" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -55,7 +56,8 @@ type SourceOpt struct { type Source struct { SourceOpt - g flightcontrol.Group[*resolveImageResult] + gImageRes flightcontrol.Group[*resolveImageResult] + gAttestChain flightcontrol.Group[*sourceresolver.AttestationChain] } var _ source.Source = &Source{} @@ -64,7 +66,6 @@ func NewSource(opt SourceOpt) (*Source, error) { is := &Source{ SourceOpt: opt, } - return is, nil } @@ -153,43 +154,133 @@ func (is *Source) Resolve(ctx context.Context, id source.Identifier, sm *session return p, nil } -func (is *Source) ResolveImageConfig(ctx context.Context, ref string, opt sourceresolver.Opt, sm *session.Manager, g session.Group) (digest digest.Digest, config []byte, retErr error) { +func (is *Source) ResolveImageMetadata(ctx context.Context, id *ImageIdentifier, opt *sourceresolver.ResolveImageOpt, sm *session.Manager, g session.Group) (_ *sourceresolver.ResolveImageResponse, retErr error) { + if is.ResolverType != ResolverTypeRegistry { + return nil, errors.Errorf("invalid resolver type for image metadata: %v", is.ResolverType) + } + ref := id.Reference.String() + span, ctx := tracing.StartSpan(ctx, "resolving "+ref) defer func() { tracing.FinishWithError(span, retErr) }() key := ref - var ( - rm resolver.ResolveMode - rslvr remotes.Resolver - err error - ) if platform := opt.Platform; platform != nil { key += platforms.FormatAll(*platform) } + rm, err := resolver.ParseImageResolveMode(opt.ResolveMode) + if err != nil { + return nil, err + } + rslvr := resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g).WithImageStore(is.ImageStore, rm) + key += rm.String() - switch is.ResolverType { - case ResolverTypeRegistry: - iopt := opt.ImageOpt - if iopt == nil { - return "", nil, errors.Errorf("missing imageopt for resolve") + ret := &sourceresolver.ResolveImageResponse{} + if !opt.NoConfig { + res, err := is.gImageRes.Do(ctx, key, func(ctx context.Context) (*resolveImageResult, error) { + dgst, dt, err := imageutil.Config(ctx, ref, rslvr, is.ContentStore, is.LeaseManager, opt.Platform) + if err != nil { + return nil, err + } + return &resolveImageResult{dgst: dgst, dt: dt}, nil + }) + if err != nil { + return nil, err } - rm, err = resolver.ParseImageResolveMode(iopt.ResolveMode) + ret.Digest = res.dgst + ret.Config = res.dt + } + if opt.AttestationChain { + res, err := is.gAttestChain.Do(ctx, key, func(ctx context.Context) (*sourceresolver.AttestationChain, error) { + refStr, desc, err := rslvr.Resolve(ctx, ref) + if err != nil { + return nil, err + } + f, err := rslvr.Fetcher(ctx, refStr) + if err != nil { + return nil, err + } + prov := contentutil.FromFetcher(f) + sc, err := policyimage.ResolveSignatureChain(ctx, prov, desc, opt.Platform) + if err != nil { + return nil, err + } + ac := &sourceresolver.AttestationChain{ + Root: desc.Digest, + } + descs := []ocispecs.Descriptor{desc} + if sc.ImageManifest != nil { + // not adding image manifest to descs as it is not really needed for verification + // still adding digest to provide hint of what the image manifest was resolved by platform + // for better debugging experience and error messages + ac.ImageManifest = sc.ImageManifest.Digest + } + if sc.AttestationManifest != nil { + ac.AttestationManifest = sc.AttestationManifest.Digest + descs = append(descs, sc.AttestationManifest.Descriptor) + } + if sc.SignatureManifest != nil { + ac.SignatureManifests = []digest.Digest{sc.SignatureManifest.Digest} + descs = append(descs, sc.SignatureManifest.Descriptor) + mfst, err := sc.OCIManifest(ctx, sc.SignatureManifest) + if err != nil { + return nil, err + } + descs = append(descs, mfst.Layers...) + } + for _, desc := range descs { + dt, err := policyimage.ReadBlob(ctx, prov, desc) + if err != nil { + return nil, err + } + if ac.Blobs == nil { + ac.Blobs = make(map[digest.Digest]sourceresolver.Blob) + } + ac.Blobs[desc.Digest] = sourceresolver.Blob{ + Descriptor: desc, + Data: dt, + } + } + return ac, nil + }) if err != nil { - return "", nil, err + return nil, err } - rslvr = resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g).WithImageStore(is.ImageStore, rm) - case ResolverTypeOCILayout: - iopt := opt.OCILayoutOpt - if iopt == nil { - return "", nil, errors.Errorf("missing ocilayoutopt for resolve") + ret.AttestationChain = res + if ret.Digest == "" { + ret.Digest = res.Root + } else if ret.Digest != res.Root { + return nil, errors.Errorf("attestation chain root digest %s does not match image digest %s", res.Root, ret.Digest) } - rm = resolver.ResolveModeForcePull - rslvr = getOCILayoutResolver(iopt.Store, sm, g) } - key += rm.String() - res, err := is.g.Do(ctx, key, func(ctx context.Context) (*resolveImageResult, error) { + return ret, nil +} + +func (is *Source) ResolveOCILayoutMetadata(ctx context.Context, id *OCIIdentifier, opt *sourceresolver.ResolveOCILayoutOpt, sm *session.Manager, g session.Group) (_ *sourceresolver.ResolveImageResponse, retErr error) { + if is.ResolverType != ResolverTypeOCILayout { + return nil, errors.Errorf("invalid resolver type for image metadata: %v", is.ResolverType) + } + ref := id.Reference.String() + + span, ctx := tracing.StartSpan(ctx, "resolving "+ref) + defer func() { + tracing.FinishWithError(span, retErr) + }() + + key := ref + if platform := opt.Platform; platform != nil { + key += platforms.FormatAll(*platform) + } + + if opt.Store.StoreID == "" { + opt.Store.StoreID = id.StoreID + } + + rslvr := getOCILayoutResolver(opt.Store, sm, g) + key += resolver.ResolveModeForcePull.String() + + res, err := is.gImageRes.Do(ctx, key, func(ctx context.Context) (*resolveImageResult, error) { dgst, dt, err := imageutil.Config(ctx, ref, rslvr, is.ContentStore, is.LeaseManager, opt.Platform) if err != nil { return nil, err @@ -197,9 +288,12 @@ func (is *Source) ResolveImageConfig(ctx context.Context, ref string, opt source return &resolveImageResult{dgst: dgst, dt: dt}, nil }) if err != nil { - return "", nil, err + return nil, err } - return res.dgst, res.dt, nil + return &sourceresolver.ResolveImageResponse{ + Digest: res.dgst, + Config: res.dt, + }, nil } type resolveImageResult struct { diff --git a/util/contentutil/fetcher.go b/util/contentutil/fetcher.go index 560b9fcfcfb6..bb5f12d50ff9 100644 --- a/util/contentutil/fetcher.go +++ b/util/contentutil/fetcher.go @@ -6,11 +6,17 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/remotes" + digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) -func FromFetcher(f remotes.Fetcher) content.Provider { +type ReferrersProvider interface { + content.Provider + remotes.ReferrersFetcher +} + +func FromFetcher(f remotes.Fetcher) ReferrersProvider { return &fetchedProvider{ f: f, } @@ -29,6 +35,14 @@ func (p *fetchedProvider) ReaderAt(ctx context.Context, desc ocispecs.Descriptor return &readerAt{Reader: rc, Closer: rc, size: desc.Size}, nil } +func (p *fetchedProvider) FetchReferrers(ctx context.Context, dgst digest.Digest, opts ...remotes.FetchReferrersOpt) ([]ocispecs.Descriptor, error) { + refs, ok := p.f.(remotes.ReferrersFetcher) + if !ok { + return nil, errors.Errorf("fetcher does not support referrers") + } + return refs.FetchReferrers(ctx, dgst, opts...) +} + type readerAt struct { io.Reader io.Closer diff --git a/vendor/github.com/moby/policy-helpers/image/resolve.go b/vendor/github.com/moby/policy-helpers/image/resolve.go new file mode 100644 index 000000000000..e1d14d555cc4 --- /dev/null +++ b/vendor/github.com/moby/policy-helpers/image/resolve.go @@ -0,0 +1,207 @@ +package image + +import ( + "context" + "encoding/json" + "slices" + "sort" + "sync" + + "github.com/containerd/containerd/v2/core/content" + "github.com/containerd/containerd/v2/core/images" + "github.com/containerd/containerd/v2/core/remotes" + cerrdefs "github.com/containerd/errdefs" + "github.com/containerd/platforms" + digest "github.com/opencontainers/go-digest" + ocispecs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/pkg/errors" +) + +type ReferrersProvider interface { + content.Provider + remotes.ReferrersFetcher +} + +const ( + AnnotationDockerReferenceDigest = "vnd.docker.reference.digest" + AnnotationDockerReferenceType = "vnd.docker.reference.type" + AttestationManifestType = "attestation-manifest" +) + +const ( + ArtifactTypeCosignSignature = "application/vnd.dev.cosign.artifact.sig.v1+json" + ArtifactTypeSigstoreBundle = "application/vnd.dev.sigstore.bundle.v0.3+json" + MediaTypeCosignSimpleSigning = "application/vnd.dev.cosign.simplesigning.v1+json" +) + +func resolveImageManifest(idx ocispecs.Index, platform ocispecs.Platform) (ocispecs.Descriptor, error) { + pMatcher := platforms.Only(platform) + + var descs []ocispecs.Descriptor + for _, d := range idx.Manifests { + // TODO: confirm handling of nested indexes + if !images.IsManifestType(d.MediaType) { + continue + } + if d.Platform == nil || pMatcher.Match(*d.Platform) { + descs = append(descs, d) + } + } + + sort.SliceStable(descs, func(i, j int) bool { + if descs[i].Platform == nil { + return false + } + if descs[j].Platform == nil { + return true + } + return pMatcher.Less(*descs[i].Platform, *descs[j].Platform) + }) + + if len(descs) == 0 { + return ocispecs.Descriptor{}, errors.Wrapf(cerrdefs.ErrNotFound, "no manifest for platform %+v", platforms.FormatAll(platform)) + } + return descs[0], nil +} + +type Manifest struct { + ocispecs.Descriptor + mu sync.Mutex + manifest *ocispecs.Manifest + data []byte +} + +type SignatureChain struct { + ImageManifest *Manifest + AttestationManifest *Manifest + SignatureManifest *Manifest + Provider content.Provider +} + +func (sc *SignatureChain) ManifestBytes(ctx context.Context, m *Manifest) ([]byte, error) { + m.mu.Lock() + defer m.mu.Unlock() + if m.data != nil { + return m.data, nil + } + dt, err := ReadBlob(ctx, sc.Provider, m.Descriptor) + if err != nil { + return nil, err + } + m.data = dt + return dt, nil +} + +func (sc *SignatureChain) OCIManifest(ctx context.Context, m *Manifest) (*ocispecs.Manifest, error) { + m.mu.Lock() + if m.manifest != nil { + m.mu.Unlock() + return m.manifest, nil + } + m.mu.Unlock() + dt, err := sc.ManifestBytes(ctx, m) + if err != nil { + return nil, err + } + var manifest ocispecs.Manifest + if err := json.Unmarshal(dt, &manifest); err != nil { + return nil, errors.Wrapf(err, "unmarshaling manifest %s", m.Digest) + } + m.mu.Lock() + m.manifest = &manifest + m.mu.Unlock() + return &manifest, nil +} + +func ResolveSignatureChain(ctx context.Context, provider ReferrersProvider, desc ocispecs.Descriptor, platform *ocispecs.Platform) (*SignatureChain, error) { + if desc.MediaType != ocispecs.MediaTypeImageIndex { + return nil, errors.Errorf("expected image index descriptor, got %s", desc.MediaType) + } + + dt, err := ReadBlob(ctx, provider, desc) + if err != nil { + return nil, err + } + var index ocispecs.Index + if err := json.Unmarshal(dt, &index); err != nil { + return nil, errors.Wrapf(err, "unmarshaling image index") + } + + if platform == nil { + p := platforms.Normalize(platforms.DefaultSpec()) + platform = &p + } + + manifestDesc, err := resolveImageManifest(index, *platform) + if err != nil { + return nil, errors.Wrapf(err, "resolving image manifest for platform %+v", platform) + } + + var attestationDesc *ocispecs.Descriptor + for _, d := range index.Manifests { + if d.Annotations[AnnotationDockerReferenceType] == AttestationManifestType && d.Annotations[AnnotationDockerReferenceDigest] == manifestDesc.Digest.String() { + attestationDesc = &d + break + } + } + sh := &SignatureChain{ + ImageManifest: &Manifest{ + Descriptor: manifestDesc, + }, + Provider: provider, + } + + if attestationDesc == nil { + return sh, nil + } + + sh.AttestationManifest = &Manifest{ + Descriptor: *attestationDesc, + } + + // currently not setting WithReferrerArtifactTypes in here as some registries(e.g. aws) don't know how to filter two types at once. + allRefs, err := provider.FetchReferrers(ctx, attestationDesc.Digest) + if err != nil { + return nil, errors.Wrapf(err, "fetching referrers for attestation manifest %s", attestationDesc.Digest) + } + + refs := make([]ocispecs.Descriptor, 0, len(allRefs)) + for _, r := range allRefs { + if r.ArtifactType == ArtifactTypeSigstoreBundle || r.ArtifactType == ArtifactTypeCosignSignature { + refs = append(refs, r) + } + } + + if len(refs) == 0 { + return sh, nil + } + + // only allowing one signature manifest for now + // if multiple are found, prefer bundle format + slices.SortStableFunc(refs, func(a, b ocispecs.Descriptor) int { + aIsBundle := a.ArtifactType == ArtifactTypeSigstoreBundle + bIsBundle := b.ArtifactType == ArtifactTypeSigstoreBundle + if aIsBundle && !bIsBundle { + return -1 + } else if !aIsBundle && bIsBundle { + return 1 + } + return 0 + }) + + sh.SignatureManifest = &Manifest{ + Descriptor: refs[0], + } + return sh, nil +} + +func ReadBlob(ctx context.Context, provider content.Provider, desc ocispecs.Descriptor) ([]byte, error) { + dt, err := content.ReadBlob(ctx, provider, desc) + if err != nil { + return nil, errors.Wrapf(err, "reading blob %s", desc.Digest) + } + if desc.Digest != digest.FromBytes(dt) { + return nil, errors.Wrapf(err, "digest mismatch for blob %s", desc.Digest) + } + return dt, nil +} diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go index e854d7e84e86..2950fdb42eea 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go @@ -82,7 +82,7 @@ func marshalJSON(id []byte) ([]byte, error) { } // unmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. -func unmarshalJSON(dst []byte, src []byte) error { +func unmarshalJSON(dst, src []byte) error { if l := len(src); l >= 2 && src[0] == '"' && src[l-1] == '"' { src = src[1 : l-1] } diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go index 29e629d6674d..5bb3b16c704c 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go @@ -41,7 +41,7 @@ func (i *protoInt64) UnmarshalJSON(data []byte) error { // strings or integers. type protoUint64 uint64 -// Int64 returns the protoUint64 as a uint64. +// Uint64 returns the protoUint64 as a uint64. func (i *protoUint64) Uint64() uint64 { return uint64(*i) } // UnmarshalJSON decodes both strings and integers. diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go index a13a6b733da8..67f80b6aa078 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "math" "time" ) @@ -151,8 +152,8 @@ func (s Span) MarshalJSON() ([]byte, error) { }{ Alias: Alias(s), ParentSpanID: parentSpanId, - StartTime: uint64(startT), - EndTime: uint64(endT), + StartTime: uint64(startT), // nolint:gosec // >0 checked above. + EndTime: uint64(endT), // nolint:gosec // >0 checked above. }) } @@ -201,11 +202,13 @@ func (s *Span) UnmarshalJSON(data []byte) error { case "startTimeUnixNano", "start_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) - s.StartTime = time.Unix(0, int64(val.Uint64())) + v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. + s.StartTime = time.Unix(0, v) case "endTimeUnixNano", "end_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) - s.EndTime = time.Unix(0, int64(val.Uint64())) + v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. + s.EndTime = time.Unix(0, v) case "attributes": err = decoder.Decode(&s.Attrs) case "droppedAttributesCount", "dropped_attributes_count": @@ -248,13 +251,20 @@ func (s *Span) UnmarshalJSON(data []byte) error { type SpanFlags int32 const ( + // SpanFlagsTraceFlagsMask is a mask for trace-flags. + // // Bits 0-7 are used for trace flags. SpanFlagsTraceFlagsMask SpanFlags = 255 - // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. - // Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote. + // SpanFlagsContextHasIsRemoteMask is a mask for HAS_IS_REMOTE status. + // + // Bits 8 and 9 are used to indicate that the parent span or link span is + // remote. Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. SpanFlagsContextHasIsRemoteMask SpanFlags = 256 - // SpanFlagsContextHasIsRemoteMask indicates the Span is remote. + // SpanFlagsContextIsRemoteMask is a mask for IS_REMOTE status. + // + // Bits 8 and 9 are used to indicate that the parent span or link span is + // remote. Bit 9 (`IS_REMOTE`) indicates whether the span or link is + // remote. SpanFlagsContextIsRemoteMask SpanFlags = 512 ) @@ -263,26 +273,30 @@ const ( type SpanKind int32 const ( - // Indicates that the span represents an internal operation within an application, - // as opposed to an operation happening at the boundaries. Default value. + // SpanKindInternal indicates that the span represents an internal + // operation within an application, as opposed to an operation happening at + // the boundaries. SpanKindInternal SpanKind = 1 - // Indicates that the span covers server-side handling of an RPC or other - // remote network request. + // SpanKindServer indicates that the span covers server-side handling of an + // RPC or other remote network request. SpanKindServer SpanKind = 2 - // Indicates that the span describes a request to some remote service. + // SpanKindClient indicates that the span describes a request to some + // remote service. SpanKindClient SpanKind = 3 - // Indicates that the span describes a producer sending a message to a broker. - // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship - // between producer and consumer spans. A PRODUCER span ends when the message was accepted - // by the broker while the logical processing of the message might span a much longer time. + // SpanKindProducer indicates that the span describes a producer sending a + // message to a broker. Unlike SpanKindClient and SpanKindServer, there is + // often no direct critical path latency relationship between producer and + // consumer spans. A SpanKindProducer span ends when the message was + // accepted by the broker while the logical processing of the message might + // span a much longer time. SpanKindProducer SpanKind = 4 - // Indicates that the span describes consumer receiving a message from a broker. - // Like the PRODUCER kind, there is often no direct critical path latency relationship - // between producer and consumer spans. + // SpanKindConsumer indicates that the span describes a consumer receiving + // a message from a broker. Like SpanKindProducer, there is often no direct + // critical path latency relationship between producer and consumer spans. SpanKindConsumer SpanKind = 5 ) -// Event is a time-stamped annotation of the span, consisting of user-supplied +// SpanEvent is a time-stamped annotation of the span, consisting of user-supplied // text description and key-value pairs. type SpanEvent struct { // time_unix_nano is the time the event occurred. @@ -312,7 +326,7 @@ func (e SpanEvent) MarshalJSON() ([]byte, error) { Time uint64 `json:"timeUnixNano,omitempty"` }{ Alias: Alias(e), - Time: uint64(t), + Time: uint64(t), //nolint:gosec // >0 checked above }) } @@ -347,7 +361,8 @@ func (se *SpanEvent) UnmarshalJSON(data []byte) error { case "timeUnixNano", "time_unix_nano": var val protoUint64 err = decoder.Decode(&val) - se.Time = time.Unix(0, int64(val.Uint64())) + v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. + se.Time = time.Unix(0, v) case "name": err = decoder.Decode(&se.Name) case "attributes": @@ -365,10 +380,11 @@ func (se *SpanEvent) UnmarshalJSON(data []byte) error { return nil } -// A pointer from the current span to another span in the same trace or in a -// different trace. For example, this can be used in batching operations, -// where a single batch handler processes multiple requests from different -// traces or when the handler receives a request from a different project. +// SpanLink is a reference from the current span to another span in the same +// trace or in a different trace. For example, this can be used in batching +// operations, where a single batch handler processes multiple requests from +// different traces or when the handler receives a request from a different +// project. type SpanLink struct { // A unique identifier of a trace that this linked span is part of. The ID is a // 16-byte array. diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go index 1217776ead1e..a2802764f811 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go @@ -3,17 +3,19 @@ package telemetry +// StatusCode is the status of a Span. +// // For the semantics of status codes see // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode int32 const ( - // The default status. + // StatusCodeUnset is the default status. StatusCodeUnset StatusCode = 0 - // The Span has been validated by an Application developer or Operator to - // have completed successfully. + // StatusCodeOK is used when the Span has been validated by an Application + // developer or Operator to have completed successfully. StatusCodeOK StatusCode = 1 - // The Span contains an error. + // StatusCodeError is used when the Span contains an error. StatusCodeError StatusCode = 2 ) diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go index 69a348f0f064..44197b80849c 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go @@ -71,7 +71,7 @@ func (td *Traces) UnmarshalJSON(data []byte) error { return nil } -// A collection of ScopeSpans from a Resource. +// ResourceSpans is a collection of ScopeSpans from a Resource. type ResourceSpans struct { // The resource for the spans in this message. // If this field is not set then no resource info is known. @@ -128,7 +128,7 @@ func (rs *ResourceSpans) UnmarshalJSON(data []byte) error { return nil } -// A collection of Spans produced by an InstrumentationScope. +// ScopeSpans is a collection of Spans produced by an InstrumentationScope. type ScopeSpans struct { // The instrumentation scope information for the spans in this message. // Semantically when InstrumentationScope isn't set, it is equivalent with diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go index 0dd01b063a34..022768bb5018 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go +++ b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go @@ -1,8 +1,6 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -//go:generate stringer -type=ValueKind -trimprefix=ValueKind - package telemetry import ( @@ -23,7 +21,7 @@ import ( // A zero value is valid and represents an empty value. type Value struct { // Ensure forward compatibility by explicitly making this not comparable. - noCmp [0]func() //nolint: unused // This is indeed used. + noCmp [0]func() //nolint:unused // This is indeed used. // num holds the value for Int64, Float64, and Bool. It holds the length // for String, Bytes, Slice, Map. @@ -92,7 +90,7 @@ func IntValue(v int) Value { return Int64Value(int64(v)) } // Int64Value returns a [Value] for an int64. func Int64Value(v int64) Value { - return Value{num: uint64(v), any: ValueKindInt64} + return Value{num: uint64(v), any: ValueKindInt64} //nolint:gosec // Raw value conv. } // Float64Value returns a [Value] for a float64. @@ -164,7 +162,7 @@ func (v Value) AsInt64() int64 { // this will return garbage. func (v Value) asInt64() int64 { // Assumes v.num was a valid int64 (overflow not checked). - return int64(v.num) // nolint: gosec + return int64(v.num) //nolint:gosec // Bounded. } // AsBool returns the value held by v as a bool. @@ -309,13 +307,13 @@ func (v Value) String() string { return v.asString() case ValueKindInt64: // Assumes v.num was a valid int64 (overflow not checked). - return strconv.FormatInt(int64(v.num), 10) // nolint: gosec + return strconv.FormatInt(int64(v.num), 10) //nolint:gosec // Bounded. case ValueKindFloat64: return strconv.FormatFloat(v.asFloat64(), 'g', -1, 64) case ValueKindBool: return strconv.FormatBool(v.asBool()) case ValueKindBytes: - return fmt.Sprint(v.asBytes()) + return string(v.asBytes()) case ValueKindMap: return fmt.Sprint(v.asMap()) case ValueKindSlice: @@ -343,7 +341,7 @@ func (v *Value) MarshalJSON() ([]byte, error) { case ValueKindInt64: return json.Marshal(struct { Value string `json:"intValue"` - }{strconv.FormatInt(int64(v.num), 10)}) + }{strconv.FormatInt(int64(v.num), 10)}) //nolint:gosec // Raw value conv. case ValueKindFloat64: return json.Marshal(struct { Value float64 `json:"doubleValue"` diff --git a/vendor/go.opentelemetry.io/auto/sdk/span.go b/vendor/go.opentelemetry.io/auto/sdk/span.go index 6ebea12a9e9f..815d271ffb26 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/span.go +++ b/vendor/go.opentelemetry.io/auto/sdk/span.go @@ -6,6 +6,7 @@ package sdk import ( "encoding/json" "fmt" + "math" "reflect" "runtime" "strings" @@ -16,7 +17,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.37.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" @@ -85,7 +86,12 @@ func (s *span) SetAttributes(attrs ...attribute.KeyValue) { limit := maxSpan.Attrs if limit == 0 { // No attributes allowed. - s.span.DroppedAttrs += uint32(len(attrs)) + n := int64(len(attrs)) + if n > 0 { + s.span.DroppedAttrs += uint32( //nolint:gosec // Bounds checked. + min(n, math.MaxUint32), + ) + } return } @@ -121,8 +127,13 @@ func (s *span) SetAttributes(attrs ...attribute.KeyValue) { // convCappedAttrs converts up to limit attrs into a []telemetry.Attr. The // number of dropped attributes is also returned. func convCappedAttrs(limit int, attrs []attribute.KeyValue) ([]telemetry.Attr, uint32) { + n := len(attrs) if limit == 0 { - return nil, uint32(len(attrs)) + var out uint32 + if n > 0 { + out = uint32(min(int64(n), math.MaxUint32)) //nolint:gosec // Bounds checked. + } + return nil, out } if limit < 0 { @@ -130,8 +141,12 @@ func convCappedAttrs(limit int, attrs []attribute.KeyValue) ([]telemetry.Attr, u return convAttrs(attrs), 0 } - limit = min(len(attrs), limit) - return convAttrs(attrs[:limit]), uint32(len(attrs) - limit) + if n < 0 { + n = 0 + } + + limit = min(n, limit) + return convAttrs(attrs[:limit]), uint32(n - limit) //nolint:gosec // Bounds checked. } func convAttrs(attrs []attribute.KeyValue) []telemetry.Attr { diff --git a/vendor/go.opentelemetry.io/auto/sdk/tracer.go b/vendor/go.opentelemetry.io/auto/sdk/tracer.go index cbcfabde3b1a..e09acf022fa1 100644 --- a/vendor/go.opentelemetry.io/auto/sdk/tracer.go +++ b/vendor/go.opentelemetry.io/auto/sdk/tracer.go @@ -5,6 +5,7 @@ package sdk import ( "context" + "math" "time" "go.opentelemetry.io/otel/trace" @@ -21,15 +22,20 @@ type tracer struct { var _ trace.Tracer = tracer{} -func (t tracer) Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { - var psc trace.SpanContext +func (t tracer) Start( + ctx context.Context, + name string, + opts ...trace.SpanStartOption, +) (context.Context, trace.Span) { + var psc, sc trace.SpanContext sampled := true span := new(span) // Ask eBPF for sampling decision and span context info. - t.start(ctx, span, &psc, &sampled, &span.spanContext) + t.start(ctx, span, &psc, &sampled, &sc) span.sampled.Store(sampled) + span.spanContext = sc ctx = trace.ContextWithSpan(ctx, span) @@ -58,7 +64,13 @@ func (t *tracer) start( // start is used for testing. var start = func(context.Context, *span, *trace.SpanContext, *bool, *trace.SpanContext) {} -func (t tracer) traces(name string, cfg trace.SpanConfig, sc, psc trace.SpanContext) (*telemetry.Traces, *telemetry.Span) { +var intToUint32Bound = min(math.MaxInt, math.MaxUint32) + +func (t tracer) traces( + name string, + cfg trace.SpanConfig, + sc, psc trace.SpanContext, +) (*telemetry.Traces, *telemetry.Span) { span := &telemetry.Span{ TraceID: telemetry.TraceID(sc.TraceID()), SpanID: telemetry.SpanID(sc.SpanID()), @@ -73,11 +85,16 @@ func (t tracer) traces(name string, cfg trace.SpanConfig, sc, psc trace.SpanCont links := cfg.Links() if limit := maxSpan.Links; limit == 0 { - span.DroppedLinks = uint32(len(links)) + n := len(links) + if n > 0 { + bounded := max(min(n, intToUint32Bound), 0) + span.DroppedLinks = uint32(bounded) //nolint:gosec // Bounds checked. + } } else { if limit > 0 { n := max(len(links)-limit, 0) - span.DroppedLinks = uint32(n) + bounded := min(n, intToUint32Bound) + span.DroppedLinks = uint32(bounded) //nolint:gosec // Bounds checked. links = links[n:] } span.Links = convLinks(links) diff --git a/vendor/golang.org/x/net/http2/config.go b/vendor/golang.org/x/net/http2/config.go index ca645d9a1aff..02fe0c2d48d3 100644 --- a/vendor/golang.org/x/net/http2/config.go +++ b/vendor/golang.org/x/net/http2/config.go @@ -55,7 +55,7 @@ func configFromServer(h1 *http.Server, h2 *Server) http2Config { PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites, CountError: h2.CountError, } - fillNetHTTPServerConfig(&conf, h1) + fillNetHTTPConfig(&conf, h1.HTTP2) setConfigDefaults(&conf, true) return conf } @@ -81,7 +81,7 @@ func configFromTransport(h2 *Transport) http2Config { } if h2.t1 != nil { - fillNetHTTPTransportConfig(&conf, h2.t1) + fillNetHTTPConfig(&conf, h2.t1.HTTP2) } setConfigDefaults(&conf, false) return conf @@ -120,3 +120,45 @@ func adjustHTTP1MaxHeaderSize(n int64) int64 { const typicalHeaders = 10 // conservative return n + typicalHeaders*perFieldOverhead } + +func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) { + if h2 == nil { + return + } + if h2.MaxConcurrentStreams != 0 { + conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) + } + if h2.MaxEncoderHeaderTableSize != 0 { + conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize) + } + if h2.MaxDecoderHeaderTableSize != 0 { + conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize) + } + if h2.MaxConcurrentStreams != 0 { + conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) + } + if h2.MaxReadFrameSize != 0 { + conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize) + } + if h2.MaxReceiveBufferPerConnection != 0 { + conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection) + } + if h2.MaxReceiveBufferPerStream != 0 { + conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream) + } + if h2.SendPingTimeout != 0 { + conf.SendPingTimeout = h2.SendPingTimeout + } + if h2.PingTimeout != 0 { + conf.PingTimeout = h2.PingTimeout + } + if h2.WriteByteTimeout != 0 { + conf.WriteByteTimeout = h2.WriteByteTimeout + } + if h2.PermitProhibitedCipherSuites { + conf.PermitProhibitedCipherSuites = true + } + if h2.CountError != nil { + conf.CountError = h2.CountError + } +} diff --git a/vendor/golang.org/x/net/http2/config_go124.go b/vendor/golang.org/x/net/http2/config_go124.go deleted file mode 100644 index 5b516c55fffd..000000000000 --- a/vendor/golang.org/x/net/http2/config_go124.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.24 - -package http2 - -import "net/http" - -// fillNetHTTPServerConfig sets fields in conf from srv.HTTP2. -func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) { - fillNetHTTPConfig(conf, srv.HTTP2) -} - -// fillNetHTTPTransportConfig sets fields in conf from tr.HTTP2. -func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) { - fillNetHTTPConfig(conf, tr.HTTP2) -} - -func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) { - if h2 == nil { - return - } - if h2.MaxConcurrentStreams != 0 { - conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) - } - if h2.MaxEncoderHeaderTableSize != 0 { - conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize) - } - if h2.MaxDecoderHeaderTableSize != 0 { - conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize) - } - if h2.MaxConcurrentStreams != 0 { - conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) - } - if h2.MaxReadFrameSize != 0 { - conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize) - } - if h2.MaxReceiveBufferPerConnection != 0 { - conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection) - } - if h2.MaxReceiveBufferPerStream != 0 { - conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream) - } - if h2.SendPingTimeout != 0 { - conf.SendPingTimeout = h2.SendPingTimeout - } - if h2.PingTimeout != 0 { - conf.PingTimeout = h2.PingTimeout - } - if h2.WriteByteTimeout != 0 { - conf.WriteByteTimeout = h2.WriteByteTimeout - } - if h2.PermitProhibitedCipherSuites { - conf.PermitProhibitedCipherSuites = true - } - if h2.CountError != nil { - conf.CountError = h2.CountError - } -} diff --git a/vendor/golang.org/x/net/http2/config_pre_go124.go b/vendor/golang.org/x/net/http2/config_pre_go124.go deleted file mode 100644 index 060fd6c64c6c..000000000000 --- a/vendor/golang.org/x/net/http2/config_pre_go124.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.24 - -package http2 - -import "net/http" - -// Pre-Go 1.24 fallback. -// The Server.HTTP2 and Transport.HTTP2 config fields were added in Go 1.24. - -func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {} - -func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {} diff --git a/vendor/golang.org/x/net/http2/gotrack.go b/vendor/golang.org/x/net/http2/gotrack.go index 9933c9f8c748..9921ca096d39 100644 --- a/vendor/golang.org/x/net/http2/gotrack.go +++ b/vendor/golang.org/x/net/http2/gotrack.go @@ -15,21 +15,32 @@ import ( "runtime" "strconv" "sync" + "sync/atomic" ) var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" +// Setting DebugGoroutines to false during a test to disable goroutine debugging +// results in race detector complaints when a test leaves goroutines running before +// returning. Tests shouldn't do this, of course, but when they do it generally shows +// up as infrequent, hard-to-debug flakes. (See #66519.) +// +// Disable goroutine debugging during individual tests with an atomic bool. +// (Note that it's safe to enable/disable debugging mid-test, so the actual race condition +// here is harmless.) +var disableDebugGoroutines atomic.Bool + type goroutineLock uint64 func newGoroutineLock() goroutineLock { - if !DebugGoroutines { + if !DebugGoroutines || disableDebugGoroutines.Load() { return 0 } return goroutineLock(curGoroutineID()) } func (g goroutineLock) check() { - if !DebugGoroutines { + if !DebugGoroutines || disableDebugGoroutines.Load() { return } if curGoroutineID() != uint64(g) { @@ -38,7 +49,7 @@ func (g goroutineLock) check() { } func (g goroutineLock) checkNotOn() { - if !DebugGoroutines { + if !DebugGoroutines || disableDebugGoroutines.Load() { return } if curGoroutineID() == uint64(g) { diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index ea5ae629fde0..6878f8ecc918 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -15,7 +15,6 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" - "context" "crypto/tls" "errors" "fmt" @@ -255,15 +254,13 @@ func (cw closeWaiter) Wait() { // idle memory usage with many connections. type bufferedWriter struct { _ incomparable - group synctestGroupInterface // immutable - conn net.Conn // immutable - bw *bufio.Writer // non-nil when data is buffered - byteTimeout time.Duration // immutable, WriteByteTimeout + conn net.Conn // immutable + bw *bufio.Writer // non-nil when data is buffered + byteTimeout time.Duration // immutable, WriteByteTimeout } -func newBufferedWriter(group synctestGroupInterface, conn net.Conn, timeout time.Duration) *bufferedWriter { +func newBufferedWriter(conn net.Conn, timeout time.Duration) *bufferedWriter { return &bufferedWriter{ - group: group, conn: conn, byteTimeout: timeout, } @@ -314,24 +311,18 @@ func (w *bufferedWriter) Flush() error { type bufferedWriterTimeoutWriter bufferedWriter func (w *bufferedWriterTimeoutWriter) Write(p []byte) (n int, err error) { - return writeWithByteTimeout(w.group, w.conn, w.byteTimeout, p) + return writeWithByteTimeout(w.conn, w.byteTimeout, p) } // writeWithByteTimeout writes to conn. // If more than timeout passes without any bytes being written to the connection, // the write fails. -func writeWithByteTimeout(group synctestGroupInterface, conn net.Conn, timeout time.Duration, p []byte) (n int, err error) { +func writeWithByteTimeout(conn net.Conn, timeout time.Duration, p []byte) (n int, err error) { if timeout <= 0 { return conn.Write(p) } for { - var now time.Time - if group == nil { - now = time.Now() - } else { - now = group.Now() - } - conn.SetWriteDeadline(now.Add(timeout)) + conn.SetWriteDeadline(time.Now().Add(timeout)) nn, err := conn.Write(p[n:]) n += nn if n == len(p) || nn == 0 || !errors.Is(err, os.ErrDeadlineExceeded) { @@ -417,14 +408,3 @@ func (s *sorter) SortStrings(ss []string) { // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func() - -// synctestGroupInterface is the methods of synctestGroup used by Server and Transport. -// It's defined as an interface here to let us keep synctestGroup entirely test-only -// and not a part of non-test builds. -type synctestGroupInterface interface { - Join() - Now() time.Time - NewTimer(d time.Duration) timer - AfterFunc(d time.Duration, f func()) timer - ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) -} diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 51fca38f61d7..64085f6e168b 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -176,39 +176,6 @@ type Server struct { // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState - - // Synchronization group used for testing. - // Outside of tests, this is nil. - group synctestGroupInterface -} - -func (s *Server) markNewGoroutine() { - if s.group != nil { - s.group.Join() - } -} - -func (s *Server) now() time.Time { - if s.group != nil { - return s.group.Now() - } - return time.Now() -} - -// newTimer creates a new time.Timer, or a synthetic timer in tests. -func (s *Server) newTimer(d time.Duration) timer { - if s.group != nil { - return s.group.NewTimer(d) - } - return timeTimer{time.NewTimer(d)} -} - -// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. -func (s *Server) afterFunc(d time.Duration, f func()) timer { - if s.group != nil { - return s.group.AfterFunc(d, f) - } - return timeTimer{time.AfterFunc(d, f)} } type serverInternalState struct { @@ -423,6 +390,9 @@ func (o *ServeConnOpts) handler() http.Handler { // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { + if opts == nil { + opts = &ServeConnOpts{} + } s.serveConn(c, opts, nil) } @@ -438,7 +408,7 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon conn: c, baseCtx: baseCtx, remoteAddrStr: c.RemoteAddr().String(), - bw: newBufferedWriter(s.group, c, conf.WriteByteTimeout), + bw: newBufferedWriter(c, conf.WriteByteTimeout), handler: opts.handler(), streams: make(map[uint32]*stream), readFrameCh: make(chan readFrameResult), @@ -638,11 +608,11 @@ type serverConn struct { pingSent bool sentPingData [8]byte goAwayCode ErrCode - shutdownTimer timer // nil until used - idleTimer timer // nil if unused + shutdownTimer *time.Timer // nil until used + idleTimer *time.Timer // nil if unused readIdleTimeout time.Duration pingTimeout time.Duration - readIdleTimer timer // nil if unused + readIdleTimer *time.Timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer @@ -687,12 +657,12 @@ type stream struct { flow outflow // limits writing from Handler to client inflow inflow // what the client is allowed to POST/etc to us state streamState - resetQueued bool // RST_STREAM queued for write; set by sc.resetStream - gotTrailerHeader bool // HEADER frame for trailers was seen - wroteHeaders bool // whether we wrote headers (not status 100) - readDeadline timer // nil if unused - writeDeadline timer // nil if unused - closeErr error // set before cw is closed + resetQueued bool // RST_STREAM queued for write; set by sc.resetStream + gotTrailerHeader bool // HEADER frame for trailers was seen + wroteHeaders bool // whether we wrote headers (not status 100) + readDeadline *time.Timer // nil if unused + writeDeadline *time.Timer // nil if unused + closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer @@ -848,7 +818,6 @@ type readFrameResult struct { // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { - sc.srv.markNewGoroutine() gate := make(chan struct{}) gateDone := func() { gate <- struct{}{} } for { @@ -881,7 +850,6 @@ type frameWriteResult struct { // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { - sc.srv.markNewGoroutine() var err error if wd == nil { err = wr.write.writeFrame(sc) @@ -965,22 +933,22 @@ func (sc *serverConn) serve(conf http2Config) { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { - sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } if conf.SendPingTimeout > 0 { sc.readIdleTimeout = conf.SendPingTimeout - sc.readIdleTimer = sc.srv.afterFunc(conf.SendPingTimeout, sc.onReadIdleTimer) + sc.readIdleTimer = time.AfterFunc(conf.SendPingTimeout, sc.onReadIdleTimer) defer sc.readIdleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above - settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) + settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() - lastFrameTime := sc.srv.now() + lastFrameTime := time.Now() loopNum := 0 for { loopNum++ @@ -994,7 +962,7 @@ func (sc *serverConn) serve(conf http2Config) { case res := <-sc.wroteFrameCh: sc.wroteFrame(res) case res := <-sc.readFrameCh: - lastFrameTime = sc.srv.now() + lastFrameTime = time.Now() // Process any written frames before reading new frames from the client since a // written frame could have triggered a new stream to be started. if sc.writingFrameAsync { @@ -1077,7 +1045,7 @@ func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) { } pingAt := lastFrameReadTime.Add(sc.readIdleTimeout) - now := sc.srv.now() + now := time.Now() if pingAt.After(now) { // We received frames since arming the ping timer. // Reset it for the next possible timeout. @@ -1141,10 +1109,10 @@ func (sc *serverConn) readPreface() error { errc <- nil } }() - timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? + timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { - case <-timer.C(): + case <-timer.C: return errPrefaceTimeout case err := <-errc: if err == nil { @@ -1160,6 +1128,21 @@ var errChanPool = sync.Pool{ New: func() interface{} { return make(chan error, 1) }, } +func getErrChan() chan error { + if inTests { + // Channels cannot be reused across synctest tests. + return make(chan error, 1) + } else { + return errChanPool.Get().(chan error) + } +} + +func putErrChan(ch chan error) { + if !inTests { + errChanPool.Put(ch) + } +} + var writeDataPool = sync.Pool{ New: func() interface{} { return new(writeData) }, } @@ -1167,7 +1150,7 @@ var writeDataPool = sync.Pool{ // writeDataFromHandler writes DATA response frames from a handler on // the given stream. func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error { - ch := errChanPool.Get().(chan error) + ch := getErrChan() writeArg := writeDataPool.Get().(*writeData) *writeArg = writeData{stream.id, data, endStream} err := sc.writeFrameFromHandler(FrameWriteRequest{ @@ -1199,7 +1182,7 @@ func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStrea return errStreamClosed } } - errChanPool.Put(ch) + putErrChan(ch) if frameWriteDone { writeDataPool.Put(writeArg) } @@ -1513,7 +1496,7 @@ func (sc *serverConn) goAway(code ErrCode) { func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() - sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) + sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { @@ -2118,7 +2101,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) - st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) @@ -2216,7 +2199,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.initialStreamRecvWindowSize) if sc.hs.WriteTimeout > 0 { - st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st @@ -2405,7 +2388,6 @@ func (sc *serverConn) handlerDone() { // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { - sc.srv.markNewGoroutine() defer sc.sendServeMsg(handlerDoneMsg) didPanic := true defer func() { @@ -2454,7 +2436,7 @@ func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) erro // waiting for this frame to be written, so an http.Flush mid-handler // writes out the correct value of keys, before a handler later potentially // mutates it. - errc = errChanPool.Get().(chan error) + errc = getErrChan() } if err := sc.writeFrameFromHandler(FrameWriteRequest{ write: headerData, @@ -2466,7 +2448,7 @@ func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) erro if errc != nil { select { case err := <-errc: - errChanPool.Put(errc) + putErrChan(errc) return err case <-sc.doneServing: return errClientDisconnected @@ -2573,7 +2555,7 @@ func (b *requestBody) Read(p []byte) (n int, err error) { if err == io.EOF { b.sawEOF = true } - if b.conn == nil && inTests { + if b.conn == nil { return } b.conn.noteBodyReadFromHandler(b.stream, n, err) @@ -2702,7 +2684,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. - date = rws.conn.srv.now().UTC().Format(http.TimeFormat) + date = time.Now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { @@ -2824,7 +2806,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() { func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { + if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() @@ -2840,9 +2822,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { - st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) + st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) } else { - st.readDeadline.Reset(deadline.Sub(sc.srv.now())) + st.readDeadline.Reset(deadline.Sub(time.Now())) } }) return nil @@ -2850,7 +2832,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { + if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() @@ -2866,9 +2848,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { - st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) + st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) } else { - st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) + st.writeDeadline.Reset(deadline.Sub(time.Now())) } }) return nil @@ -3147,7 +3129,7 @@ func (w *responseWriter) Push(target string, opts *http.PushOptions) error { method: opts.Method, url: u, header: cloneHeader(opts.Header), - done: errChanPool.Get().(chan error), + done: getErrChan(), } select { @@ -3164,7 +3146,7 @@ func (w *responseWriter) Push(target string, opts *http.PushOptions) error { case <-st.cw: return errStreamClosed case err := <-msg.done: - errChanPool.Put(msg.done) + putErrChan(msg.done) return err } } diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go deleted file mode 100644 index 0b1c17b81296..000000000000 --- a/vendor/golang.org/x/net/http2/timer.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -package http2 - -import "time" - -// A timer is a time.Timer, as an interface which can be replaced in tests. -type timer = interface { - C() <-chan time.Time - Reset(d time.Duration) bool - Stop() bool -} - -// timeTimer adapts a time.Timer to the timer interface. -type timeTimer struct { - *time.Timer -} - -func (t timeTimer) C() <-chan time.Time { return t.Timer.C } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index f26356b9cd91..35e3902519d3 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -193,50 +193,6 @@ type Transport struct { type transportTestHooks struct { newclientconn func(*ClientConn) - group synctestGroupInterface -} - -func (t *Transport) markNewGoroutine() { - if t != nil && t.transportTestHooks != nil { - t.transportTestHooks.group.Join() - } -} - -func (t *Transport) now() time.Time { - if t != nil && t.transportTestHooks != nil { - return t.transportTestHooks.group.Now() - } - return time.Now() -} - -func (t *Transport) timeSince(when time.Time) time.Duration { - if t != nil && t.transportTestHooks != nil { - return t.now().Sub(when) - } - return time.Since(when) -} - -// newTimer creates a new time.Timer, or a synthetic timer in tests. -func (t *Transport) newTimer(d time.Duration) timer { - if t.transportTestHooks != nil { - return t.transportTestHooks.group.NewTimer(d) - } - return timeTimer{time.NewTimer(d)} -} - -// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. -func (t *Transport) afterFunc(d time.Duration, f func()) timer { - if t.transportTestHooks != nil { - return t.transportTestHooks.group.AfterFunc(d, f) - } - return timeTimer{time.AfterFunc(d, f)} -} - -func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - if t.transportTestHooks != nil { - return t.transportTestHooks.group.ContextWithTimeout(ctx, d) - } - return context.WithTimeout(ctx, d) } func (t *Transport) maxHeaderListSize() uint32 { @@ -366,7 +322,7 @@ type ClientConn struct { readerErr error // set before readerDone is closed idleTimeout time.Duration // or 0 for never - idleTimer timer + idleTimer *time.Timer mu sync.Mutex // guards following cond *sync.Cond // hold mu; broadcast on flow/closed changes @@ -534,14 +490,12 @@ func (cs *clientStream) closeReqBodyLocked() { cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed go func() { - cs.cc.t.markNewGoroutine() cs.reqBody.Close() close(reqBodyClosed) }() } type stickyErrWriter struct { - group synctestGroupInterface conn net.Conn timeout time.Duration err *error @@ -551,7 +505,7 @@ func (sew stickyErrWriter) Write(p []byte) (n int, err error) { if *sew.err != nil { return 0, *sew.err } - n, err = writeWithByteTimeout(sew.group, sew.conn, sew.timeout, p) + n, err = writeWithByteTimeout(sew.conn, sew.timeout, p) *sew.err = err return n, err } @@ -650,9 +604,9 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) d := time.Second * time.Duration(backoff) - tm := t.newTimer(d) + tm := time.NewTimer(d) select { - case <-tm.C(): + case <-tm.C: t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) continue case <-req.Context().Done(): @@ -699,6 +653,7 @@ var ( errClientConnUnusable = errors.New("http2: client conn not usable") errClientConnNotEstablished = errors.New("http2: client conn could not be established") errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY") + errClientConnForceClosed = errors.New("http2: client connection force closed via ClientConn.Close") ) // shouldRetryRequest is called by RoundTrip when a request fails to get @@ -838,14 +793,11 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro pingTimeout: conf.PingTimeout, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), - lastActive: t.now(), + lastActive: time.Now(), } - var group synctestGroupInterface if t.transportTestHooks != nil { - t.markNewGoroutine() t.transportTestHooks.newclientconn(cc) c = cc.tconn - group = t.group } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) @@ -857,7 +809,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. cc.bw = bufio.NewWriter(stickyErrWriter{ - group: group, conn: c, timeout: conf.WriteByteTimeout, err: &cc.werr, @@ -906,7 +857,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro // Start the idle timer after the connection is fully initialized. if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d - cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout) + cc.idleTimer = time.AfterFunc(d, cc.onIdleTimeout) } go cc.readLoop() @@ -917,7 +868,7 @@ func (cc *ClientConn) healthCheck() { pingTimeout := cc.pingTimeout // We don't need to periodically ping in the health check, because the readLoop of ClientConn will // trigger the healthCheck again if there is no frame received. - ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout) + ctx, cancel := context.WithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) @@ -1120,7 +1071,7 @@ func (cc *ClientConn) tooIdleLocked() bool { // times are compared based on their wall time. We don't want // to reuse a connection that's been sitting idle during // VM/laptop suspend if monotonic time was also frozen. - return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && cc.t.timeSince(cc.lastIdle.Round(0)) > cc.idleTimeout + return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout } // onIdleTimeout is called from a time.AfterFunc goroutine. It will @@ -1186,7 +1137,6 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { done := make(chan struct{}) cancelled := false // guarded by cc.mu go func() { - cc.t.markNewGoroutine() cc.mu.Lock() defer cc.mu.Unlock() for { @@ -1257,8 +1207,7 @@ func (cc *ClientConn) closeForError(err error) { // // In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. func (cc *ClientConn) Close() error { - err := errors.New("http2: client connection force closed via ClientConn.Close") - cc.closeForError(err) + cc.closeForError(errClientConnForceClosed) return nil } @@ -1427,7 +1376,6 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) // // It sends the request and performs post-request cleanup (closing Request.Body, etc.). func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { - cs.cc.t.markNewGoroutine() err := cs.writeRequest(req, streamf) cs.cleanupWriteRequest(err) } @@ -1558,9 +1506,9 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { - timer := cc.t.newTimer(d) + timer := time.NewTimer(d) defer timer.Stop() - respHeaderTimer = timer.C() + respHeaderTimer = timer.C respHeaderRecv = cs.respHeaderRecv } // Wait until the peer half-closes its end of the stream, @@ -1753,7 +1701,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { // Return a fatal error which aborts the retry loop. return errClientConnNotEstablished } - cc.lastActive = cc.t.now() + cc.lastActive = time.Now() if cc.closed || !cc.canTakeNewRequestLocked() { return errClientConnUnusable } @@ -2092,10 +2040,10 @@ func (cc *ClientConn) forgetStreamID(id uint32) { if len(cc.streams) != slen-1 { panic("forgetting unknown stream id") } - cc.lastActive = cc.t.now() + cc.lastActive = time.Now() if len(cc.streams) == 0 && cc.idleTimer != nil { cc.idleTimer.Reset(cc.idleTimeout) - cc.lastIdle = cc.t.now() + cc.lastIdle = time.Now() } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. @@ -2121,7 +2069,6 @@ type clientConnReadLoop struct { // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { - cc.t.markNewGoroutine() rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() @@ -2188,9 +2135,9 @@ func (rl *clientConnReadLoop) cleanup() { if cc.idleTimeout > 0 && unusedWaitTime > cc.idleTimeout { unusedWaitTime = cc.idleTimeout } - idleTime := cc.t.now().Sub(cc.lastActive) + idleTime := time.Now().Sub(cc.lastActive) if atomic.LoadUint32(&cc.atomicReused) == 0 && idleTime < unusedWaitTime && !cc.closedOnIdle { - cc.idleTimer = cc.t.afterFunc(unusedWaitTime-idleTime, func() { + cc.idleTimer = time.AfterFunc(unusedWaitTime-idleTime, func() { cc.t.connPool().MarkDead(cc) }) } else { @@ -2250,9 +2197,9 @@ func (rl *clientConnReadLoop) run() error { cc := rl.cc gotSettings := false readIdleTimeout := cc.readIdleTimeout - var t timer + var t *time.Timer if readIdleTimeout != 0 { - t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) + t = time.AfterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() @@ -2998,7 +2945,6 @@ func (cc *ClientConn) Ping(ctx context.Context) error { var pingError error errc := make(chan struct{}) go func() { - cc.t.markNewGoroutine() cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { @@ -3228,7 +3174,7 @@ func traceGotConn(req *http.Request, cc *ClientConn, reused bool) { cc.mu.Lock() ci.WasIdle = len(cc.streams) == 0 && reused if ci.WasIdle && !cc.lastActive.IsZero() { - ci.IdleTime = cc.t.timeSince(cc.lastActive) + ci.IdleTime = time.Since(cc.lastActive) } cc.mu.Unlock() diff --git a/vendor/modules.txt b/vendor/modules.txt index fcd7c1eeded1..55fbf6593541 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -539,6 +539,8 @@ github.com/docker/go-metrics # github.com/docker/go-units v0.5.0 ## explicit github.com/docker/go-units +# github.com/fatih/color v1.18.0 +## explicit; go 1.17 # github.com/felixge/fgprof v0.9.3 ## explicit; go 1.14 github.com/felixge/fgprof @@ -644,6 +646,8 @@ github.com/klauspost/compress/zstd/internal/xxhash ## explicit; go 1.11 github.com/kylelemons/godebug/diff github.com/kylelemons/godebug/pretty +# github.com/mattn/go-colorable v0.1.14 +## explicit; go 1.18 # github.com/mitchellh/hashstructure/v2 v2.0.2 ## explicit; go 1.14 github.com/mitchellh/hashstructure/v2 @@ -665,6 +669,9 @@ github.com/moby/locker ## explicit; go 1.19 github.com/moby/patternmatcher github.com/moby/patternmatcher/ignorefile +# github.com/moby/policy-helpers v0.0.0-20251105011237-bcaa71c99f14 +## explicit; go 1.24.3 +github.com/moby/policy-helpers/image # github.com/moby/profiles/seccomp v0.1.0 ## explicit; go 1.23.0 github.com/moby/profiles/seccomp @@ -861,8 +868,8 @@ go.opencensus.io/internal go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/tracestate -# go.opentelemetry.io/auto/sdk v1.1.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/auto/sdk v1.2.1 +## explicit; go 1.24.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry # go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 @@ -1009,8 +1016,8 @@ golang.org/x/exp/trace/internal/version # golang.org/x/mod v0.29.0 ## explicit; go 1.24.0 golang.org/x/mod/semver -# golang.org/x/net v0.43.0 -## explicit; go 1.23.0 +# golang.org/x/net v0.44.0 +## explicit; go 1.24.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/hpack diff --git a/worker/base/worker.go b/worker/base/worker.go index 6c1abb1a8d6f..2cf738645b57 100644 --- a/worker/base/worker.go +++ b/worker/base/worker.go @@ -396,8 +396,15 @@ func (w *Worker) ResolveSourceMetadata(ctx context.Context, op *pb.SourceOp, opt return nil, errors.New("source policies can not be set for worker") } + var p *ocispecs.Platform + if imgOpt := opt.ImageOpt; imgOpt != nil && imgOpt.Platform != nil { + p = imgOpt.Platform + } else if ociOpt := opt.OCILayoutOpt; ociOpt != nil && ociOpt.Platform != nil { + p = ociOpt.Platform + } + var platform *pb.Platform - if p := opt.Platform; p != nil { + if p != nil { platform = &pb.Platform{ Architecture: p.Architecture, OS: p.OS, @@ -421,35 +428,31 @@ func (w *Worker) ResolveSourceMetadata(ctx context.Context, op *pb.SourceOp, opt if opt.ImageOpt == nil { opt.ImageOpt = &sourceresolver.ResolveImageOpt{} } - - dgst, config, err := w.ImageSource.ResolveImageConfig(ctx, idt.Reference.String(), opt, sm, g) + if p != nil { + opt.ImageOpt.Platform = p + } + resp, err := w.ImageSource.ResolveImageMetadata(ctx, idt, opt.ImageOpt, sm, g) if err != nil { return nil, err } return &sourceresolver.MetaResponse{ - Op: op, - Image: &sourceresolver.ResolveImageResponse{ - Digest: dgst, - Config: config, - }, + Op: op, + Image: resp, }, nil case *containerimage.OCIIdentifier: - opt.OCILayoutOpt = &sourceresolver.ResolveOCILayoutOpt{ - Store: sourceresolver.ResolveImageConfigOptStore{ - StoreID: idt.StoreID, - SessionID: idt.SessionID, - }, + if opt.OCILayoutOpt == nil { + opt.OCILayoutOpt = &sourceresolver.ResolveOCILayoutOpt{} + } + if p != nil { + opt.OCILayoutOpt.Platform = p } - dgst, config, err := w.OCILayoutSource.ResolveImageConfig(ctx, idt.Reference.String(), opt, sm, g) + resp, err := w.OCILayoutSource.ResolveOCILayoutMetadata(ctx, idt, opt.OCILayoutOpt, sm, g) if err != nil { return nil, err } return &sourceresolver.MetaResponse{ - Op: op, - Image: &sourceresolver.ResolveImageResponse{ - Digest: dgst, - Config: config, - }, + Op: op, + Image: resp, }, nil case *git.GitIdentifier: if w.GitSource == nil {