From 0dc9d17a2ecf26067997b7d3cb3243f73cbc5e8d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 16 Apr 2020 17:06:33 +0200 Subject: [PATCH] vendor: github.com/moby/buildkit ae7ff7174f73bcb4df89b97e1623b3fb0bfb0a0c full diff: https://github.com/moby/buildkit/compare/4f4e03067523b2fc5ca2f17514a5e75ad63e02fb...ae7ff7174f73bcb4df89b97e1623b3fb0bfb0a0c Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- .../containerd/containers/containers.go | 112 - .../containerd/images/annotations.go | 23 - .../containerd/containerd/images/handlers.go | 256 -- .../containerd/containerd/images/image.go | 386 -- .../containerd/images/importexport.go | 37 - .../containerd/images/mediatypes.go | 126 - .../containerd/mount/lookup_unix.go | 53 - .../containerd/mount/lookup_unsupported.go | 29 - .../containerd/containerd/mount/mount.go | 40 - .../containerd/mount/mount_linux.go | 319 -- .../containerd/containerd/mount/mount_unix.go | 41 - .../containerd/mount/mount_windows.go | 105 - .../containerd/containerd/mount/mountinfo.go | 56 - .../containerd/mount/mountinfo_bsd.go | 63 - .../containerd/mount/mountinfo_linux.go | 145 - .../containerd/mount/mountinfo_unsupported.go | 34 - .../containerd/containerd/mount/temp.go | 73 - .../containerd/containerd/mount/temp_unix.go | 64 - .../containerd/mount/temp_unsupported.go | 29 - .../containerd/namespaces/context.go | 77 - .../containerd/containerd/namespaces/grpc.go | 61 - .../containerd/containerd/namespaces/store.go | 46 - .../containerd/containerd/namespaces/ttrpc.go | 51 - .../containerd/namespaces/validate.go | 83 - .../containerd/containerd/oci/client.go | 38 - .../containerd/containerd/oci/spec.go | 253 -- .../containerd/containerd/oci/spec_opts.go | 1263 ------ .../containerd/oci/spec_opts_linux.go | 121 - .../containerd/oci/spec_opts_unix.go | 120 - .../containerd/oci/spec_opts_windows.go | 79 - .../containerd/snapshots/snapshotter.go | 339 -- vendor/github.com/containerd/ttrpc/LICENSE | 201 - vendor/github.com/containerd/ttrpc/README.md | 62 - vendor/github.com/containerd/ttrpc/channel.go | 153 - vendor/github.com/containerd/ttrpc/client.go | 350 -- vendor/github.com/containerd/ttrpc/codec.go | 42 - vendor/github.com/containerd/ttrpc/config.go | 52 - .../github.com/containerd/ttrpc/handshake.go | 50 - .../containerd/ttrpc/interceptor.go | 50 - .../github.com/containerd/ttrpc/metadata.go | 107 - vendor/github.com/containerd/ttrpc/server.go | 485 --- .../github.com/containerd/ttrpc/services.go | 156 - vendor/github.com/containerd/ttrpc/types.go | 63 - .../containerd/ttrpc/unixcreds_linux.go | 108 - vendor/github.com/moby/buildkit/README.md | 37 +- .../api/services/control/control.pb.go | 2203 +++++++---- .../api/services/control/control.proto | 1 + .../moby/buildkit/api/types/worker.pb.go | 380 +- .../github.com/moby/buildkit/client/build.go | 5 + .../github.com/moby/buildkit/client/client.go | 6 + .../moby/buildkit/client/client_windows.go | 2 +- .../moby/buildkit/client/llb/async.go | 98 + .../moby/buildkit/client/llb/definition.go | 171 + .../moby/buildkit/client/llb/exec.go | 163 +- .../moby/buildkit/client/llb/fileop.go | 67 +- .../moby/buildkit/client/llb/meta.go | 186 +- .../moby/buildkit/client/llb/resolver.go | 19 +- .../moby/buildkit/client/llb/source.go | 59 +- .../moby/buildkit/client/llb/state.go | 168 +- .../github.com/moby/buildkit/client/solve.go | 57 +- .../frontend/gateway/client/client.go | 20 +- .../frontend/gateway/grpcclient/client.go | 140 +- .../moby/buildkit/frontend/gateway/pb/caps.go | 34 + .../frontend/gateway/pb/gateway.pb.go | 3228 +++++++++++---- .../frontend/gateway/pb/gateway.proto | 32 +- vendor/github.com/moby/buildkit/go.mod | 86 +- .../moby/buildkit/session/auth/auth.pb.go | 230 +- .../buildkit/session/filesync/filesync.pb.go | 188 +- .../buildkit/session/secrets/secrets.pb.go | 272 +- .../moby/buildkit/session/sshforward/ssh.go | 4 + .../buildkit/session/sshforward/ssh.pb.go | 244 +- .../sshforward/sshprovider/agentprovider.go | 6 +- .../moby/buildkit/solver/pb/caps.go | 18 +- .../moby/buildkit/solver/pb/ops.pb.go | 3456 +++++++++-------- .../moby/buildkit/util/apicaps/pb/caps.pb.go | 251 +- .../util/appdefaults/appdefaults_windows.go | 14 +- .../util/entitlements/security_linux.go | 67 - .../util/flightcontrol/flightcontrol.go | 341 ++ .../buildkit/util/progress/multireader.go | 77 + .../buildkit/util/progress/multiwriter.go | 105 + .../moby/buildkit/util/progress/progress.go | 256 ++ .../opencontainers/runtime-spec/LICENSE | 191 - .../opencontainers/runtime-spec/README.md | 153 - .../runtime-spec/specs-go/config.go | 642 --- .../runtime-spec/specs-go/state.go | 17 - .../runtime-spec/specs-go/version.go | 18 - vendor/github.com/syndtr/gocapability/LICENSE | 24 - .../gocapability/capability/capability.go | 133 - .../capability/capability_linux.go | 642 --- .../capability/capability_noop.go | 19 - .../syndtr/gocapability/capability/enum.go | 268 -- .../gocapability/capability/enum_gen.go | 129 - .../gocapability/capability/syscall_linux.go | 154 - .../golang.org/x/sync/semaphore/semaphore.go | 127 - 95 files changed, 8313 insertions(+), 13298 deletions(-) delete mode 100644 vendor/github.com/containerd/containerd/containers/containers.go delete mode 100644 vendor/github.com/containerd/containerd/images/annotations.go delete mode 100644 vendor/github.com/containerd/containerd/images/handlers.go delete mode 100644 vendor/github.com/containerd/containerd/images/image.go delete mode 100644 vendor/github.com/containerd/containerd/images/importexport.go delete mode 100644 vendor/github.com/containerd/containerd/images/mediatypes.go delete mode 100644 vendor/github.com/containerd/containerd/mount/lookup_unix.go delete mode 100644 vendor/github.com/containerd/containerd/mount/lookup_unsupported.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mount.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mount_linux.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mount_unix.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mount_windows.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mountinfo.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mountinfo_bsd.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mountinfo_linux.go delete mode 100644 vendor/github.com/containerd/containerd/mount/mountinfo_unsupported.go delete mode 100644 vendor/github.com/containerd/containerd/mount/temp.go delete mode 100644 vendor/github.com/containerd/containerd/mount/temp_unix.go delete mode 100644 vendor/github.com/containerd/containerd/mount/temp_unsupported.go delete mode 100644 vendor/github.com/containerd/containerd/namespaces/context.go delete mode 100644 vendor/github.com/containerd/containerd/namespaces/grpc.go delete mode 100644 vendor/github.com/containerd/containerd/namespaces/store.go delete mode 100644 vendor/github.com/containerd/containerd/namespaces/ttrpc.go delete mode 100644 vendor/github.com/containerd/containerd/namespaces/validate.go delete mode 100644 vendor/github.com/containerd/containerd/oci/client.go delete mode 100644 vendor/github.com/containerd/containerd/oci/spec.go delete mode 100644 vendor/github.com/containerd/containerd/oci/spec_opts.go delete mode 100644 vendor/github.com/containerd/containerd/oci/spec_opts_linux.go delete mode 100644 vendor/github.com/containerd/containerd/oci/spec_opts_unix.go delete mode 100644 vendor/github.com/containerd/containerd/oci/spec_opts_windows.go delete mode 100644 vendor/github.com/containerd/containerd/snapshots/snapshotter.go delete mode 100644 vendor/github.com/containerd/ttrpc/LICENSE delete mode 100644 vendor/github.com/containerd/ttrpc/README.md delete mode 100644 vendor/github.com/containerd/ttrpc/channel.go delete mode 100644 vendor/github.com/containerd/ttrpc/client.go delete mode 100644 vendor/github.com/containerd/ttrpc/codec.go delete mode 100644 vendor/github.com/containerd/ttrpc/config.go delete mode 100644 vendor/github.com/containerd/ttrpc/handshake.go delete mode 100644 vendor/github.com/containerd/ttrpc/interceptor.go delete mode 100644 vendor/github.com/containerd/ttrpc/metadata.go delete mode 100644 vendor/github.com/containerd/ttrpc/server.go delete mode 100644 vendor/github.com/containerd/ttrpc/services.go delete mode 100644 vendor/github.com/containerd/ttrpc/types.go delete mode 100644 vendor/github.com/containerd/ttrpc/unixcreds_linux.go create mode 100644 vendor/github.com/moby/buildkit/client/llb/async.go create mode 100644 vendor/github.com/moby/buildkit/client/llb/definition.go delete mode 100644 vendor/github.com/moby/buildkit/util/entitlements/security_linux.go create mode 100644 vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go create mode 100644 vendor/github.com/moby/buildkit/util/progress/multireader.go create mode 100644 vendor/github.com/moby/buildkit/util/progress/multiwriter.go create mode 100644 vendor/github.com/moby/buildkit/util/progress/progress.go delete mode 100644 vendor/github.com/opencontainers/runtime-spec/LICENSE delete mode 100644 vendor/github.com/opencontainers/runtime-spec/README.md delete mode 100644 vendor/github.com/opencontainers/runtime-spec/specs-go/config.go delete mode 100644 vendor/github.com/opencontainers/runtime-spec/specs-go/state.go delete mode 100644 vendor/github.com/opencontainers/runtime-spec/specs-go/version.go delete mode 100644 vendor/github.com/syndtr/gocapability/LICENSE delete mode 100644 vendor/github.com/syndtr/gocapability/capability/capability.go delete mode 100644 vendor/github.com/syndtr/gocapability/capability/capability_linux.go delete mode 100644 vendor/github.com/syndtr/gocapability/capability/capability_noop.go delete mode 100644 vendor/github.com/syndtr/gocapability/capability/enum.go delete mode 100644 vendor/github.com/syndtr/gocapability/capability/enum_gen.go delete mode 100644 vendor/github.com/syndtr/gocapability/capability/syscall_linux.go delete mode 100644 vendor/golang.org/x/sync/semaphore/semaphore.go diff --git a/vendor.conf b/vendor.conf index ae1161a41b..a274c8918b 100755 --- a/vendor.conf +++ b/vendor.conf @@ -46,7 +46,7 @@ github.com/Microsoft/go-winio 6c72808b55902eae4c5943626030 github.com/Microsoft/hcsshim b3f49c06ffaeef24d09c6c08ec8ec8425a0303e2 # v0.8.7 github.com/miekg/pkcs11 210dc1e16747c5ba98a03bcbcf728c38086ea357 # v1.0.3 github.com/mitchellh/mapstructure f15292f7a699fcc1a38a80977f80a046874ba8ac -github.com/moby/buildkit 4f4e03067523b2fc5ca2f17514a5e75ad63e02fb +github.com/moby/buildkit ae7ff7174f73bcb4df89b97e1623b3fb0bfb0a0c github.com/moby/sys 6154f11e6840c0d6b0dbb23f4125a6134b3013c9 # mountinfo/v0.1.3 github.com/moby/term 063f2cd0b49dbb0752774d1cb649998d91424fea github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 diff --git a/vendor/github.com/containerd/containerd/containers/containers.go b/vendor/github.com/containerd/containerd/containers/containers.go deleted file mode 100644 index 7174bbd6aa..0000000000 --- a/vendor/github.com/containerd/containerd/containers/containers.go +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package containers - -import ( - "context" - "time" - - "github.com/gogo/protobuf/types" -) - -// Container represents the set of data pinned by a container. Unless otherwise -// noted, the resources here are considered in use by the container. -// -// The resources specified in this object are used to create tasks from the container. -type Container struct { - // ID uniquely identifies the container in a namespace. - // - // This property is required and cannot be changed after creation. - ID string - - // Labels provide metadata extension for a container. - // - // These are optional and fully mutable. - Labels map[string]string - - // Image specifies the image reference used for a container. - // - // This property is optional and mutable. - Image string - - // Runtime specifies which runtime should be used when launching container - // tasks. - // - // This property is required and immutable. - Runtime RuntimeInfo - - // Spec should carry the runtime specification used to implement the - // container. - // - // This field is required but mutable. - Spec *types.Any - - // SnapshotKey specifies the snapshot key to use for the container's root - // filesystem. When starting a task from this container, a caller should - // look up the mounts from the snapshot service and include those on the - // task create request. - // - // This field is not required but mutable. - SnapshotKey string - - // Snapshotter specifies the snapshotter name used for rootfs - // - // This field is not required but immutable. - Snapshotter string - - // CreatedAt is the time at which the container was created. - CreatedAt time.Time - - // UpdatedAt is the time at which the container was updated. - UpdatedAt time.Time - - // Extensions stores client-specified metadata - Extensions map[string]types.Any -} - -// RuntimeInfo holds runtime specific information -type RuntimeInfo struct { - Name string - Options *types.Any -} - -// Store interacts with the underlying container storage -type Store interface { - // Get a container using the id. - // - // Container object is returned on success. If the id is not known to the - // store, an error will be returned. - Get(ctx context.Context, id string) (Container, error) - - // List returns containers that match one or more of the provided filters. - List(ctx context.Context, filters ...string) ([]Container, error) - - // Create a container in the store from the provided container. - Create(ctx context.Context, container Container) (Container, error) - - // Update the container with the provided container object. ID must be set. - // - // If one or more fieldpaths are provided, only the field corresponding to - // the fieldpaths will be mutated. - Update(ctx context.Context, container Container, fieldpaths ...string) (Container, error) - - // Delete a container using the id. - // - // nil will be returned on success. If the container is not known to the - // store, ErrNotFound will be returned. - Delete(ctx context.Context, id string) error -} diff --git a/vendor/github.com/containerd/containerd/images/annotations.go b/vendor/github.com/containerd/containerd/images/annotations.go deleted file mode 100644 index 47d92104cd..0000000000 --- a/vendor/github.com/containerd/containerd/images/annotations.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -const ( - // AnnotationImageName is an annotation on a Descriptor in an index.json - // containing the `Name` value as used by an `Image` struct - AnnotationImageName = "io.containerd.image.name" -) diff --git a/vendor/github.com/containerd/containerd/images/handlers.go b/vendor/github.com/containerd/containerd/images/handlers.go deleted file mode 100644 index 04c2d5a605..0000000000 --- a/vendor/github.com/containerd/containerd/images/handlers.go +++ /dev/null @@ -1,256 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -import ( - "context" - "fmt" - "sort" - - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/platforms" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" - "golang.org/x/sync/errgroup" - "golang.org/x/sync/semaphore" -) - -var ( - // ErrSkipDesc is used to skip processing of a descriptor and - // its descendants. - ErrSkipDesc = fmt.Errorf("skip descriptor") - - // ErrStopHandler is used to signify that the descriptor - // has been handled and should not be handled further. - // This applies only to a single descriptor in a handler - // chain and does not apply to descendant descriptors. - ErrStopHandler = fmt.Errorf("stop handler") -) - -// Handler handles image manifests -type Handler interface { - Handle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) -} - -// HandlerFunc function implementing the Handler interface -type HandlerFunc func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) - -// Handle image manifests -func (fn HandlerFunc) Handle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) { - return fn(ctx, desc) -} - -// Handlers returns a handler that will run the handlers in sequence. -// -// A handler may return `ErrStopHandler` to stop calling additional handlers -func Handlers(handlers ...Handler) HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) { - var children []ocispec.Descriptor - for _, handler := range handlers { - ch, err := handler.Handle(ctx, desc) - if err != nil { - if errors.Cause(err) == ErrStopHandler { - break - } - return nil, err - } - - children = append(children, ch...) - } - - return children, nil - } -} - -// Walk the resources of an image and call the handler for each. If the handler -// decodes the sub-resources for each image, -// -// This differs from dispatch in that each sibling resource is considered -// synchronously. -func Walk(ctx context.Context, handler Handler, descs ...ocispec.Descriptor) error { - for _, desc := range descs { - - children, err := handler.Handle(ctx, desc) - if err != nil { - if errors.Cause(err) == ErrSkipDesc { - continue // don't traverse the children. - } - return err - } - - if len(children) > 0 { - if err := Walk(ctx, handler, children...); err != nil { - return err - } - } - } - - return nil -} - -// Dispatch runs the provided handler for content specified by the descriptors. -// If the handler decode subresources, they will be visited, as well. -// -// Handlers for siblings are run in parallel on the provided descriptors. A -// handler may return `ErrSkipDesc` to signal to the dispatcher to not traverse -// any children. -// -// A concurrency limiter can be passed in to limit the number of concurrent -// handlers running. When limiter is nil, there is no limit. -// -// Typically, this function will be used with `FetchHandler`, often composed -// with other handlers. -// -// If any handler returns an error, the dispatch session will be canceled. -func Dispatch(ctx context.Context, handler Handler, limiter *semaphore.Weighted, descs ...ocispec.Descriptor) error { - eg, ctx2 := errgroup.WithContext(ctx) - for _, desc := range descs { - desc := desc - - if limiter != nil { - if err := limiter.Acquire(ctx, 1); err != nil { - return err - } - } - - eg.Go(func() error { - desc := desc - - children, err := handler.Handle(ctx2, desc) - if limiter != nil { - limiter.Release(1) - } - if err != nil { - if errors.Cause(err) == ErrSkipDesc { - return nil // don't traverse the children. - } - return err - } - - if len(children) > 0 { - return Dispatch(ctx2, handler, limiter, children...) - } - - return nil - }) - } - - return eg.Wait() -} - -// ChildrenHandler decodes well-known manifest types and returns their children. -// -// This is useful for supporting recursive fetch and other use cases where you -// want to do a full walk of resources. -// -// One can also replace this with another implementation to allow descending of -// arbitrary types. -func ChildrenHandler(provider content.Provider) HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - return Children(ctx, provider, desc) - } -} - -// SetChildrenLabels is a handler wrapper which sets labels for the content on -// the children returned by the handler and passes through the children. -// Must follow a handler that returns the children to be labeled. -func SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - children, err := f(ctx, desc) - if err != nil { - return children, err - } - - if len(children) > 0 { - info := content.Info{ - Digest: desc.Digest, - Labels: map[string]string{}, - } - fields := []string{} - for i, ch := range children { - info.Labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = ch.Digest.String() - fields = append(fields, fmt.Sprintf("labels.containerd.io/gc.ref.content.%d", i)) - } - - _, err := manager.Update(ctx, info, fields...) - if err != nil { - return nil, err - } - } - - return children, err - } -} - -// FilterPlatforms is a handler wrapper which limits the descriptors returned -// based on matching the specified platform matcher. -func FilterPlatforms(f HandlerFunc, m platforms.Matcher) HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - children, err := f(ctx, desc) - if err != nil { - return children, err - } - - var descs []ocispec.Descriptor - - if m == nil { - descs = children - } else { - for _, d := range children { - if d.Platform == nil || m.Match(*d.Platform) { - descs = append(descs, d) - } - } - } - - return descs, nil - } -} - -// LimitManifests is a handler wrapper which filters the manifest descriptors -// returned using the provided platform. -// The results will be ordered according to the comparison operator and -// use the ordering in the manifests for equal matches. -// A limit of 0 or less is considered no limit. -func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - children, err := f(ctx, desc) - if err != nil { - return children, err - } - - switch desc.MediaType { - case ocispec.MediaTypeImageIndex, MediaTypeDockerSchema2ManifestList: - sort.SliceStable(children, func(i, j int) bool { - if children[i].Platform == nil { - return false - } - if children[j].Platform == nil { - return true - } - return m.Less(*children[i].Platform, *children[j].Platform) - }) - - if n > 0 && len(children) > n { - children = children[:n] - } - default: - // only limit manifests from an index - } - return children, nil - } -} diff --git a/vendor/github.com/containerd/containerd/images/image.go b/vendor/github.com/containerd/containerd/images/image.go deleted file mode 100644 index ee5778d249..0000000000 --- a/vendor/github.com/containerd/containerd/images/image.go +++ /dev/null @@ -1,386 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -import ( - "context" - "encoding/json" - "sort" - "time" - - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" - "github.com/containerd/containerd/platforms" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" -) - -// Image provides the model for how containerd views container images. -type Image struct { - // Name of the image. - // - // To be pulled, it must be a reference compatible with resolvers. - // - // This field is required. - Name string - - // Labels provide runtime decoration for the image record. - // - // There is no default behavior for how these labels are propagated. They - // only decorate the static metadata object. - // - // This field is optional. - Labels map[string]string - - // Target describes the root content for this image. Typically, this is - // a manifest, index or manifest list. - Target ocispec.Descriptor - - CreatedAt, UpdatedAt time.Time -} - -// DeleteOptions provide options on image delete -type DeleteOptions struct { - Synchronous bool -} - -// DeleteOpt allows configuring a delete operation -type DeleteOpt func(context.Context, *DeleteOptions) error - -// SynchronousDelete is used to indicate that an image deletion and removal of -// the image resources should occur synchronously before returning a result. -func SynchronousDelete() DeleteOpt { - return func(ctx context.Context, o *DeleteOptions) error { - o.Synchronous = true - return nil - } -} - -// Store and interact with images -type Store interface { - Get(ctx context.Context, name string) (Image, error) - List(ctx context.Context, filters ...string) ([]Image, error) - Create(ctx context.Context, image Image) (Image, error) - - // Update will replace the data in the store with the provided image. If - // one or more fieldpaths are provided, only those fields will be updated. - Update(ctx context.Context, image Image, fieldpaths ...string) (Image, error) - - Delete(ctx context.Context, name string, opts ...DeleteOpt) error -} - -// TODO(stevvooe): Many of these functions make strong platform assumptions, -// which are untrue in a lot of cases. More refactoring must be done here to -// make this work in all cases. - -// Config resolves the image configuration descriptor. -// -// The caller can then use the descriptor to resolve and process the -// configuration of the image. -func (image *Image) Config(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (ocispec.Descriptor, error) { - return Config(ctx, provider, image.Target, platform) -} - -// RootFS returns the unpacked diffids that make up and images rootfs. -// -// These are used to verify that a set of layers unpacked to the expected -// values. -func (image *Image) RootFS(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) ([]digest.Digest, error) { - desc, err := image.Config(ctx, provider, platform) - if err != nil { - return nil, err - } - return RootFS(ctx, provider, desc) -} - -// Size returns the total size of an image's packed resources. -func (image *Image) Size(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (int64, error) { - var size int64 - return size, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if desc.Size < 0 { - return nil, errors.Errorf("invalid size %v in %v (%v)", desc.Size, desc.Digest, desc.MediaType) - } - size += desc.Size - return nil, nil - }), LimitManifests(FilterPlatforms(ChildrenHandler(provider), platform), platform, 1)), image.Target) -} - -type platformManifest struct { - p *ocispec.Platform - m *ocispec.Manifest -} - -// Manifest resolves a manifest from the image for the given platform. -// -// When a manifest descriptor inside of a manifest index does not have -// a platform defined, the platform from the image config is considered. -// -// If the descriptor points to a non-index manifest, then the manifest is -// unmarshalled and returned without considering the platform inside of the -// config. -// -// TODO(stevvooe): This violates the current platform agnostic approach to this -// package by returning a specific manifest type. We'll need to refactor this -// to return a manifest descriptor or decide that we want to bring the API in -// this direction because this abstraction is not needed.` -func Manifest(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Manifest, error) { - var ( - limit = 1 - m []platformManifest - wasIndex bool - ) - - if err := Walk(ctx, HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - switch desc.MediaType { - case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest: - p, err := content.ReadBlob(ctx, provider, desc) - if err != nil { - return nil, err - } - - var manifest ocispec.Manifest - if err := json.Unmarshal(p, &manifest); err != nil { - return nil, err - } - - if desc.Digest != image.Digest && platform != nil { - if desc.Platform != nil && !platform.Match(*desc.Platform) { - return nil, nil - } - - if desc.Platform == nil { - p, err := content.ReadBlob(ctx, provider, manifest.Config) - if err != nil { - return nil, err - } - - var image ocispec.Image - if err := json.Unmarshal(p, &image); err != nil { - return nil, err - } - - if !platform.Match(platforms.Normalize(ocispec.Platform{OS: image.OS, Architecture: image.Architecture})) { - return nil, nil - } - - } - } - - m = append(m, platformManifest{ - p: desc.Platform, - m: &manifest, - }) - - return nil, nil - case MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex: - p, err := content.ReadBlob(ctx, provider, desc) - if err != nil { - return nil, err - } - - var idx ocispec.Index - if err := json.Unmarshal(p, &idx); err != nil { - return nil, err - } - - if platform == nil { - return idx.Manifests, nil - } - - var descs []ocispec.Descriptor - for _, d := range idx.Manifests { - if d.Platform == nil || platform.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 platform.Less(*descs[i].Platform, *descs[j].Platform) - }) - - wasIndex = true - - if len(descs) > limit { - return descs[:limit], nil - } - return descs, nil - } - return nil, errors.Wrapf(errdefs.ErrNotFound, "unexpected media type %v for %v", desc.MediaType, desc.Digest) - }), image); err != nil { - return ocispec.Manifest{}, err - } - - if len(m) == 0 { - err := errors.Wrapf(errdefs.ErrNotFound, "manifest %v", image.Digest) - if wasIndex { - err = errors.Wrapf(errdefs.ErrNotFound, "no match for platform in manifest %v", image.Digest) - } - return ocispec.Manifest{}, err - } - return *m[0].m, nil -} - -// Config resolves the image configuration descriptor using a content provided -// to resolve child resources on the image. -// -// The caller can then use the descriptor to resolve and process the -// configuration of the image. -func Config(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Descriptor, error) { - manifest, err := Manifest(ctx, provider, image, platform) - if err != nil { - return ocispec.Descriptor{}, err - } - return manifest.Config, err -} - -// Platforms returns one or more platforms supported by the image. -func Platforms(ctx context.Context, provider content.Provider, image ocispec.Descriptor) ([]ocispec.Platform, error) { - var platformSpecs []ocispec.Platform - return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if desc.Platform != nil { - platformSpecs = append(platformSpecs, *desc.Platform) - return nil, ErrSkipDesc - } - - switch desc.MediaType { - case MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig: - p, err := content.ReadBlob(ctx, provider, desc) - if err != nil { - return nil, err - } - - var image ocispec.Image - if err := json.Unmarshal(p, &image); err != nil { - return nil, err - } - - platformSpecs = append(platformSpecs, - platforms.Normalize(ocispec.Platform{OS: image.OS, Architecture: image.Architecture})) - } - return nil, nil - }), ChildrenHandler(provider)), image) -} - -// Check returns nil if the all components of an image are available in the -// provider for the specified platform. -// -// If available is true, the caller can assume that required represents the -// complete set of content required for the image. -// -// missing will have the components that are part of required but not avaiiable -// in the provider. -// -// If there is a problem resolving content, an error will be returned. -func Check(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (available bool, required, present, missing []ocispec.Descriptor, err error) { - mfst, err := Manifest(ctx, provider, image, platform) - if err != nil { - if errdefs.IsNotFound(err) { - return false, []ocispec.Descriptor{image}, nil, []ocispec.Descriptor{image}, nil - } - - return false, nil, nil, nil, errors.Wrapf(err, "failed to check image %v", image.Digest) - } - - // TODO(stevvooe): It is possible that referenced conponents could have - // children, but this is rare. For now, we ignore this and only verify - // that manifest components are present. - required = append([]ocispec.Descriptor{mfst.Config}, mfst.Layers...) - - for _, desc := range required { - ra, err := provider.ReaderAt(ctx, desc) - if err != nil { - if errdefs.IsNotFound(err) { - missing = append(missing, desc) - continue - } else { - return false, nil, nil, nil, errors.Wrapf(err, "failed to check image %v", desc.Digest) - } - } - ra.Close() - present = append(present, desc) - - } - - return true, required, present, missing, nil -} - -// Children returns the immediate children of content described by the descriptor. -func Children(ctx context.Context, provider content.Provider, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - var descs []ocispec.Descriptor - switch desc.MediaType { - case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest: - p, err := content.ReadBlob(ctx, provider, desc) - if err != nil { - return nil, err - } - - // TODO(stevvooe): We just assume oci manifest, for now. There may be - // subtle differences from the docker version. - var manifest ocispec.Manifest - if err := json.Unmarshal(p, &manifest); err != nil { - return nil, err - } - - descs = append(descs, manifest.Config) - descs = append(descs, manifest.Layers...) - case MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex: - p, err := content.ReadBlob(ctx, provider, desc) - if err != nil { - return nil, err - } - - var index ocispec.Index - if err := json.Unmarshal(p, &index); err != nil { - return nil, err - } - - descs = append(descs, index.Manifests...) - default: - if IsLayerType(desc.MediaType) || IsKnownConfig(desc.MediaType) { - // childless data types. - return nil, nil - } - log.G(ctx).Warnf("encountered unknown type %v; children may not be fetched", desc.MediaType) - } - - return descs, nil -} - -// RootFS returns the unpacked diffids that make up and images rootfs. -// -// These are used to verify that a set of layers unpacked to the expected -// values. -func RootFS(ctx context.Context, provider content.Provider, configDesc ocispec.Descriptor) ([]digest.Digest, error) { - p, err := content.ReadBlob(ctx, provider, configDesc) - if err != nil { - return nil, err - } - - var config ocispec.Image - if err := json.Unmarshal(p, &config); err != nil { - return nil, err - } - return config.RootFS.DiffIDs, nil -} diff --git a/vendor/github.com/containerd/containerd/images/importexport.go b/vendor/github.com/containerd/containerd/images/importexport.go deleted file mode 100644 index 843adcadc7..0000000000 --- a/vendor/github.com/containerd/containerd/images/importexport.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -import ( - "context" - "io" - - "github.com/containerd/containerd/content" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Importer is the interface for image importer. -type Importer interface { - // Import imports an image from a tar stream. - Import(ctx context.Context, store content.Store, reader io.Reader) (ocispec.Descriptor, error) -} - -// Exporter is the interface for image exporter. -type Exporter interface { - // Export exports an image to a tar stream. - Export(ctx context.Context, store content.Provider, desc ocispec.Descriptor, writer io.Writer) error -} diff --git a/vendor/github.com/containerd/containerd/images/mediatypes.go b/vendor/github.com/containerd/containerd/images/mediatypes.go deleted file mode 100644 index 2f47b0e682..0000000000 --- a/vendor/github.com/containerd/containerd/images/mediatypes.go +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -import ( - "context" - "sort" - "strings" - - "github.com/containerd/containerd/errdefs" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// mediatype definitions for image components handled in containerd. -// -// oci components are generally referenced directly, although we may centralize -// here for clarity. -const ( - MediaTypeDockerSchema2Layer = "application/vnd.docker.image.rootfs.diff.tar" - MediaTypeDockerSchema2LayerForeign = "application/vnd.docker.image.rootfs.foreign.diff.tar" - MediaTypeDockerSchema2LayerGzip = "application/vnd.docker.image.rootfs.diff.tar.gzip" - MediaTypeDockerSchema2LayerForeignGzip = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip" - MediaTypeDockerSchema2Config = "application/vnd.docker.container.image.v1+json" - MediaTypeDockerSchema2Manifest = "application/vnd.docker.distribution.manifest.v2+json" - MediaTypeDockerSchema2ManifestList = "application/vnd.docker.distribution.manifest.list.v2+json" - // Checkpoint/Restore Media Types - MediaTypeContainerd1Checkpoint = "application/vnd.containerd.container.criu.checkpoint.criu.tar" - MediaTypeContainerd1CheckpointPreDump = "application/vnd.containerd.container.criu.checkpoint.predump.tar" - MediaTypeContainerd1Resource = "application/vnd.containerd.container.resource.tar" - MediaTypeContainerd1RW = "application/vnd.containerd.container.rw.tar" - MediaTypeContainerd1CheckpointConfig = "application/vnd.containerd.container.checkpoint.config.v1+proto" - MediaTypeContainerd1CheckpointOptions = "application/vnd.containerd.container.checkpoint.options.v1+proto" - MediaTypeContainerd1CheckpointRuntimeName = "application/vnd.containerd.container.checkpoint.runtime.name" - MediaTypeContainerd1CheckpointRuntimeOptions = "application/vnd.containerd.container.checkpoint.runtime.options+proto" - // Legacy Docker schema1 manifest - MediaTypeDockerSchema1Manifest = "application/vnd.docker.distribution.manifest.v1+prettyjws" -) - -// DiffCompression returns the compression as defined by the layer diff media -// type. For Docker media types without compression, "unknown" is returned to -// indicate that the media type may be compressed. If the media type is not -// recognized as a layer diff, then it returns errdefs.ErrNotImplemented -func DiffCompression(ctx context.Context, mediaType string) (string, error) { - base, ext := parseMediaTypes(mediaType) - switch base { - case MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerForeign: - if len(ext) > 0 { - // Type is wrapped - return "", nil - } - // These media types may have been compressed but failed to - // use the correct media type. The decompression function - // should detect and handle this case. - return "unknown", nil - case MediaTypeDockerSchema2LayerGzip, MediaTypeDockerSchema2LayerForeignGzip: - if len(ext) > 0 { - // Type is wrapped - return "", nil - } - return "gzip", nil - case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable: - if len(ext) > 0 { - switch ext[len(ext)-1] { - case "gzip": - return "gzip", nil - } - } - return "", nil - default: - return "", errdefs.ErrNotImplemented - } -} - -// parseMediaTypes splits the media type into the base type and -// an array of sorted extensions -func parseMediaTypes(mt string) (string, []string) { - if mt == "" { - return "", []string{} - } - - s := strings.Split(mt, "+") - ext := s[1:] - sort.Strings(ext) - - return s[0], ext -} - -// IsLayerTypes returns true if the media type is a layer -func IsLayerType(mt string) bool { - if strings.HasPrefix(mt, "application/vnd.oci.image.layer.") { - return true - } - - // Parse Docker media types, strip off any + suffixes first - base, _ := parseMediaTypes(mt) - switch base { - case MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerGzip, - MediaTypeDockerSchema2LayerForeign, MediaTypeDockerSchema2LayerForeignGzip: - return true - } - return false -} - -// IsKnownConfig returns true if the media type is a known config type -func IsKnownConfig(mt string) bool { - switch mt { - case MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig, - MediaTypeContainerd1Checkpoint, MediaTypeContainerd1CheckpointConfig: - return true - } - return false -} diff --git a/vendor/github.com/containerd/containerd/mount/lookup_unix.go b/vendor/github.com/containerd/containerd/mount/lookup_unix.go deleted file mode 100644 index e8b0a0b483..0000000000 --- a/vendor/github.com/containerd/containerd/mount/lookup_unix.go +++ /dev/null @@ -1,53 +0,0 @@ -// +build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "path/filepath" - "sort" - "strings" - - "github.com/pkg/errors" -) - -// Lookup returns the mount info corresponds to the path. -func Lookup(dir string) (Info, error) { - dir = filepath.Clean(dir) - - mounts, err := Self() - if err != nil { - return Info{}, err - } - - // Sort descending order by Info.Mountpoint - sort.SliceStable(mounts, func(i, j int) bool { - return mounts[j].Mountpoint < mounts[i].Mountpoint - }) - for _, m := range mounts { - // Note that m.{Major, Minor} are generally unreliable for our purpose here - // https://www.spinics.net/lists/linux-btrfs/msg58908.html - // Note that device number is not checked here, because for overlayfs files - // may have different device number with the mountpoint. - if strings.HasPrefix(dir, m.Mountpoint) { - return m, nil - } - } - - return Info{}, errors.Errorf("failed to find the mount info for %q", dir) -} diff --git a/vendor/github.com/containerd/containerd/mount/lookup_unsupported.go b/vendor/github.com/containerd/containerd/mount/lookup_unsupported.go deleted file mode 100644 index 46ec66a904..0000000000 --- a/vendor/github.com/containerd/containerd/mount/lookup_unsupported.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "fmt" - "runtime" -) - -// Lookup returns the mount info corresponds to the path. -func Lookup(dir string) (Info, error) { - return Info{}, fmt.Errorf("mount.Lookup is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} diff --git a/vendor/github.com/containerd/containerd/mount/mount.go b/vendor/github.com/containerd/containerd/mount/mount.go deleted file mode 100644 index b25556b2e0..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mount.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -// Mount is the lingua franca of containerd. A mount represents a -// serialized mount syscall. Components either emit or consume mounts. -type Mount struct { - // Type specifies the host-specific of the mount. - Type string - // Source specifies where to mount from. Depending on the host system, this - // can be a source path or device. - Source string - // Options contains zero or more fstab-style mount options. Typically, - // these are platform specific. - Options []string -} - -// All mounts all the provided mounts to the provided target -func All(mounts []Mount, target string) error { - for _, m := range mounts { - if err := m.Mount(target); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/mount/mount_linux.go b/vendor/github.com/containerd/containerd/mount/mount_linux.go deleted file mode 100644 index 6bbc50bbf1..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mount_linux.go +++ /dev/null @@ -1,319 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - "path" - "strings" - "time" - - "github.com/containerd/containerd/sys" - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -var pagesize = 4096 - -func init() { - pagesize = os.Getpagesize() -} - -// Mount to the provided target path -func (m *Mount) Mount(target string) error { - var ( - chdir string - options = m.Options - ) - - // avoid hitting one page limit of mount argument buffer - // - // NOTE: 512 is a buffer during pagesize check. - if m.Type == "overlay" && optionsSize(options) >= pagesize-512 { - chdir, options = compactLowerdirOption(options) - } - - flags, data := parseMountOptions(options) - if len(data) > pagesize { - return errors.Errorf("mount options is too long") - } - - // propagation types. - const ptypes = unix.MS_SHARED | unix.MS_PRIVATE | unix.MS_SLAVE | unix.MS_UNBINDABLE - - // Ensure propagation type change flags aren't included in other calls. - oflags := flags &^ ptypes - - // In the case of remounting with changed data (data != ""), need to call mount (moby/moby#34077). - if flags&unix.MS_REMOUNT == 0 || data != "" { - // Initial call applying all non-propagation flags for mount - // or remount with changed data - if err := mountAt(chdir, m.Source, target, m.Type, uintptr(oflags), data); err != nil { - return err - } - } - - if flags&ptypes != 0 { - // Change the propagation type. - const pflags = ptypes | unix.MS_REC | unix.MS_SILENT - if err := unix.Mount("", target, "", uintptr(flags&pflags), ""); err != nil { - return err - } - } - - const broflags = unix.MS_BIND | unix.MS_RDONLY - if oflags&broflags == broflags { - // Remount the bind to apply read only. - return unix.Mount("", target, "", uintptr(oflags|unix.MS_REMOUNT), "") - } - return nil -} - -// Unmount the provided mount path with the flags -func Unmount(target string, flags int) error { - if err := unmount(target, flags); err != nil && err != unix.EINVAL { - return err - } - return nil -} - -func unmount(target string, flags int) error { - for i := 0; i < 50; i++ { - if err := unix.Unmount(target, flags); err != nil { - switch err { - case unix.EBUSY: - time.Sleep(50 * time.Millisecond) - continue - default: - return err - } - } - return nil - } - return errors.Wrapf(unix.EBUSY, "failed to unmount target %s", target) -} - -// UnmountAll repeatedly unmounts the given mount point until there -// are no mounts remaining (EINVAL is returned by mount), which is -// useful for undoing a stack of mounts on the same mount point. -// UnmountAll all is noop when the first argument is an empty string. -// This is done when the containerd client did not specify any rootfs -// mounts (e.g. because the rootfs is managed outside containerd) -// UnmountAll is noop when the mount path does not exist. -func UnmountAll(mount string, flags int) error { - if mount == "" { - return nil - } - if _, err := os.Stat(mount); os.IsNotExist(err) { - return nil - } - - for { - if err := unmount(mount, flags); err != nil { - // EINVAL is returned if the target is not a - // mount point, indicating that we are - // done. It can also indicate a few other - // things (such as invalid flags) which we - // unfortunately end up squelching here too. - if err == unix.EINVAL { - return nil - } - return err - } - } -} - -// parseMountOptions takes fstab style mount options and parses them for -// use with a standard mount() syscall -func parseMountOptions(options []string) (int, string) { - var ( - flag int - data []string - ) - flags := map[string]struct { - clear bool - flag int - }{ - "async": {true, unix.MS_SYNCHRONOUS}, - "atime": {true, unix.MS_NOATIME}, - "bind": {false, unix.MS_BIND}, - "defaults": {false, 0}, - "dev": {true, unix.MS_NODEV}, - "diratime": {true, unix.MS_NODIRATIME}, - "dirsync": {false, unix.MS_DIRSYNC}, - "exec": {true, unix.MS_NOEXEC}, - "mand": {false, unix.MS_MANDLOCK}, - "noatime": {false, unix.MS_NOATIME}, - "nodev": {false, unix.MS_NODEV}, - "nodiratime": {false, unix.MS_NODIRATIME}, - "noexec": {false, unix.MS_NOEXEC}, - "nomand": {true, unix.MS_MANDLOCK}, - "norelatime": {true, unix.MS_RELATIME}, - "nostrictatime": {true, unix.MS_STRICTATIME}, - "nosuid": {false, unix.MS_NOSUID}, - "rbind": {false, unix.MS_BIND | unix.MS_REC}, - "relatime": {false, unix.MS_RELATIME}, - "remount": {false, unix.MS_REMOUNT}, - "ro": {false, unix.MS_RDONLY}, - "rw": {true, unix.MS_RDONLY}, - "strictatime": {false, unix.MS_STRICTATIME}, - "suid": {true, unix.MS_NOSUID}, - "sync": {false, unix.MS_SYNCHRONOUS}, - } - for _, o := range options { - // If the option does not exist in the flags table or the flag - // is not supported on the platform, - // then it is a data value for a specific fs type - if f, exists := flags[o]; exists && f.flag != 0 { - if f.clear { - flag &^= f.flag - } else { - flag |= f.flag - } - } else { - data = append(data, o) - } - } - return flag, strings.Join(data, ",") -} - -// compactLowerdirOption updates overlay lowdir option and returns the common -// dir among all the lowdirs. -func compactLowerdirOption(opts []string) (string, []string) { - idx, dirs := findOverlayLowerdirs(opts) - if idx == -1 || len(dirs) == 1 { - // no need to compact if there is only one lowerdir - return "", opts - } - - // find out common dir - commondir := longestCommonPrefix(dirs) - if commondir == "" { - return "", opts - } - - // NOTE: the snapshot id is based on digits. - // in order to avoid to get snapshots/x, should be back to parent dir. - // however, there is assumption that the common dir is ${root}/io.containerd.v1.overlayfs/snapshots. - commondir = path.Dir(commondir) - if commondir == "/" { - return "", opts - } - commondir = commondir + "/" - - newdirs := make([]string, 0, len(dirs)) - for _, dir := range dirs { - newdirs = append(newdirs, dir[len(commondir):]) - } - - newopts := copyOptions(opts) - newopts = append(newopts[:idx], newopts[idx+1:]...) - newopts = append(newopts, fmt.Sprintf("lowerdir=%s", strings.Join(newdirs, ":"))) - return commondir, newopts -} - -// findOverlayLowerdirs returns the index of lowerdir in mount's options and -// all the lowerdir target. -func findOverlayLowerdirs(opts []string) (int, []string) { - var ( - idx = -1 - prefix = "lowerdir=" - ) - - for i, opt := range opts { - if strings.HasPrefix(opt, prefix) { - idx = i - break - } - } - - if idx == -1 { - return -1, nil - } - return idx, strings.Split(opts[idx][len(prefix):], ":") -} - -// longestCommonPrefix finds the longest common prefix in the string slice. -func longestCommonPrefix(strs []string) string { - if len(strs) == 0 { - return "" - } else if len(strs) == 1 { - return strs[0] - } - - // find out the min/max value by alphabetical order - min, max := strs[0], strs[0] - for _, str := range strs[1:] { - if min > str { - min = str - } - if max < str { - max = str - } - } - - // find out the common part between min and max - for i := 0; i < len(min) && i < len(max); i++ { - if min[i] != max[i] { - return min[:i] - } - } - return min -} - -// copyOptions copies the options. -func copyOptions(opts []string) []string { - if len(opts) == 0 { - return nil - } - - acopy := make([]string, len(opts)) - copy(acopy, opts) - return acopy -} - -// optionsSize returns the byte size of options of mount. -func optionsSize(opts []string) int { - size := 0 - for _, opt := range opts { - size += len(opt) - } - return size -} - -func mountAt(chdir string, source, target, fstype string, flags uintptr, data string) error { - if chdir == "" { - return unix.Mount(source, target, fstype, flags, data) - } - - f, err := os.Open(chdir) - if err != nil { - return errors.Wrap(err, "failed to mountat") - } - defer f.Close() - - fs, err := f.Stat() - if err != nil { - return errors.Wrap(err, "failed to mountat") - } - - if !fs.IsDir() { - return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat") - } - return errors.Wrap(sys.FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") -} diff --git a/vendor/github.com/containerd/containerd/mount/mount_unix.go b/vendor/github.com/containerd/containerd/mount/mount_unix.go deleted file mode 100644 index 95da9428e6..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mount_unix.go +++ /dev/null @@ -1,41 +0,0 @@ -// +build darwin freebsd openbsd - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import "github.com/pkg/errors" - -var ( - // ErrNotImplementOnUnix is returned for methods that are not implemented - ErrNotImplementOnUnix = errors.New("not implemented under unix") -) - -// Mount is not implemented on this platform -func (m *Mount) Mount(target string) error { - return ErrNotImplementOnUnix -} - -// Unmount is not implemented on this platform -func Unmount(mount string, flags int) error { - return ErrNotImplementOnUnix -} - -// UnmountAll is not implemented on this platform -func UnmountAll(mount string, flags int) error { - return ErrNotImplementOnUnix -} diff --git a/vendor/github.com/containerd/containerd/mount/mount_windows.go b/vendor/github.com/containerd/containerd/mount/mount_windows.go deleted file mode 100644 index 5de25c4e0a..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mount_windows.go +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "encoding/json" - "path/filepath" - "strings" - - "github.com/Microsoft/hcsshim" - "github.com/pkg/errors" -) - -var ( - // ErrNotImplementOnWindows is returned when an action is not implemented for windows - ErrNotImplementOnWindows = errors.New("not implemented under windows") -) - -// Mount to the provided target -func (m *Mount) Mount(target string) error { - if m.Type != "windows-layer" { - return errors.Errorf("invalid windows mount type: '%s'", m.Type) - } - - home, layerID := filepath.Split(m.Source) - - parentLayerPaths, err := m.GetParentPaths() - if err != nil { - return err - } - - var di = hcsshim.DriverInfo{ - HomeDir: home, - } - - if err = hcsshim.ActivateLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to activate layer %s", m.Source) - } - defer func() { - if err != nil { - hcsshim.DeactivateLayer(di, layerID) - } - }() - - if err = hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil { - return errors.Wrapf(err, "failed to prepare layer %s", m.Source) - } - return nil -} - -// ParentLayerPathsFlag is the options flag used to represent the JSON encoded -// list of parent layers required to use the layer -const ParentLayerPathsFlag = "parentLayerPaths=" - -// GetParentPaths of the mount -func (m *Mount) GetParentPaths() ([]string, error) { - var parentLayerPaths []string - for _, option := range m.Options { - if strings.HasPrefix(option, ParentLayerPathsFlag) { - err := json.Unmarshal([]byte(option[len(ParentLayerPathsFlag):]), &parentLayerPaths) - if err != nil { - return nil, errors.Wrap(err, "failed to unmarshal parent layer paths from mount") - } - } - } - return parentLayerPaths, nil -} - -// Unmount the mount at the provided path -func Unmount(mount string, flags int) error { - var ( - home, layerID = filepath.Split(mount) - di = hcsshim.DriverInfo{ - HomeDir: home, - } - ) - - if err := hcsshim.UnprepareLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to unprepare layer %s", mount) - } - if err := hcsshim.DeactivateLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to deactivate layer %s", mount) - } - - return nil -} - -// UnmountAll unmounts from the provided path -func UnmountAll(mount string, flags int) error { - return Unmount(mount, flags) -} diff --git a/vendor/github.com/containerd/containerd/mount/mountinfo.go b/vendor/github.com/containerd/containerd/mount/mountinfo.go deleted file mode 100644 index e7a68402f5..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mountinfo.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -// Info reveals information about a particular mounted filesystem. This -// struct is populated from the content in the /proc//mountinfo file. -type Info struct { - // ID is a unique identifier of the mount (may be reused after umount). - ID int - - // Parent indicates the ID of the mount parent (or of self for the top of the - // mount tree). - Parent int - - // Major indicates one half of the device ID which identifies the device class. - Major int - - // Minor indicates one half of the device ID which identifies a specific - // instance of device. - Minor int - - // Root of the mount within the filesystem. - Root string - - // Mountpoint indicates the mount point relative to the process's root. - Mountpoint string - - // Options represents mount-specific options. - Options string - - // Optional represents optional fields. - Optional string - - // FSType indicates the type of filesystem, such as EXT3. - FSType string - - // Source indicates filesystem specific information or "none". - Source string - - // VFSOptions represents per super block options. - VFSOptions string -} diff --git a/vendor/github.com/containerd/containerd/mount/mountinfo_bsd.go b/vendor/github.com/containerd/containerd/mount/mountinfo_bsd.go deleted file mode 100644 index 8f8dbf95a4..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mountinfo_bsd.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build freebsd openbsd - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -/* -#include -#include -#include -*/ -import "C" - -import ( - "fmt" - "reflect" - "unsafe" -) - -// Self retrieves a list of mounts for the current running process. -func Self() ([]Info, error) { - var rawEntries *C.struct_statfs - - count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) - if count == 0 { - return nil, fmt.Errorf("Failed to call getmntinfo") - } - - var entries []C.struct_statfs - header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) - header.Cap = count - header.Len = count - header.Data = uintptr(unsafe.Pointer(rawEntries)) - - var out []Info - for _, entry := range entries { - var mountinfo Info - mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) - mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) - mountinfo.FSType = C.GoString(&entry.f_fstypename[0]) - out = append(out, mountinfo) - } - return out, nil -} - -// PID collects the mounts for a specific process ID. -func PID(pid int) ([]Info, error) { - return nil, fmt.Errorf("mountinfo.PID is not implemented on freebsd") -} diff --git a/vendor/github.com/containerd/containerd/mount/mountinfo_linux.go b/vendor/github.com/containerd/containerd/mount/mountinfo_linux.go deleted file mode 100644 index a7407c50ed..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mountinfo_linux.go +++ /dev/null @@ -1,145 +0,0 @@ -// +build linux - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "bufio" - "fmt" - "io" - "os" - "strconv" - "strings" - - "github.com/pkg/errors" -) - -// Self retrieves a list of mounts for the current running process. -func Self() ([]Info, error) { - f, err := os.Open("/proc/self/mountinfo") - if err != nil { - return nil, err - } - defer f.Close() - - return parseInfoFile(f) -} - -func parseInfoFile(r io.Reader) ([]Info, error) { - s := bufio.NewScanner(r) - out := []Info{} - var err error - for s.Scan() { - if err = s.Err(); err != nil { - return nil, err - } - - /* - See http://man7.org/linux/man-pages/man5/proc.5.html - - 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue - (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) - (1) mount ID: unique identifier of the mount (may be reused after umount) - (2) parent ID: ID of parent (or of self for the top of the mount tree) - (3) major:minor: value of st_dev for files on filesystem - (4) root: root of the mount within the filesystem - (5) mount point: mount point relative to the process's root - (6) mount options: per mount options - (7) optional fields: zero or more fields of the form "tag[:value]" - (8) separator: marks the end of the optional fields - (9) filesystem type: name of filesystem of the form "type[.subtype]" - (10) mount source: filesystem specific information or "none" - (11) super options: per super block options - */ - - text := s.Text() - fields := strings.Split(text, " ") - numFields := len(fields) - if numFields < 10 { - // should be at least 10 fields - return nil, errors.Errorf("parsing '%s' failed: not enough fields (%d)", text, numFields) - } - p := Info{} - // ignore any numbers parsing errors, as there should not be any - p.ID, _ = strconv.Atoi(fields[0]) - p.Parent, _ = strconv.Atoi(fields[1]) - mm := strings.Split(fields[2], ":") - if len(mm) != 2 { - return nil, errors.Errorf("parsing '%s' failed: unexpected minor:major pair %s", text, mm) - } - p.Major, _ = strconv.Atoi(mm[0]) - p.Minor, _ = strconv.Atoi(mm[1]) - - p.Root, err = strconv.Unquote(`"` + fields[3] + `"`) - if err != nil { - return nil, errors.Wrapf(err, "parsing '%s' failed: unable to unquote root field", fields[3]) - } - p.Mountpoint, err = strconv.Unquote(`"` + fields[4] + `"`) - if err != nil { - return nil, errors.Wrapf(err, "parsing '%s' failed: unable to unquote mount point field", fields[4]) - } - p.Options = fields[5] - - // one or more optional fields, when a separator (-) - i := 6 - for ; i < numFields && fields[i] != "-"; i++ { - switch i { - case 6: - p.Optional = fields[6] - default: - /* NOTE there might be more optional fields before the separator - such as fields[7]...fields[N] (where N < separatorIndex), - although as of Linux kernel 4.15 the only known ones are - mount propagation flags in fields[6]. The correct - behavior is to ignore any unknown optional fields. - */ - } - } - if i == numFields { - return nil, errors.Errorf("parsing '%s' failed: missing separator ('-')", text) - } - // There should be 3 fields after the separator... - if i+4 > numFields { - return nil, errors.Errorf("parsing '%s' failed: not enough fields after a separator", text) - } - // ... but in Linux <= 3.9 mounting a cifs with spaces in a share name - // (like "//serv/My Documents") _may_ end up having a space in the last field - // of mountinfo (like "unc=//serv/My Documents"). Since kernel 3.10-rc1, cifs - // option unc= is ignored, so a space should not appear. In here we ignore - // those "extra" fields caused by extra spaces. - p.FSType = fields[i+1] - p.Source = fields[i+2] - p.VFSOptions = fields[i+3] - - out = append(out, p) - } - return out, nil -} - -// PID collects the mounts for a specific process ID. If the process -// ID is unknown, it is better to use `Self` which will inspect -// "/proc/self/mountinfo" instead. -func PID(pid int) ([]Info, error) { - f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid)) - if err != nil { - return nil, err - } - defer f.Close() - - return parseInfoFile(f) -} diff --git a/vendor/github.com/containerd/containerd/mount/mountinfo_unsupported.go b/vendor/github.com/containerd/containerd/mount/mountinfo_unsupported.go deleted file mode 100644 index ae998db6b5..0000000000 --- a/vendor/github.com/containerd/containerd/mount/mountinfo_unsupported.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build !linux,!freebsd,!solaris,!openbsd freebsd,!cgo solaris,!cgo openbsd,!cgo - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "fmt" - "runtime" -) - -// Self retrieves a list of mounts for the current running process. -func Self() ([]Info, error) { - return nil, fmt.Errorf("mountinfo.Self is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} - -// PID collects the mounts for a specific process ID. -func PID(pid int) ([]Info, error) { - return nil, fmt.Errorf("mountinfo.PID is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} diff --git a/vendor/github.com/containerd/containerd/mount/temp.go b/vendor/github.com/containerd/containerd/mount/temp.go deleted file mode 100644 index 9dc4010fee..0000000000 --- a/vendor/github.com/containerd/containerd/mount/temp.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "context" - "io/ioutil" - "os" - - "github.com/containerd/containerd/log" - "github.com/pkg/errors" -) - -var tempMountLocation = getTempDir() - -// WithTempMount mounts the provided mounts to a temp dir, and pass the temp dir to f. -// The mounts are valid during the call to the f. -// Finally we will unmount and remove the temp dir regardless of the result of f. -func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { - root, uerr := ioutil.TempDir(tempMountLocation, "containerd-mount") - if uerr != nil { - return errors.Wrapf(uerr, "failed to create temp dir") - } - // We use Remove here instead of RemoveAll. - // The RemoveAll will delete the temp dir and all children it contains. - // When the Unmount fails, RemoveAll will incorrectly delete data from - // the mounted dir. However, if we use Remove, even though we won't - // successfully delete the temp dir and it may leak, we won't loss data - // from the mounted dir. - // For details, please refer to #1868 #1785. - defer func() { - if uerr = os.Remove(root); uerr != nil { - log.G(ctx).WithError(uerr).WithField("dir", root).Errorf("failed to remove mount temp dir") - } - }() - - // We should do defer first, if not we will not do Unmount when only a part of Mounts are failed. - defer func() { - if uerr = UnmountAll(root, 0); uerr != nil { - uerr = errors.Wrapf(uerr, "failed to unmount %s", root) - if err == nil { - err = uerr - } else { - err = errors.Wrap(err, uerr.Error()) - } - } - }() - if uerr = All(mounts, root); uerr != nil { - return errors.Wrapf(uerr, "failed to mount %s", root) - } - return errors.Wrapf(f(root), "mount callback failed on %s", root) -} - -func getTempDir() string { - if xdg := os.Getenv("XDG_RUNTIME_DIR"); xdg != "" { - return xdg - } - return os.TempDir() -} diff --git a/vendor/github.com/containerd/containerd/mount/temp_unix.go b/vendor/github.com/containerd/containerd/mount/temp_unix.go deleted file mode 100644 index 3d490e8a70..0000000000 --- a/vendor/github.com/containerd/containerd/mount/temp_unix.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -import ( - "os" - "path/filepath" - "sort" - "strings" -) - -// SetTempMountLocation sets the temporary mount location -func SetTempMountLocation(root string) error { - root, err := filepath.Abs(root) - if err != nil { - return err - } - if err := os.MkdirAll(root, 0700); err != nil { - return err - } - tempMountLocation = root - return nil -} - -// CleanupTempMounts all temp mounts and remove the directories -func CleanupTempMounts(flags int) (warnings []error, err error) { - mounts, err := Self() - if err != nil { - return nil, err - } - var toUnmount []string - for _, m := range mounts { - if strings.HasPrefix(m.Mountpoint, tempMountLocation) { - toUnmount = append(toUnmount, m.Mountpoint) - } - } - sort.Sort(sort.Reverse(sort.StringSlice(toUnmount))) - for _, path := range toUnmount { - if err := UnmountAll(path, flags); err != nil { - warnings = append(warnings, err) - continue - } - if err := os.Remove(path); err != nil { - warnings = append(warnings, err) - } - } - return warnings, nil -} diff --git a/vendor/github.com/containerd/containerd/mount/temp_unsupported.go b/vendor/github.com/containerd/containerd/mount/temp_unsupported.go deleted file mode 100644 index 942be4128a..0000000000 --- a/vendor/github.com/containerd/containerd/mount/temp_unsupported.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package mount - -// SetTempMountLocation sets the temporary mount location -func SetTempMountLocation(root string) error { - return nil -} - -// CleanupTempMounts all temp mounts and remove the directories -func CleanupTempMounts(flags int) ([]error, error) { - return nil, nil -} diff --git a/vendor/github.com/containerd/containerd/namespaces/context.go b/vendor/github.com/containerd/containerd/namespaces/context.go deleted file mode 100644 index 20596f09dd..0000000000 --- a/vendor/github.com/containerd/containerd/namespaces/context.go +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package namespaces - -import ( - "context" - "os" - - "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" -) - -const ( - // NamespaceEnvVar is the environment variable key name - NamespaceEnvVar = "CONTAINERD_NAMESPACE" - // Default is the name of the default namespace - Default = "default" -) - -type namespaceKey struct{} - -// WithNamespace sets a given namespace on the context -func WithNamespace(ctx context.Context, namespace string) context.Context { - ctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace - // also store on the grpc and ttrpc headers so it gets picked up by any clients that - // are using this. - return withTTRPCNamespaceHeader(withGRPCNamespaceHeader(ctx, namespace), namespace) -} - -// NamespaceFromEnv uses the namespace defined in CONTAINERD_NAMESPACE or -// default -func NamespaceFromEnv(ctx context.Context) context.Context { - namespace := os.Getenv(NamespaceEnvVar) - if namespace == "" { - namespace = Default - } - return WithNamespace(ctx, namespace) -} - -// Namespace returns the namespace from the context. -// -// The namespace is not guaranteed to be valid. -func Namespace(ctx context.Context) (string, bool) { - namespace, ok := ctx.Value(namespaceKey{}).(string) - if !ok { - if namespace, ok = fromGRPCHeader(ctx); !ok { - return fromTTRPCHeader(ctx) - } - } - return namespace, ok -} - -// NamespaceRequired returns the valid namespace from the context or an error. -func NamespaceRequired(ctx context.Context) (string, error) { - namespace, ok := Namespace(ctx) - if !ok || namespace == "" { - return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace is required") - } - if err := Validate(namespace); err != nil { - return "", errors.Wrap(err, "namespace validation") - } - return namespace, nil -} diff --git a/vendor/github.com/containerd/containerd/namespaces/grpc.go b/vendor/github.com/containerd/containerd/namespaces/grpc.go deleted file mode 100644 index 6991460da6..0000000000 --- a/vendor/github.com/containerd/containerd/namespaces/grpc.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package namespaces - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -const ( - // GRPCHeader defines the header name for specifying a containerd namespace. - GRPCHeader = "containerd-namespace" -) - -// NOTE(stevvooe): We can stub this file out if we don't want a grpc dependency here. - -func withGRPCNamespaceHeader(ctx context.Context, namespace string) context.Context { - // also store on the grpc headers so it gets picked up by any clients that - // are using this. - nsheader := metadata.Pairs(GRPCHeader, namespace) - md, ok := metadata.FromOutgoingContext(ctx) // merge with outgoing context. - if !ok { - md = nsheader - } else { - // order ensures the latest is first in this list. - md = metadata.Join(nsheader, md) - } - - return metadata.NewOutgoingContext(ctx, md) -} - -func fromGRPCHeader(ctx context.Context) (string, bool) { - // try to extract for use in grpc servers. - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - // TODO(stevvooe): Check outgoing context? - return "", false - } - - values := md[GRPCHeader] - if len(values) == 0 { - return "", false - } - - return values[0], true -} diff --git a/vendor/github.com/containerd/containerd/namespaces/store.go b/vendor/github.com/containerd/containerd/namespaces/store.go deleted file mode 100644 index 5936772cb4..0000000000 --- a/vendor/github.com/containerd/containerd/namespaces/store.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package namespaces - -import "context" - -// Store provides introspection about namespaces. -// -// Note that these are slightly different than other objects, which are record -// oriented. A namespace is really just a name and a set of labels. Objects -// that belong to a namespace are returned when the namespace is assigned to a -// given context. -// -// -type Store interface { - Create(ctx context.Context, namespace string, labels map[string]string) error - Labels(ctx context.Context, namespace string) (map[string]string, error) - SetLabel(ctx context.Context, namespace, key, value string) error - List(ctx context.Context) ([]string, error) - - // Delete removes the namespace. The namespace must be empty to be deleted. - Delete(ctx context.Context, namespace string, opts ...DeleteOpts) error -} - -// DeleteInfo specifies information for the deletion of a namespace -type DeleteInfo struct { - // Name of the namespace - Name string -} - -// DeleteOpts allows the caller to set options for namespace deletion -type DeleteOpts func(context.Context, *DeleteInfo) error diff --git a/vendor/github.com/containerd/containerd/namespaces/ttrpc.go b/vendor/github.com/containerd/containerd/namespaces/ttrpc.go deleted file mode 100644 index bcd2643cf5..0000000000 --- a/vendor/github.com/containerd/containerd/namespaces/ttrpc.go +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package namespaces - -import ( - "context" - - "github.com/containerd/ttrpc" -) - -const ( - // TTRPCHeader defines the header name for specifying a containerd namespace - TTRPCHeader = "containerd-namespace-ttrpc" -) - -func copyMetadata(src ttrpc.MD) ttrpc.MD { - md := ttrpc.MD{} - for k, v := range src { - md[k] = append(md[k], v...) - } - return md -} - -func withTTRPCNamespaceHeader(ctx context.Context, namespace string) context.Context { - md, ok := ttrpc.GetMetadata(ctx) - if !ok { - md = ttrpc.MD{} - } else { - md = copyMetadata(md) - } - md.Set(TTRPCHeader, namespace) - return ttrpc.WithMetadata(ctx, md) -} - -func fromTTRPCHeader(ctx context.Context) (string, bool) { - return ttrpc.GetMetadataValue(ctx, TTRPCHeader) -} diff --git a/vendor/github.com/containerd/containerd/namespaces/validate.go b/vendor/github.com/containerd/containerd/namespaces/validate.go deleted file mode 100644 index 222da3ea43..0000000000 --- a/vendor/github.com/containerd/containerd/namespaces/validate.go +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package namespaces provides tools for working with namespaces across -// containerd. -// -// Namespaces collect resources such as containers and images, into a unique -// identifier space. This means that two applications can use the same -// identifiers and not conflict while using containerd. -// -// This package can be used to ensure that client and server functions -// correctly store the namespace on the context. -package namespaces - -import ( - "regexp" - - "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" -) - -const ( - maxLength = 76 - alpha = `[A-Za-z]` - alphanum = `[A-Za-z0-9]+` - label = alpha + alphanum + `(:?[-]+` + alpha + alphanum + `)*` -) - -var ( - // namespaceRe validates that a namespace matches valid identifiers. - // - // Rules for domains, defined in RFC 1035, section 2.3.1, are used for - // namespaces. - namespaceRe = regexp.MustCompile(reAnchor(label + reGroup("[.]"+reGroup(label)) + "*")) -) - -// Validate returns nil if the string s is a valid namespace. -// -// To allow such namespace identifiers to be used across various contexts -// safely, the character set has been restricted to that defined for domains in -// RFC 1035, section 2.3.1. This will make namespace identifiers safe for use -// across networks, filesystems and other media. -// -// The identifier specification departs from RFC 1035 in that it allows -// "labels" to start with number and only enforces a total length restriction -// of 76 characters. -// -// While the character set may be expanded in the future, namespace identifiers -// are guaranteed to be safely used as filesystem path components. -// -// For the most part, this doesn't need to be called directly when using the -// context-oriented functions. -func Validate(s string) error { - if len(s) > maxLength { - return errors.Wrapf(errdefs.ErrInvalidArgument, "namespace %q greater than maximum length (%d characters)", s, maxLength) - } - - if !namespaceRe.MatchString(s) { - return errors.Wrapf(errdefs.ErrInvalidArgument, "namespace %q must match %v", s, namespaceRe) - } - return nil -} - -func reGroup(s string) string { - return `(?:` + s + `)` -} - -func reAnchor(s string) string { - return `^` + s + `$` -} diff --git a/vendor/github.com/containerd/containerd/oci/client.go b/vendor/github.com/containerd/containerd/oci/client.go deleted file mode 100644 index 9923101bfa..0000000000 --- a/vendor/github.com/containerd/containerd/oci/client.go +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "context" - - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/snapshots" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Client interface used by SpecOpt -type Client interface { - SnapshotService(snapshotterName string) snapshots.Snapshotter -} - -// Image interface used by some SpecOpt to query image configuration -type Image interface { - // Config descriptor for the image. - Config(ctx context.Context) (ocispec.Descriptor, error) - // ContentStore provides a content store which contains image blob data - ContentStore() content.Store -} diff --git a/vendor/github.com/containerd/containerd/oci/spec.go b/vendor/github.com/containerd/containerd/oci/spec.go deleted file mode 100644 index 035bb7e7d8..0000000000 --- a/vendor/github.com/containerd/containerd/oci/spec.go +++ /dev/null @@ -1,253 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "context" - "path/filepath" - "runtime" - - "github.com/containerd/containerd/namespaces" - "github.com/containerd/containerd/platforms" - - "github.com/containerd/containerd/containers" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -const ( - rwm = "rwm" - defaultRootfsPath = "rootfs" -) - -var ( - defaultUnixEnv = []string{ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - } -) - -// Spec is a type alias to the OCI runtime spec to allow third part SpecOpts -// to be created without the "issues" with go vendoring and package imports -type Spec = specs.Spec - -// GenerateSpec will generate a default spec from the provided image -// for use as a containerd container -func GenerateSpec(ctx context.Context, client Client, c *containers.Container, opts ...SpecOpts) (*Spec, error) { - return GenerateSpecWithPlatform(ctx, client, platforms.DefaultString(), c, opts...) -} - -// GenerateSpecWithPlatform will generate a default spec from the provided image -// for use as a containerd container in the platform requested. -func GenerateSpecWithPlatform(ctx context.Context, client Client, platform string, c *containers.Container, opts ...SpecOpts) (*Spec, error) { - var s Spec - if err := generateDefaultSpecWithPlatform(ctx, platform, c.ID, &s); err != nil { - return nil, err - } - - return &s, ApplyOpts(ctx, client, c, &s, opts...) -} - -func generateDefaultSpecWithPlatform(ctx context.Context, platform, id string, s *Spec) error { - plat, err := platforms.Parse(platform) - if err != nil { - return err - } - - if plat.OS == "windows" { - err = populateDefaultWindowsSpec(ctx, s, id) - } else { - err = populateDefaultUnixSpec(ctx, s, id) - if err == nil && runtime.GOOS == "windows" { - // To run LCOW we have a Linux and Windows section. Add an empty one now. - s.Windows = &specs.Windows{} - } - } - return err -} - -// ApplyOpts applies the options to the given spec, injecting data from the -// context, client and container instance. -func ApplyOpts(ctx context.Context, client Client, c *containers.Container, s *Spec, opts ...SpecOpts) error { - for _, o := range opts { - if err := o(ctx, client, c, s); err != nil { - return err - } - } - - return nil -} - -func defaultUnixCaps() []string { - return []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - } -} - -func defaultUnixNamespaces() []specs.LinuxNamespace { - return []specs.LinuxNamespace{ - { - Type: specs.PIDNamespace, - }, - { - Type: specs.IPCNamespace, - }, - { - Type: specs.UTSNamespace, - }, - { - Type: specs.MountNamespace, - }, - { - Type: specs.NetworkNamespace, - }, - } -} - -func populateDefaultUnixSpec(ctx context.Context, s *Spec, id string) error { - ns, err := namespaces.NamespaceRequired(ctx) - if err != nil { - return err - } - - *s = Spec{ - Version: specs.Version, - Root: &specs.Root{ - Path: defaultRootfsPath, - }, - Process: &specs.Process{ - Cwd: "/", - NoNewPrivileges: true, - User: specs.User{ - UID: 0, - GID: 0, - }, - Capabilities: &specs.LinuxCapabilities{ - Bounding: defaultUnixCaps(), - Permitted: defaultUnixCaps(), - Inheritable: defaultUnixCaps(), - Effective: defaultUnixCaps(), - }, - Rlimits: []specs.POSIXRlimit{ - { - Type: "RLIMIT_NOFILE", - Hard: uint64(1024), - Soft: uint64(1024), - }, - }, - }, - Mounts: []specs.Mount{ - { - Destination: "/proc", - Type: "proc", - Source: "proc", - Options: []string{"nosuid", "noexec", "nodev"}, - }, - { - Destination: "/dev", - Type: "tmpfs", - Source: "tmpfs", - Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"}, - }, - { - Destination: "/dev/pts", - Type: "devpts", - Source: "devpts", - Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"}, - }, - { - Destination: "/dev/shm", - Type: "tmpfs", - Source: "shm", - Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"}, - }, - { - Destination: "/dev/mqueue", - Type: "mqueue", - Source: "mqueue", - Options: []string{"nosuid", "noexec", "nodev"}, - }, - { - Destination: "/sys", - Type: "sysfs", - Source: "sysfs", - Options: []string{"nosuid", "noexec", "nodev", "ro"}, - }, - { - Destination: "/run", - Type: "tmpfs", - Source: "tmpfs", - Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"}, - }, - }, - Linux: &specs.Linux{ - MaskedPaths: []string{ - "/proc/acpi", - "/proc/asound", - "/proc/kcore", - "/proc/keys", - "/proc/latency_stats", - "/proc/timer_list", - "/proc/timer_stats", - "/proc/sched_debug", - "/sys/firmware", - "/proc/scsi", - }, - ReadonlyPaths: []string{ - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger", - }, - CgroupsPath: filepath.Join("/", ns, id), - Resources: &specs.LinuxResources{ - Devices: []specs.LinuxDeviceCgroup{ - { - Allow: false, - Access: rwm, - }, - }, - }, - Namespaces: defaultUnixNamespaces(), - }, - } - return nil -} - -func populateDefaultWindowsSpec(ctx context.Context, s *Spec, id string) error { - *s = Spec{ - Version: specs.Version, - Root: &specs.Root{}, - Process: &specs.Process{ - Cwd: `C:\`, - }, - Windows: &specs.Windows{}, - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/oci/spec_opts.go b/vendor/github.com/containerd/containerd/oci/spec_opts.go deleted file mode 100644 index 51818acbce..0000000000 --- a/vendor/github.com/containerd/containerd/oci/spec_opts.go +++ /dev/null @@ -1,1263 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "bufio" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - - "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/content" - "github.com/containerd/containerd/images" - "github.com/containerd/containerd/mount" - "github.com/containerd/containerd/namespaces" - "github.com/containerd/containerd/platforms" - "github.com/containerd/continuity/fs" - v1 "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/opencontainers/runc/libcontainer/user" - specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" - "github.com/syndtr/gocapability/capability" -) - -// SpecOpts sets spec specific information to a newly generated OCI spec -type SpecOpts func(context.Context, Client, *containers.Container, *Spec) error - -// Compose converts a sequence of spec operations into a single operation -func Compose(opts ...SpecOpts) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) error { - for _, o := range opts { - if err := o(ctx, client, c, s); err != nil { - return err - } - } - return nil - } -} - -// setProcess sets Process to empty if unset -func setProcess(s *Spec) { - if s.Process == nil { - s.Process = &specs.Process{} - } -} - -// setRoot sets Root to empty if unset -func setRoot(s *Spec) { - if s.Root == nil { - s.Root = &specs.Root{} - } -} - -// setLinux sets Linux to empty if unset -func setLinux(s *Spec) { - if s.Linux == nil { - s.Linux = &specs.Linux{} - } -} - -// nolint -func setResources(s *Spec) { - if s.Linux != nil { - if s.Linux.Resources == nil { - s.Linux.Resources = &specs.LinuxResources{} - } - } - if s.Windows != nil { - if s.Windows.Resources == nil { - s.Windows.Resources = &specs.WindowsResources{} - } - } -} - -// setCapabilities sets Linux Capabilities to empty if unset -func setCapabilities(s *Spec) { - setProcess(s) - if s.Process.Capabilities == nil { - s.Process.Capabilities = &specs.LinuxCapabilities{} - } -} - -// WithDefaultSpec returns a SpecOpts that will populate the spec with default -// values. -// -// Use as the first option to clear the spec, then apply options afterwards. -func WithDefaultSpec() SpecOpts { - return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error { - return generateDefaultSpecWithPlatform(ctx, platforms.DefaultString(), c.ID, s) - } -} - -// WithDefaultSpecForPlatform returns a SpecOpts that will populate the spec -// with default values for a given platform. -// -// Use as the first option to clear the spec, then apply options afterwards. -func WithDefaultSpecForPlatform(platform string) SpecOpts { - return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error { - return generateDefaultSpecWithPlatform(ctx, platform, c.ID, s) - } -} - -// WithSpecFromBytes loads the spec from the provided byte slice. -func WithSpecFromBytes(p []byte) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - *s = Spec{} // make sure spec is cleared. - if err := json.Unmarshal(p, s); err != nil { - return errors.Wrapf(err, "decoding spec config file failed, current supported OCI runtime-spec : v%s", specs.Version) - } - return nil - } -} - -// WithSpecFromFile loads the specification from the provided filename. -func WithSpecFromFile(filename string) SpecOpts { - return func(ctx context.Context, c Client, container *containers.Container, s *Spec) error { - p, err := ioutil.ReadFile(filename) - if err != nil { - return errors.Wrap(err, "cannot load spec config file") - } - return WithSpecFromBytes(p)(ctx, c, container, s) - } -} - -// WithEnv appends environment variables -func WithEnv(environmentVariables []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if len(environmentVariables) > 0 { - setProcess(s) - s.Process.Env = replaceOrAppendEnvValues(s.Process.Env, environmentVariables) - } - return nil - } -} - -// WithDefaultPathEnv sets the $PATH environment variable to the -// default PATH defined in this package. -func WithDefaultPathEnv(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Process.Env = replaceOrAppendEnvValues(s.Process.Env, defaultUnixEnv) - return nil -} - -// replaceOrAppendEnvValues returns the defaults with the overrides either -// replaced by env key or appended to the list -func replaceOrAppendEnvValues(defaults, overrides []string) []string { - cache := make(map[string]int, len(defaults)) - results := make([]string, 0, len(defaults)) - for i, e := range defaults { - parts := strings.SplitN(e, "=", 2) - results = append(results, e) - cache[parts[0]] = i - } - - for _, value := range overrides { - // Values w/o = means they want this env to be removed/unset. - if !strings.Contains(value, "=") { - if i, exists := cache[value]; exists { - results[i] = "" // Used to indicate it should be removed - } - continue - } - - // Just do a normal set/update - parts := strings.SplitN(value, "=", 2) - if i, exists := cache[parts[0]]; exists { - results[i] = value - } else { - results = append(results, value) - } - } - - // Now remove all entries that we want to "unset" - for i := 0; i < len(results); i++ { - if results[i] == "" { - results = append(results[:i], results[i+1:]...) - i-- - } - } - - return results -} - -// WithProcessArgs replaces the args on the generated spec -func WithProcessArgs(args ...string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.Args = args - return nil - } -} - -// WithProcessCwd replaces the current working directory on the generated spec -func WithProcessCwd(cwd string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.Cwd = cwd - return nil - } -} - -// WithTTY sets the information on the spec as well as the environment variables for -// using a TTY -func WithTTY(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.Terminal = true - if s.Linux != nil { - s.Process.Env = append(s.Process.Env, "TERM=xterm") - } - - return nil -} - -// WithTTYSize sets the information on the spec as well as the environment variables for -// using a TTY -func WithTTYSize(width, height int) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - if s.Process.ConsoleSize == nil { - s.Process.ConsoleSize = &specs.Box{} - } - s.Process.ConsoleSize.Width = uint(width) - s.Process.ConsoleSize.Height = uint(height) - return nil - } -} - -// WithHostname sets the container's hostname -func WithHostname(name string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Hostname = name - return nil - } -} - -// WithMounts appends mounts -func WithMounts(mounts []specs.Mount) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Mounts = append(s.Mounts, mounts...) - return nil - } -} - -// WithHostNamespace allows a task to run inside the host's linux namespace -func WithHostNamespace(ns specs.LinuxNamespaceType) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - for i, n := range s.Linux.Namespaces { - if n.Type == ns { - s.Linux.Namespaces = append(s.Linux.Namespaces[:i], s.Linux.Namespaces[i+1:]...) - return nil - } - } - return nil - } -} - -// WithLinuxNamespace uses the passed in namespace for the spec. If a namespace of the same type already exists in the -// spec, the existing namespace is replaced by the one provided. -func WithLinuxNamespace(ns specs.LinuxNamespace) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - for i, n := range s.Linux.Namespaces { - if n.Type == ns.Type { - before := s.Linux.Namespaces[:i] - after := s.Linux.Namespaces[i+1:] - s.Linux.Namespaces = append(before, ns) - s.Linux.Namespaces = append(s.Linux.Namespaces, after...) - return nil - } - } - s.Linux.Namespaces = append(s.Linux.Namespaces, ns) - return nil - } -} - -// WithNewPrivileges turns off the NoNewPrivileges feature flag in the spec -func WithNewPrivileges(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.NoNewPrivileges = false - - return nil -} - -// WithImageConfig configures the spec to from the configuration of an Image -func WithImageConfig(image Image) SpecOpts { - return WithImageConfigArgs(image, nil) -} - -// WithImageConfigArgs configures the spec to from the configuration of an Image with additional args that -// replaces the CMD of the image -func WithImageConfigArgs(image Image, args []string) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) error { - ic, err := image.Config(ctx) - if err != nil { - return err - } - var ( - ociimage v1.Image - config v1.ImageConfig - ) - switch ic.MediaType { - case v1.MediaTypeImageConfig, images.MediaTypeDockerSchema2Config: - p, err := content.ReadBlob(ctx, image.ContentStore(), ic) - if err != nil { - return err - } - - if err := json.Unmarshal(p, &ociimage); err != nil { - return err - } - config = ociimage.Config - default: - return fmt.Errorf("unknown image config media type %s", ic.MediaType) - } - - setProcess(s) - if s.Linux != nil { - defaults := config.Env - if len(defaults) == 0 { - defaults = defaultUnixEnv - } - s.Process.Env = replaceOrAppendEnvValues(defaults, s.Process.Env) - cmd := config.Cmd - if len(args) > 0 { - cmd = args - } - s.Process.Args = append(config.Entrypoint, cmd...) - - cwd := config.WorkingDir - if cwd == "" { - cwd = "/" - } - s.Process.Cwd = cwd - if config.User != "" { - if err := WithUser(config.User)(ctx, client, c, s); err != nil { - return err - } - return WithAdditionalGIDs(fmt.Sprintf("%d", s.Process.User.UID))(ctx, client, c, s) - } - // we should query the image's /etc/group for additional GIDs - // even if there is no specified user in the image config - return WithAdditionalGIDs("root")(ctx, client, c, s) - } else if s.Windows != nil { - s.Process.Env = replaceOrAppendEnvValues(config.Env, s.Process.Env) - cmd := config.Cmd - if len(args) > 0 { - cmd = args - } - s.Process.Args = append(config.Entrypoint, cmd...) - - s.Process.Cwd = config.WorkingDir - s.Process.User = specs.User{ - Username: config.User, - } - } else { - return errors.New("spec does not contain Linux or Windows section") - } - return nil - } -} - -// WithRootFSPath specifies unmanaged rootfs path. -func WithRootFSPath(path string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setRoot(s) - s.Root.Path = path - // Entrypoint is not set here (it's up to caller) - return nil - } -} - -// WithRootFSReadonly sets specs.Root.Readonly to true -func WithRootFSReadonly() SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setRoot(s) - s.Root.Readonly = true - return nil - } -} - -// WithNoNewPrivileges sets no_new_privileges on the process for the container -func WithNoNewPrivileges(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.NoNewPrivileges = true - return nil -} - -// WithHostHostsFile bind-mounts the host's /etc/hosts into the container as readonly -func WithHostHostsFile(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Mounts = append(s.Mounts, specs.Mount{ - Destination: "/etc/hosts", - Type: "bind", - Source: "/etc/hosts", - Options: []string{"rbind", "ro"}, - }) - return nil -} - -// WithHostResolvconf bind-mounts the host's /etc/resolv.conf into the container as readonly -func WithHostResolvconf(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Mounts = append(s.Mounts, specs.Mount{ - Destination: "/etc/resolv.conf", - Type: "bind", - Source: "/etc/resolv.conf", - Options: []string{"rbind", "ro"}, - }) - return nil -} - -// WithHostLocaltime bind-mounts the host's /etc/localtime into the container as readonly -func WithHostLocaltime(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - s.Mounts = append(s.Mounts, specs.Mount{ - Destination: "/etc/localtime", - Type: "bind", - Source: "/etc/localtime", - Options: []string{"rbind", "ro"}, - }) - return nil -} - -// WithUserNamespace sets the uid and gid mappings for the task -// this can be called multiple times to add more mappings to the generated spec -func WithUserNamespace(container, host, size uint32) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - var hasUserns bool - setLinux(s) - for _, ns := range s.Linux.Namespaces { - if ns.Type == specs.UserNamespace { - hasUserns = true - break - } - } - if !hasUserns { - s.Linux.Namespaces = append(s.Linux.Namespaces, specs.LinuxNamespace{ - Type: specs.UserNamespace, - }) - } - mapping := specs.LinuxIDMapping{ - ContainerID: container, - HostID: host, - Size: size, - } - s.Linux.UIDMappings = append(s.Linux.UIDMappings, mapping) - s.Linux.GIDMappings = append(s.Linux.GIDMappings, mapping) - return nil - } -} - -// WithCgroup sets the container's cgroup path -func WithCgroup(path string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - s.Linux.CgroupsPath = path - return nil - } -} - -// WithNamespacedCgroup uses the namespace set on the context to create a -// root directory for containers in the cgroup with the id as the subcgroup -func WithNamespacedCgroup() SpecOpts { - return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error { - namespace, err := namespaces.NamespaceRequired(ctx) - if err != nil { - return err - } - setLinux(s) - s.Linux.CgroupsPath = filepath.Join("/", namespace, c.ID) - return nil - } -} - -// WithUser sets the user to be used within the container. -// It accepts a valid user string in OCI Image Spec v1.0.0: -// user, uid, user:group, uid:gid, uid:group, user:gid -func WithUser(userstr string) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) error { - setProcess(s) - parts := strings.Split(userstr, ":") - switch len(parts) { - case 1: - v, err := strconv.Atoi(parts[0]) - if err != nil { - // if we cannot parse as a uint they try to see if it is a username - return WithUsername(userstr)(ctx, client, c, s) - } - return WithUserID(uint32(v))(ctx, client, c, s) - case 2: - var ( - username string - groupname string - ) - var uid, gid uint32 - v, err := strconv.Atoi(parts[0]) - if err != nil { - username = parts[0] - } else { - uid = uint32(v) - } - if v, err = strconv.Atoi(parts[1]); err != nil { - groupname = parts[1] - } else { - gid = uint32(v) - } - if username == "" && groupname == "" { - s.Process.User.UID, s.Process.User.GID = uid, gid - return nil - } - f := func(root string) error { - if username != "" { - user, err := getUserFromPath(root, func(u user.User) bool { - return u.Name == username - }) - if err != nil { - return err - } - uid = uint32(user.Uid) - } - if groupname != "" { - gid, err = getGIDFromPath(root, func(g user.Group) bool { - return g.Name == groupname - }) - if err != nil { - return err - } - } - s.Process.User.UID, s.Process.User.GID = uid, gid - return nil - } - if c.Snapshotter == "" && c.SnapshotKey == "" { - if !isRootfsAbs(s.Root.Path) { - return errors.New("rootfs absolute path is required") - } - return f(s.Root.Path) - } - if c.Snapshotter == "" { - return errors.New("no snapshotter set for container") - } - if c.SnapshotKey == "" { - return errors.New("rootfs snapshot not created for container") - } - snapshotter := client.SnapshotService(c.Snapshotter) - mounts, err := snapshotter.Mounts(ctx, c.SnapshotKey) - if err != nil { - return err - } - return mount.WithTempMount(ctx, mounts, f) - default: - return fmt.Errorf("invalid USER value %s", userstr) - } - } -} - -// WithUIDGID allows the UID and GID for the Process to be set -func WithUIDGID(uid, gid uint32) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.User.UID = uid - s.Process.User.GID = gid - return nil - } -} - -// WithUserID sets the correct UID and GID for the container based -// on the image's /etc/passwd contents. If /etc/passwd does not exist, -// or uid is not found in /etc/passwd, it sets the requested uid, -// additionally sets the gid to 0, and does not return an error. -func WithUserID(uid uint32) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) (err error) { - setProcess(s) - if c.Snapshotter == "" && c.SnapshotKey == "" { - if !isRootfsAbs(s.Root.Path) { - return errors.Errorf("rootfs absolute path is required") - } - user, err := getUserFromPath(s.Root.Path, func(u user.User) bool { - return u.Uid == int(uid) - }) - if err != nil { - if os.IsNotExist(err) || err == errNoUsersFound { - s.Process.User.UID, s.Process.User.GID = uid, 0 - return nil - } - return err - } - s.Process.User.UID, s.Process.User.GID = uint32(user.Uid), uint32(user.Gid) - return nil - - } - if c.Snapshotter == "" { - return errors.Errorf("no snapshotter set for container") - } - if c.SnapshotKey == "" { - return errors.Errorf("rootfs snapshot not created for container") - } - snapshotter := client.SnapshotService(c.Snapshotter) - mounts, err := snapshotter.Mounts(ctx, c.SnapshotKey) - if err != nil { - return err - } - return mount.WithTempMount(ctx, mounts, func(root string) error { - user, err := getUserFromPath(root, func(u user.User) bool { - return u.Uid == int(uid) - }) - if err != nil { - if os.IsNotExist(err) || err == errNoUsersFound { - s.Process.User.UID, s.Process.User.GID = uid, 0 - return nil - } - return err - } - s.Process.User.UID, s.Process.User.GID = uint32(user.Uid), uint32(user.Gid) - return nil - }) - } -} - -// WithUsername sets the correct UID and GID for the container -// based on the image's /etc/passwd contents. If /etc/passwd -// does not exist, or the username is not found in /etc/passwd, -// it returns error. -func WithUsername(username string) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) (err error) { - setProcess(s) - if s.Linux != nil { - if c.Snapshotter == "" && c.SnapshotKey == "" { - if !isRootfsAbs(s.Root.Path) { - return errors.Errorf("rootfs absolute path is required") - } - user, err := getUserFromPath(s.Root.Path, func(u user.User) bool { - return u.Name == username - }) - if err != nil { - return err - } - s.Process.User.UID, s.Process.User.GID = uint32(user.Uid), uint32(user.Gid) - return nil - } - if c.Snapshotter == "" { - return errors.Errorf("no snapshotter set for container") - } - if c.SnapshotKey == "" { - return errors.Errorf("rootfs snapshot not created for container") - } - snapshotter := client.SnapshotService(c.Snapshotter) - mounts, err := snapshotter.Mounts(ctx, c.SnapshotKey) - if err != nil { - return err - } - return mount.WithTempMount(ctx, mounts, func(root string) error { - user, err := getUserFromPath(root, func(u user.User) bool { - return u.Name == username - }) - if err != nil { - return err - } - s.Process.User.UID, s.Process.User.GID = uint32(user.Uid), uint32(user.Gid) - return nil - }) - } else if s.Windows != nil { - s.Process.User.Username = username - } else { - return errors.New("spec does not contain Linux or Windows section") - } - return nil - } -} - -// WithAdditionalGIDs sets the OCI spec's additionalGids array to any additional groups listed -// for a particular user in the /etc/groups file of the image's root filesystem -// The passed in user can be either a uid or a username. -func WithAdditionalGIDs(userstr string) SpecOpts { - return func(ctx context.Context, client Client, c *containers.Container, s *Spec) (err error) { - // For LCOW additional GID's not supported - if s.Windows != nil { - return nil - } - setProcess(s) - setAdditionalGids := func(root string) error { - var username string - uid, err := strconv.Atoi(userstr) - if err == nil { - user, err := getUserFromPath(root, func(u user.User) bool { - return u.Uid == uid - }) - if err != nil { - if os.IsNotExist(err) || err == errNoUsersFound { - return nil - } - return err - } - username = user.Name - } else { - username = userstr - } - gids, err := getSupplementalGroupsFromPath(root, func(g user.Group) bool { - // we only want supplemental groups - if g.Name == username { - return false - } - for _, entry := range g.List { - if entry == username { - return true - } - } - return false - }) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - s.Process.User.AdditionalGids = gids - return nil - } - if c.Snapshotter == "" && c.SnapshotKey == "" { - if !isRootfsAbs(s.Root.Path) { - return errors.Errorf("rootfs absolute path is required") - } - return setAdditionalGids(s.Root.Path) - } - if c.Snapshotter == "" { - return errors.Errorf("no snapshotter set for container") - } - if c.SnapshotKey == "" { - return errors.Errorf("rootfs snapshot not created for container") - } - snapshotter := client.SnapshotService(c.Snapshotter) - mounts, err := snapshotter.Mounts(ctx, c.SnapshotKey) - if err != nil { - return err - } - return mount.WithTempMount(ctx, mounts, setAdditionalGids) - } -} - -// WithCapabilities sets Linux capabilities on the process -func WithCapabilities(caps []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setCapabilities(s) - - s.Process.Capabilities.Bounding = caps - s.Process.Capabilities.Effective = caps - s.Process.Capabilities.Permitted = caps - s.Process.Capabilities.Inheritable = caps - - return nil - } -} - -// WithAllCapabilities sets all linux capabilities for the process -var WithAllCapabilities = func(ctx context.Context, client Client, c *containers.Container, s *Spec) error { - return WithCapabilities(GetAllCapabilities())(ctx, client, c, s) -} - -// GetAllCapabilities returns all caps up to CAP_LAST_CAP -// or CAP_BLOCK_SUSPEND on RHEL6 -func GetAllCapabilities() []string { - last := capability.CAP_LAST_CAP - // hack for RHEL6 which has no /proc/sys/kernel/cap_last_cap - if last == capability.Cap(63) { - last = capability.CAP_BLOCK_SUSPEND - } - var caps []string - for _, cap := range capability.List() { - if cap > last { - continue - } - caps = append(caps, "CAP_"+strings.ToUpper(cap.String())) - } - return caps -} - -func capsContain(caps []string, s string) bool { - for _, c := range caps { - if c == s { - return true - } - } - return false -} - -func removeCap(caps *[]string, s string) { - var newcaps []string - for _, c := range *caps { - if c == s { - continue - } - newcaps = append(newcaps, c) - } - *caps = newcaps -} - -// WithAddedCapabilities adds the provided capabilities -func WithAddedCapabilities(caps []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setCapabilities(s) - for _, c := range caps { - for _, cl := range []*[]string{ - &s.Process.Capabilities.Bounding, - &s.Process.Capabilities.Effective, - &s.Process.Capabilities.Permitted, - &s.Process.Capabilities.Inheritable, - } { - if !capsContain(*cl, c) { - *cl = append(*cl, c) - } - } - } - return nil - } -} - -// WithDroppedCapabilities removes the provided capabilities -func WithDroppedCapabilities(caps []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setCapabilities(s) - for _, c := range caps { - for _, cl := range []*[]string{ - &s.Process.Capabilities.Bounding, - &s.Process.Capabilities.Effective, - &s.Process.Capabilities.Permitted, - &s.Process.Capabilities.Inheritable, - } { - removeCap(cl, c) - } - } - return nil - } -} - -// WithAmbientCapabilities set the Linux ambient capabilities for the process -// Ambient capabilities should only be set for non-root users or the caller should -// understand how these capabilities are used and set -func WithAmbientCapabilities(caps []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setCapabilities(s) - - s.Process.Capabilities.Ambient = caps - return nil - } -} - -var errNoUsersFound = errors.New("no users found") - -func getUserFromPath(root string, filter func(user.User) bool) (user.User, error) { - ppath, err := fs.RootPath(root, "/etc/passwd") - if err != nil { - return user.User{}, err - } - users, err := user.ParsePasswdFileFilter(ppath, filter) - if err != nil { - return user.User{}, err - } - if len(users) == 0 { - return user.User{}, errNoUsersFound - } - return users[0], nil -} - -var errNoGroupsFound = errors.New("no groups found") - -func getGIDFromPath(root string, filter func(user.Group) bool) (gid uint32, err error) { - gpath, err := fs.RootPath(root, "/etc/group") - if err != nil { - return 0, err - } - groups, err := user.ParseGroupFileFilter(gpath, filter) - if err != nil { - return 0, err - } - if len(groups) == 0 { - return 0, errNoGroupsFound - } - g := groups[0] - return uint32(g.Gid), nil -} - -func getSupplementalGroupsFromPath(root string, filter func(user.Group) bool) ([]uint32, error) { - gpath, err := fs.RootPath(root, "/etc/group") - if err != nil { - return []uint32{}, err - } - groups, err := user.ParseGroupFileFilter(gpath, filter) - if err != nil { - return []uint32{}, err - } - if len(groups) == 0 { - // if there are no additional groups; just return an empty set - return []uint32{}, nil - } - addlGids := []uint32{} - for _, grp := range groups { - addlGids = append(addlGids, uint32(grp.Gid)) - } - return addlGids, nil -} - -func isRootfsAbs(root string) bool { - return filepath.IsAbs(root) -} - -// WithMaskedPaths sets the masked paths option -func WithMaskedPaths(paths []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - s.Linux.MaskedPaths = paths - return nil - } -} - -// WithReadonlyPaths sets the read only paths option -func WithReadonlyPaths(paths []string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - s.Linux.ReadonlyPaths = paths - return nil - } -} - -// WithWriteableSysfs makes any sysfs mounts writeable -func WithWriteableSysfs(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - for i, m := range s.Mounts { - if m.Type == "sysfs" { - var options []string - for _, o := range m.Options { - if o == "ro" { - o = "rw" - } - options = append(options, o) - } - s.Mounts[i].Options = options - } - } - return nil -} - -// WithWriteableCgroupfs makes any cgroup mounts writeable -func WithWriteableCgroupfs(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - for i, m := range s.Mounts { - if m.Type == "cgroup" { - var options []string - for _, o := range m.Options { - if o == "ro" { - o = "rw" - } - options = append(options, o) - } - s.Mounts[i].Options = options - } - } - return nil -} - -// WithSelinuxLabel sets the process SELinux label -func WithSelinuxLabel(label string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.SelinuxLabel = label - return nil - } -} - -// WithApparmorProfile sets the Apparmor profile for the process -func WithApparmorProfile(profile string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setProcess(s) - s.Process.ApparmorProfile = profile - return nil - } -} - -// WithSeccompUnconfined clears the seccomp profile -func WithSeccompUnconfined(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - s.Linux.Seccomp = nil - return nil -} - -// WithParentCgroupDevices uses the default cgroup setup to inherit the container's parent cgroup's -// allowed and denied devices -func WithParentCgroupDevices(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - if s.Linux.Resources == nil { - s.Linux.Resources = &specs.LinuxResources{} - } - s.Linux.Resources.Devices = nil - return nil -} - -// WithAllDevicesAllowed permits READ WRITE MKNOD on all devices nodes for the container -func WithAllDevicesAllowed(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - if s.Linux.Resources == nil { - s.Linux.Resources = &specs.LinuxResources{} - } - s.Linux.Resources.Devices = []specs.LinuxDeviceCgroup{ - { - Allow: true, - Access: rwm, - }, - } - return nil -} - -// WithDefaultUnixDevices adds the default devices for unix such as /dev/null, /dev/random to -// the container's resource cgroup spec -func WithDefaultUnixDevices(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - if s.Linux.Resources == nil { - s.Linux.Resources = &specs.LinuxResources{} - } - intptr := func(i int64) *int64 { - return &i - } - s.Linux.Resources.Devices = append(s.Linux.Resources.Devices, []specs.LinuxDeviceCgroup{ - { - // "/dev/null", - Type: "c", - Major: intptr(1), - Minor: intptr(3), - Access: rwm, - Allow: true, - }, - { - // "/dev/random", - Type: "c", - Major: intptr(1), - Minor: intptr(8), - Access: rwm, - Allow: true, - }, - { - // "/dev/full", - Type: "c", - Major: intptr(1), - Minor: intptr(7), - Access: rwm, - Allow: true, - }, - { - // "/dev/tty", - Type: "c", - Major: intptr(5), - Minor: intptr(0), - Access: rwm, - Allow: true, - }, - { - // "/dev/zero", - Type: "c", - Major: intptr(1), - Minor: intptr(5), - Access: rwm, - Allow: true, - }, - { - // "/dev/urandom", - Type: "c", - Major: intptr(1), - Minor: intptr(9), - Access: rwm, - Allow: true, - }, - { - // "/dev/console", - Type: "c", - Major: intptr(5), - Minor: intptr(1), - Access: rwm, - Allow: true, - }, - // /dev/pts/ - pts namespaces are "coming soon" - { - Type: "c", - Major: intptr(136), - Access: rwm, - Allow: true, - }, - { - Type: "c", - Major: intptr(5), - Minor: intptr(2), - Access: rwm, - Allow: true, - }, - { - // tuntap - Type: "c", - Major: intptr(10), - Minor: intptr(200), - Access: rwm, - Allow: true, - }, - }...) - return nil -} - -// WithPrivileged sets up options for a privileged container -var WithPrivileged = Compose( - WithAllCapabilities, - WithMaskedPaths(nil), - WithReadonlyPaths(nil), - WithWriteableSysfs, - WithWriteableCgroupfs, - WithSelinuxLabel(""), - WithApparmorProfile(""), - WithSeccompUnconfined, -) - -// WithWindowsHyperV sets the Windows.HyperV section for HyperV isolation of containers. -func WithWindowsHyperV(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Windows == nil { - s.Windows = &specs.Windows{} - } - if s.Windows.HyperV == nil { - s.Windows.HyperV = &specs.WindowsHyperV{} - } - return nil -} - -// WithMemoryLimit sets the `Linux.LinuxResources.Memory.Limit` section to the -// `limit` specified if the `Linux` section is not `nil`. Additionally sets the -// `Windows.WindowsResources.Memory.Limit` section if the `Windows` section is -// not `nil`. -func WithMemoryLimit(limit uint64) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Linux != nil { - if s.Linux.Resources == nil { - s.Linux.Resources = &specs.LinuxResources{} - } - if s.Linux.Resources.Memory == nil { - s.Linux.Resources.Memory = &specs.LinuxMemory{} - } - l := int64(limit) - s.Linux.Resources.Memory.Limit = &l - } - if s.Windows != nil { - if s.Windows.Resources == nil { - s.Windows.Resources = &specs.WindowsResources{} - } - if s.Windows.Resources.Memory == nil { - s.Windows.Resources.Memory = &specs.WindowsMemoryResources{} - } - s.Windows.Resources.Memory.Limit = &limit - } - return nil - } -} - -// WithAnnotations appends or replaces the annotations on the spec with the -// provided annotations -func WithAnnotations(annotations map[string]string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Annotations == nil { - s.Annotations = make(map[string]string) - } - for k, v := range annotations { - s.Annotations[k] = v - } - return nil - } -} - -// WithLinuxDevices adds the provided linux devices to the spec -func WithLinuxDevices(devices []specs.LinuxDevice) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - s.Linux.Devices = append(s.Linux.Devices, devices...) - return nil - } -} - -var ErrNotADevice = errors.New("not a device node") - -// WithLinuxDevice adds the device specified by path to the spec -func WithLinuxDevice(path, permissions string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - setResources(s) - - dev, err := deviceFromPath(path, permissions) - if err != nil { - return err - } - - s.Linux.Devices = append(s.Linux.Devices, *dev) - - s.Linux.Resources.Devices = append(s.Linux.Resources.Devices, specs.LinuxDeviceCgroup{ - Type: dev.Type, - Allow: true, - Major: &dev.Major, - Minor: &dev.Minor, - Access: permissions, - }) - - return nil - } -} - -// WithEnvFile adds environment variables from a file to the container's spec -func WithEnvFile(path string) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - var vars []string - f, err := os.Open(path) - if err != nil { - return err - } - defer f.Close() - - sc := bufio.NewScanner(f) - for sc.Scan() { - if sc.Err() != nil { - return sc.Err() - } - vars = append(vars, sc.Text()) - } - return WithEnv(vars)(nil, nil, nil, s) - } -} - -// ErrNoShmMount is returned when there is no /dev/shm mount specified in the config -// and an Opts was trying to set a configuration value on the mount. -var ErrNoShmMount = errors.New("no /dev/shm mount specified") - -// WithDevShmSize sets the size of the /dev/shm mount for the container. -// -// The size value is specified in kb, kilobytes. -func WithDevShmSize(kb int64) SpecOpts { - return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error { - for _, m := range s.Mounts { - if m.Source == "shm" && m.Type == "tmpfs" { - for i, o := range m.Options { - if strings.HasPrefix(o, "size=") { - m.Options[i] = fmt.Sprintf("size=%dk", kb) - return nil - } - } - m.Options = append(m.Options, fmt.Sprintf("size=%dk", kb)) - return nil - } - } - return ErrNoShmMount - } -} diff --git a/vendor/github.com/containerd/containerd/oci/spec_opts_linux.go b/vendor/github.com/containerd/containerd/oci/spec_opts_linux.go deleted file mode 100644 index 1448ee78f6..0000000000 --- a/vendor/github.com/containerd/containerd/oci/spec_opts_linux.go +++ /dev/null @@ -1,121 +0,0 @@ -// +build linux - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "context" - "io/ioutil" - "os" - "path/filepath" - - "github.com/containerd/containerd/containers" - specs "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/sys/unix" -) - -// WithHostDevices adds all the hosts device nodes to the container's spec -func WithHostDevices(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - - devs, err := getDevices("/dev") - if err != nil { - return err - } - s.Linux.Devices = append(s.Linux.Devices, devs...) - return nil -} - -func getDevices(path string) ([]specs.LinuxDevice, error) { - files, err := ioutil.ReadDir(path) - if err != nil { - return nil, err - } - var out []specs.LinuxDevice - for _, f := range files { - switch { - case f.IsDir(): - switch f.Name() { - // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 - // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 - case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": - continue - default: - sub, err := getDevices(filepath.Join(path, f.Name())) - if err != nil { - return nil, err - } - - out = append(out, sub...) - continue - } - case f.Name() == "console": - continue - } - device, err := deviceFromPath(filepath.Join(path, f.Name()), "rwm") - if err != nil { - if err == ErrNotADevice { - continue - } - if os.IsNotExist(err) { - continue - } - return nil, err - } - out = append(out, *device) - } - return out, nil -} - -func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) { - var stat unix.Stat_t - if err := unix.Lstat(path, &stat); err != nil { - return nil, err - } - - var ( - // The type is 32bit on mips. - devNumber = uint64(stat.Rdev) // nolint: unconvert - major = unix.Major(devNumber) - minor = unix.Minor(devNumber) - ) - if major == 0 { - return nil, ErrNotADevice - } - - var ( - devType string - mode = stat.Mode - ) - switch { - case mode&unix.S_IFBLK == unix.S_IFBLK: - devType = "b" - case mode&unix.S_IFCHR == unix.S_IFCHR: - devType = "c" - } - fm := os.FileMode(mode) - return &specs.LinuxDevice{ - Type: devType, - Path: path, - Major: int64(major), - Minor: int64(minor), - FileMode: &fm, - UID: &stat.Uid, - GID: &stat.Gid, - }, nil -} diff --git a/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go b/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go deleted file mode 100644 index bcabf0efb5..0000000000 --- a/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go +++ /dev/null @@ -1,120 +0,0 @@ -// +build !linux,!windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "context" - "io/ioutil" - "os" - "path/filepath" - - "github.com/containerd/containerd/containers" - specs "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/sys/unix" -) - -// WithHostDevices adds all the hosts device nodes to the container's spec -func WithHostDevices(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - setLinux(s) - - devs, err := getDevices("/dev") - if err != nil { - return err - } - s.Linux.Devices = append(s.Linux.Devices, devs...) - return nil -} - -func getDevices(path string) ([]specs.LinuxDevice, error) { - files, err := ioutil.ReadDir(path) - if err != nil { - return nil, err - } - var out []specs.LinuxDevice - for _, f := range files { - switch { - case f.IsDir(): - switch f.Name() { - // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 - // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 - case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": - continue - default: - sub, err := getDevices(filepath.Join(path, f.Name())) - if err != nil { - return nil, err - } - - out = append(out, sub...) - continue - } - case f.Name() == "console": - continue - } - device, err := deviceFromPath(filepath.Join(path, f.Name()), "rwm") - if err != nil { - if err == ErrNotADevice { - continue - } - if os.IsNotExist(err) { - continue - } - return nil, err - } - out = append(out, *device) - } - return out, nil -} - -func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) { - var stat unix.Stat_t - if err := unix.Lstat(path, &stat); err != nil { - return nil, err - } - - var ( - devNumber = uint64(stat.Rdev) - major = unix.Major(devNumber) - minor = unix.Minor(devNumber) - ) - if major == 0 { - return nil, ErrNotADevice - } - - var ( - devType string - mode = stat.Mode - ) - switch { - case mode&unix.S_IFBLK == unix.S_IFBLK: - devType = "b" - case mode&unix.S_IFCHR == unix.S_IFCHR: - devType = "c" - } - fm := os.FileMode(mode) - return &specs.LinuxDevice{ - Type: devType, - Path: path, - Major: int64(major), - Minor: int64(minor), - FileMode: &fm, - UID: &stat.Uid, - GID: &stat.Gid, - }, nil -} diff --git a/vendor/github.com/containerd/containerd/oci/spec_opts_windows.go b/vendor/github.com/containerd/containerd/oci/spec_opts_windows.go deleted file mode 100644 index 47caf1925b..0000000000 --- a/vendor/github.com/containerd/containerd/oci/spec_opts_windows.go +++ /dev/null @@ -1,79 +0,0 @@ -// +build windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package oci - -import ( - "context" - - "github.com/containerd/containerd/containers" - specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" -) - -// WithWindowsCPUCount sets the `Windows.Resources.CPU.Count` section to the -// `count` specified. -func WithWindowsCPUCount(count uint64) SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Windows.Resources == nil { - s.Windows.Resources = &specs.WindowsResources{} - } - if s.Windows.Resources.CPU == nil { - s.Windows.Resources.CPU = &specs.WindowsCPUResources{} - } - s.Windows.Resources.CPU.Count = &count - return nil - } -} - -// WithWindowsIgnoreFlushesDuringBoot sets `Windows.IgnoreFlushesDuringBoot`. -func WithWindowsIgnoreFlushesDuringBoot() SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Windows == nil { - s.Windows = &specs.Windows{} - } - s.Windows.IgnoreFlushesDuringBoot = true - return nil - } -} - -// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.IgnoreFlushesDuringBoot`. -func WithWindowNetworksAllowUnqualifiedDNSQuery() SpecOpts { - return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - if s.Windows == nil { - s.Windows = &specs.Windows{} - } - if s.Windows.Network == nil { - s.Windows.Network = &specs.WindowsNetwork{} - } - - s.Windows.Network.AllowUnqualifiedDNSQuery = true - return nil - } -} - -// WithHostDevices adds all the hosts device nodes to the container's spec -// -// Not supported on windows -func WithHostDevices(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { - return nil -} - -func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) { - return nil, errors.New("device from path not supported on Windows") -} diff --git a/vendor/github.com/containerd/containerd/snapshots/snapshotter.go b/vendor/github.com/containerd/containerd/snapshots/snapshotter.go deleted file mode 100644 index 514538f7ec..0000000000 --- a/vendor/github.com/containerd/containerd/snapshots/snapshotter.go +++ /dev/null @@ -1,339 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package snapshots - -import ( - "context" - "encoding/json" - "strings" - "time" - - "github.com/containerd/containerd/mount" -) - -// Kind identifies the kind of snapshot. -type Kind uint8 - -// definitions of snapshot kinds -const ( - KindUnknown Kind = iota - KindView - KindActive - KindCommitted -) - -// ParseKind parses the provided string into a Kind -// -// If the string cannot be parsed KindUnknown is returned -func ParseKind(s string) Kind { - s = strings.ToLower(s) - switch s { - case "view": - return KindView - case "active": - return KindActive - case "committed": - return KindCommitted - } - - return KindUnknown -} - -// String returns the string representation of the Kind -func (k Kind) String() string { - switch k { - case KindView: - return "View" - case KindActive: - return "Active" - case KindCommitted: - return "Committed" - } - - return "Unknown" -} - -// MarshalJSON the Kind to JSON -func (k Kind) MarshalJSON() ([]byte, error) { - return json.Marshal(k.String()) -} - -// UnmarshalJSON the Kind from JSON -func (k *Kind) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - - *k = ParseKind(s) - return nil -} - -// Info provides information about a particular snapshot. -// JSON marshallability is supported for interactive with tools like ctr, -type Info struct { - Kind Kind // active or committed snapshot - Name string // name or key of snapshot - Parent string `json:",omitempty"` // name of parent snapshot - - // Labels for a snapshot. - // - // Note: only labels prefixed with `containerd.io/snapshot/` will be inherited by the - // snapshotter's `Prepare`, `View`, or `Commit` calls. - Labels map[string]string `json:",omitempty"` - Created time.Time `json:",omitempty"` // Created time - Updated time.Time `json:",omitempty"` // Last update time -} - -// Usage defines statistics for disk resources consumed by the snapshot. -// -// These resources only include the resources consumed by the snapshot itself -// and does not include resources usage by the parent. -type Usage struct { - Inodes int64 // number of inodes in use. - Size int64 // provides usage, in bytes, of snapshot -} - -// Add the provided usage to the current usage -func (u *Usage) Add(other Usage) { - u.Size += other.Size - - // TODO(stevvooe): assumes independent inodes, but provides and upper - // bound. This should be pretty close, assuming the inodes for a - // snapshot are roughly unique to it. Don't trust this assumption. - u.Inodes += other.Inodes -} - -// Snapshotter defines the methods required to implement a snapshot snapshotter for -// allocating, snapshotting and mounting filesystem changesets. The model works -// by building up sets of changes with parent-child relationships. -// -// A snapshot represents a filesystem state. Every snapshot has a parent, where -// the empty parent is represented by the empty string. A diff can be taken -// between a parent and its snapshot to generate a classic layer. -// -// An active snapshot is created by calling `Prepare`. After mounting, changes -// can be made to the snapshot. The act of committing creates a committed -// snapshot. The committed snapshot will get the parent of active snapshot. The -// committed snapshot can then be used as a parent. Active snapshots can never -// act as a parent. -// -// Snapshots are best understood by their lifecycle. Active snapshots are -// always created with Prepare or View. Committed snapshots are always created -// with Commit. Active snapshots never become committed snapshots and vice -// versa. All snapshots may be removed. -// -// For consistency, we define the following terms to be used throughout this -// interface for snapshotter implementations: -// -// `ctx` - refers to a context.Context -// `key` - refers to an active snapshot -// `name` - refers to a committed snapshot -// `parent` - refers to the parent in relation -// -// Most methods take various combinations of these identifiers. Typically, -// `name` and `parent` will be used in cases where a method *only* takes -// committed snapshots. `key` will be used to refer to active snapshots in most -// cases, except where noted. All variables used to access snapshots use the -// same key space. For example, an active snapshot may not share the same key -// with a committed snapshot. -// -// We cover several examples below to demonstrate the utility of a snapshot -// snapshotter. -// -// Importing a Layer -// -// To import a layer, we simply have the Snapshotter provide a list of -// mounts to be applied such that our dst will capture a changeset. We start -// out by getting a path to the layer tar file and creating a temp location to -// unpack it to: -// -// layerPath, tmpDir := getLayerPath(), mkTmpDir() // just a path to layer tar file. -// -// We start by using a Snapshotter to Prepare a new snapshot transaction, using a -// key and descending from the empty parent "". To prevent our layer from being -// garbage collected during unpacking, we add the `containerd.io/gc.root` label: -// -// noGcOpt := snapshots.WithLabels(map[string]string{ -// "containerd.io/gc.root": time.Now().UTC().Format(time.RFC3339), -// }) -// mounts, err := snapshotter.Prepare(ctx, key, "", noGcOpt) -// if err != nil { ... } -// -// We get back a list of mounts from Snapshotter.Prepare, with the key identifying -// the active snapshot. Mount this to the temporary location with the -// following: -// -// if err := mount.All(mounts, tmpDir); err != nil { ... } -// -// Once the mounts are performed, our temporary location is ready to capture -// a diff. In practice, this works similar to a filesystem transaction. The -// next step is to unpack the layer. We have a special function unpackLayer -// that applies the contents of the layer to target location and calculates the -// DiffID of the unpacked layer (this is a requirement for docker -// implementation): -// -// layer, err := os.Open(layerPath) -// if err != nil { ... } -// digest, err := unpackLayer(tmpLocation, layer) // unpack into layer location -// if err != nil { ... } -// -// When the above completes, we should have a filesystem the represents the -// contents of the layer. Careful implementations should verify that digest -// matches the expected DiffID. When completed, we unmount the mounts: -// -// unmount(mounts) // optional, for now -// -// Now that we've verified and unpacked our layer, we commit the active -// snapshot to a name. For this example, we are just going to use the layer -// digest, but in practice, this will probably be the ChainID. This also removes -// the active snapshot: -// -// if err := snapshotter.Commit(ctx, digest.String(), key, noGcOpt); err != nil { ... } -// -// Now, we have a layer in the Snapshotter that can be accessed with the digest -// provided during commit. -// -// Importing the Next Layer -// -// Making a layer depend on the above is identical to the process described -// above except that the parent is provided as parent when calling -// Manager.Prepare, assuming a clean, unique key identifier: -// -// mounts, err := snapshotter.Prepare(ctx, key, parentDigest, noGcOpt) -// -// We then mount, apply and commit, as we did above. The new snapshot will be -// based on the content of the previous one. -// -// Running a Container -// -// To run a container, we simply provide Snapshotter.Prepare the committed image -// snapshot as the parent. After mounting, the prepared path can -// be used directly as the container's filesystem: -// -// mounts, err := snapshotter.Prepare(ctx, containerKey, imageRootFSChainID) -// -// The returned mounts can then be passed directly to the container runtime. If -// one would like to create a new image from the filesystem, Manager.Commit is -// called: -// -// if err := snapshotter.Commit(ctx, newImageSnapshot, containerKey); err != nil { ... } -// -// Alternatively, for most container runs, Snapshotter.Remove will be called to -// signal the Snapshotter to abandon the changes. -type Snapshotter interface { - // Stat returns the info for an active or committed snapshot by name or - // key. - // - // Should be used for parent resolution, existence checks and to discern - // the kind of snapshot. - Stat(ctx context.Context, key string) (Info, error) - - // Update updates the info for a snapshot. - // - // Only mutable properties of a snapshot may be updated. - Update(ctx context.Context, info Info, fieldpaths ...string) (Info, error) - - // Usage returns the resource usage of an active or committed snapshot - // excluding the usage of parent snapshots. - // - // The running time of this call for active snapshots is dependent on - // implementation, but may be proportional to the size of the resource. - // Callers should take this into consideration. Implementations should - // attempt to honer context cancellation and avoid taking locks when making - // the calculation. - Usage(ctx context.Context, key string) (Usage, error) - - // Mounts returns the mounts for the active snapshot transaction identified - // by key. Can be called on an read-write or readonly transaction. This is - // available only for active snapshots. - // - // This can be used to recover mounts after calling View or Prepare. - Mounts(ctx context.Context, key string) ([]mount.Mount, error) - - // Prepare creates an active snapshot identified by key descending from the - // provided parent. The returned mounts can be used to mount the snapshot - // to capture changes. - // - // If a parent is provided, after performing the mounts, the destination - // will start with the content of the parent. The parent must be a - // committed snapshot. Changes to the mounted destination will be captured - // in relation to the parent. The default parent, "", is an empty - // directory. - // - // The changes may be saved to a committed snapshot by calling Commit. When - // one is done with the transaction, Remove should be called on the key. - // - // Multiple calls to Prepare or View with the same key should fail. - Prepare(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) - - // View behaves identically to Prepare except the result may not be - // committed back to the snapshot snapshotter. View returns a readonly view on - // the parent, with the active snapshot being tracked by the given key. - // - // This method operates identically to Prepare, except that Mounts returned - // may have the readonly flag set. Any modifications to the underlying - // filesystem will be ignored. Implementations may perform this in a more - // efficient manner that differs from what would be attempted with - // `Prepare`. - // - // Commit may not be called on the provided key and will return an error. - // To collect the resources associated with key, Remove must be called with - // key as the argument. - View(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) - - // Commit captures the changes between key and its parent into a snapshot - // identified by name. The name can then be used with the snapshotter's other - // methods to create subsequent snapshots. - // - // A committed snapshot will be created under name with the parent of the - // active snapshot. - // - // After commit, the snapshot identified by key is removed. - Commit(ctx context.Context, name, key string, opts ...Opt) error - - // Remove the committed or active snapshot by the provided key. - // - // All resources associated with the key will be removed. - // - // If the snapshot is a parent of another snapshot, its children must be - // removed before proceeding. - Remove(ctx context.Context, key string) error - - // Walk all snapshots in the snapshotter. For each snapshot in the - // snapshotter, the function will be called. - Walk(ctx context.Context, fn func(context.Context, Info) error) error - - // Close releases the internal resources. - // - // Close is expected to be called on the end of the lifecycle of the snapshotter, - // but not mandatory. - // - // Close returns nil when it is already closed. - Close() error -} - -// Opt allows setting mutable snapshot properties on creation -type Opt func(info *Info) error - -// WithLabels adds labels to a created snapshot -func WithLabels(labels map[string]string) Opt { - return func(info *Info) error { - info.Labels = labels - return nil - } -} diff --git a/vendor/github.com/containerd/ttrpc/LICENSE b/vendor/github.com/containerd/ttrpc/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/containerd/ttrpc/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/containerd/ttrpc/README.md b/vendor/github.com/containerd/ttrpc/README.md deleted file mode 100644 index c345c844e6..0000000000 --- a/vendor/github.com/containerd/ttrpc/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# ttrpc - -[![Build Status](https://travis-ci.org/containerd/ttrpc.svg?branch=master)](https://travis-ci.org/containerd/ttrpc) - -GRPC for low-memory environments. - -The existing grpc-go project requires a lot of memory overhead for importing -packages and at runtime. While this is great for many services with low density -requirements, this can be a problem when running a large number of services on -a single machine or on a machine with a small amount of memory. - -Using the same GRPC definitions, this project reduces the binary size and -protocol overhead required. We do this by eliding the `net/http`, `net/http2` -and `grpc` package used by grpc replacing it with a lightweight framing -protocol. The result are smaller binaries that use less resident memory with -the same ease of use as GRPC. - -Please note that while this project supports generating either end of the -protocol, the generated service definitions will be incompatible with regular -GRPC services, as they do not speak the same protocol. - -# Usage - -Create a gogo vanity binary (see -[`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an -example with the ttrpc plugin enabled. - -It's recommended to use [`protobuild`](https://github.com//stevvooe/protobuild) -to build the protobufs for this project, but this will work with protoc -directly, if required. - -# Differences from GRPC - -- The protocol stack has been replaced with a lighter protocol that doesn't - require http, http2 and tls. -- The client and server interface are identical whereas in GRPC there is a - client and server interface that are different. -- The Go stdlib context package is used instead. -- No support for streams yet. - -# Status - -Very new. YMMV. - -TODO: - -- [X] Plumb error codes and GRPC status -- [X] Remove use of any type and dependency on typeurl package -- [X] Ensure that protocol can support streaming in the future -- [ ] Document protocol layout -- [ ] Add testing under concurrent load to ensure -- [ ] Verify connection error handling - -# Project details - -ttrpc is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). -As a containerd sub-project, you will find the: - * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md), - * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md) - -information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/vendor/github.com/containerd/ttrpc/channel.go b/vendor/github.com/containerd/ttrpc/channel.go deleted file mode 100644 index aa8c9541cf..0000000000 --- a/vendor/github.com/containerd/ttrpc/channel.go +++ /dev/null @@ -1,153 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "bufio" - "encoding/binary" - "io" - "net" - "sync" - - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -const ( - messageHeaderLength = 10 - messageLengthMax = 4 << 20 -) - -type messageType uint8 - -const ( - messageTypeRequest messageType = 0x1 - messageTypeResponse messageType = 0x2 -) - -// messageHeader represents the fixed-length message header of 10 bytes sent -// with every request. -type messageHeader struct { - Length uint32 // length excluding this header. b[:4] - StreamID uint32 // identifies which request stream message is a part of. b[4:8] - Type messageType // message type b[8] - Flags uint8 // reserved b[9] -} - -func readMessageHeader(p []byte, r io.Reader) (messageHeader, error) { - _, err := io.ReadFull(r, p[:messageHeaderLength]) - if err != nil { - return messageHeader{}, err - } - - return messageHeader{ - Length: binary.BigEndian.Uint32(p[:4]), - StreamID: binary.BigEndian.Uint32(p[4:8]), - Type: messageType(p[8]), - Flags: p[9], - }, nil -} - -func writeMessageHeader(w io.Writer, p []byte, mh messageHeader) error { - binary.BigEndian.PutUint32(p[:4], mh.Length) - binary.BigEndian.PutUint32(p[4:8], mh.StreamID) - p[8] = byte(mh.Type) - p[9] = mh.Flags - - _, err := w.Write(p[:]) - return err -} - -var buffers sync.Pool - -type channel struct { - conn net.Conn - bw *bufio.Writer - br *bufio.Reader - hrbuf [messageHeaderLength]byte // avoid alloc when reading header - hwbuf [messageHeaderLength]byte -} - -func newChannel(conn net.Conn) *channel { - return &channel{ - conn: conn, - bw: bufio.NewWriter(conn), - br: bufio.NewReader(conn), - } -} - -// recv a message from the channel. The returned buffer contains the message. -// -// If a valid grpc status is returned, the message header -// returned will be valid and caller should send that along to -// the correct consumer. The bytes on the underlying channel -// will be discarded. -func (ch *channel) recv() (messageHeader, []byte, error) { - mh, err := readMessageHeader(ch.hrbuf[:], ch.br) - if err != nil { - return messageHeader{}, nil, err - } - - if mh.Length > uint32(messageLengthMax) { - if _, err := ch.br.Discard(int(mh.Length)); err != nil { - return mh, nil, errors.Wrapf(err, "failed to discard after receiving oversized message") - } - - return mh, nil, status.Errorf(codes.ResourceExhausted, "message length %v exceed maximum message size of %v", mh.Length, messageLengthMax) - } - - p := ch.getmbuf(int(mh.Length)) - if _, err := io.ReadFull(ch.br, p); err != nil { - return messageHeader{}, nil, errors.Wrapf(err, "failed reading message") - } - - return mh, p, nil -} - -func (ch *channel) send(streamID uint32, t messageType, p []byte) error { - if err := writeMessageHeader(ch.bw, ch.hwbuf[:], messageHeader{Length: uint32(len(p)), StreamID: streamID, Type: t}); err != nil { - return err - } - - _, err := ch.bw.Write(p) - if err != nil { - return err - } - - return ch.bw.Flush() -} - -func (ch *channel) getmbuf(size int) []byte { - // we can't use the standard New method on pool because we want to allocate - // based on size. - b, ok := buffers.Get().(*[]byte) - if !ok || cap(*b) < size { - // TODO(stevvooe): It may be better to allocate these in fixed length - // buckets to reduce fragmentation but its not clear that would help - // with performance. An ilogb approach or similar would work well. - bb := make([]byte, size) - b = &bb - } else { - *b = (*b)[:size] - } - return *b -} - -func (ch *channel) putmbuf(p []byte) { - buffers.Put(&p) -} diff --git a/vendor/github.com/containerd/ttrpc/client.go b/vendor/github.com/containerd/ttrpc/client.go deleted file mode 100644 index bdd1d12e7a..0000000000 --- a/vendor/github.com/containerd/ttrpc/client.go +++ /dev/null @@ -1,350 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "io" - "net" - "os" - "strings" - "sync" - "syscall" - "time" - - "github.com/gogo/protobuf/proto" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// ErrClosed is returned by client methods when the underlying connection is -// closed. -var ErrClosed = errors.New("ttrpc: closed") - -// Client for a ttrpc server -type Client struct { - codec codec - conn net.Conn - channel *channel - calls chan *callRequest - - ctx context.Context - closed func() - - closeOnce sync.Once - userCloseFunc func() - - errOnce sync.Once - err error - interceptor UnaryClientInterceptor -} - -// ClientOpts configures a client -type ClientOpts func(c *Client) - -// WithOnClose sets the close func whenever the client's Close() method is called -func WithOnClose(onClose func()) ClientOpts { - return func(c *Client) { - c.userCloseFunc = onClose - } -} - -// WithUnaryClientInterceptor sets the provided client interceptor -func WithUnaryClientInterceptor(i UnaryClientInterceptor) ClientOpts { - return func(c *Client) { - c.interceptor = i - } -} - -func NewClient(conn net.Conn, opts ...ClientOpts) *Client { - ctx, cancel := context.WithCancel(context.Background()) - c := &Client{ - codec: codec{}, - conn: conn, - channel: newChannel(conn), - calls: make(chan *callRequest), - closed: cancel, - ctx: ctx, - userCloseFunc: func() {}, - interceptor: defaultClientInterceptor, - } - - for _, o := range opts { - o(c) - } - - go c.run() - return c -} - -type callRequest struct { - ctx context.Context - req *Request - resp *Response // response will be written back here - errs chan error // error written here on completion -} - -func (c *Client) Call(ctx context.Context, service, method string, req, resp interface{}) error { - payload, err := c.codec.Marshal(req) - if err != nil { - return err - } - - var ( - creq = &Request{ - Service: service, - Method: method, - Payload: payload, - } - - cresp = &Response{} - ) - - if metadata, ok := GetMetadata(ctx); ok { - metadata.setRequest(creq) - } - - if dl, ok := ctx.Deadline(); ok { - creq.TimeoutNano = dl.Sub(time.Now()).Nanoseconds() - } - - info := &UnaryClientInfo{ - FullMethod: fullPath(service, method), - } - if err := c.interceptor(ctx, creq, cresp, info, c.dispatch); err != nil { - return err - } - - if err := c.codec.Unmarshal(cresp.Payload, resp); err != nil { - return err - } - - if cresp.Status != nil && cresp.Status.Code != int32(codes.OK) { - return status.ErrorProto(cresp.Status) - } - return nil -} - -func (c *Client) dispatch(ctx context.Context, req *Request, resp *Response) error { - errs := make(chan error, 1) - call := &callRequest{ - ctx: ctx, - req: req, - resp: resp, - errs: errs, - } - - select { - case <-ctx.Done(): - return ctx.Err() - case c.calls <- call: - case <-c.ctx.Done(): - return c.error() - } - - select { - case <-ctx.Done(): - return ctx.Err() - case err := <-errs: - return filterCloseErr(err) - case <-c.ctx.Done(): - return c.error() - } -} - -func (c *Client) Close() error { - c.closeOnce.Do(func() { - c.closed() - }) - return nil -} - -type message struct { - messageHeader - p []byte - err error -} - -type receiver struct { - wg *sync.WaitGroup - messages chan *message - err error -} - -func (r *receiver) run(ctx context.Context, c *channel) { - defer r.wg.Done() - - for { - select { - case <-ctx.Done(): - r.err = ctx.Err() - return - default: - mh, p, err := c.recv() - if err != nil { - _, ok := status.FromError(err) - if !ok { - // treat all errors that are not an rpc status as terminal. - // all others poison the connection. - r.err = filterCloseErr(err) - return - } - } - select { - case r.messages <- &message{ - messageHeader: mh, - p: p[:mh.Length], - err: err, - }: - case <-ctx.Done(): - r.err = ctx.Err() - return - } - } - } -} - -func (c *Client) run() { - var ( - streamID uint32 = 1 - waiters = make(map[uint32]*callRequest) - calls = c.calls - incoming = make(chan *message) - receiversDone = make(chan struct{}) - wg sync.WaitGroup - ) - - // broadcast the shutdown error to the remaining waiters. - abortWaiters := func(wErr error) { - for _, waiter := range waiters { - waiter.errs <- wErr - } - } - recv := &receiver{ - wg: &wg, - messages: incoming, - } - wg.Add(1) - - go func() { - wg.Wait() - close(receiversDone) - }() - go recv.run(c.ctx, c.channel) - - defer func() { - c.conn.Close() - c.userCloseFunc() - }() - - for { - select { - case call := <-calls: - if err := c.send(streamID, messageTypeRequest, call.req); err != nil { - call.errs <- err - continue - } - - waiters[streamID] = call - streamID += 2 // enforce odd client initiated request ids - case msg := <-incoming: - call, ok := waiters[msg.StreamID] - if !ok { - logrus.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID) - continue - } - - call.errs <- c.recv(call.resp, msg) - delete(waiters, msg.StreamID) - case <-receiversDone: - // all the receivers have exited - if recv.err != nil { - c.setError(recv.err) - } - // don't return out, let the close of the context trigger the abort of waiters - c.Close() - case <-c.ctx.Done(): - abortWaiters(c.error()) - return - } - } -} - -func (c *Client) error() error { - c.errOnce.Do(func() { - if c.err == nil { - c.err = ErrClosed - } - }) - return c.err -} - -func (c *Client) setError(err error) { - c.errOnce.Do(func() { - c.err = err - }) -} - -func (c *Client) send(streamID uint32, mtype messageType, msg interface{}) error { - p, err := c.codec.Marshal(msg) - if err != nil { - return err - } - - return c.channel.send(streamID, mtype, p) -} - -func (c *Client) recv(resp *Response, msg *message) error { - if msg.err != nil { - return msg.err - } - - if msg.Type != messageTypeResponse { - return errors.New("unknown message type received") - } - - defer c.channel.putmbuf(msg.p) - return proto.Unmarshal(msg.p, resp) -} - -// filterCloseErr rewrites EOF and EPIPE errors to ErrClosed. Use when -// returning from call or handling errors from main read loop. -// -// This purposely ignores errors with a wrapped cause. -func filterCloseErr(err error) error { - switch { - case err == nil: - return nil - case err == io.EOF: - return ErrClosed - case errors.Cause(err) == io.EOF: - return ErrClosed - case strings.Contains(err.Error(), "use of closed network connection"): - return ErrClosed - default: - // if we have an epipe on a write, we cast to errclosed - if oerr, ok := err.(*net.OpError); ok && oerr.Op == "write" { - if serr, ok := oerr.Err.(*os.SyscallError); ok && serr.Err == syscall.EPIPE { - return ErrClosed - } - } - } - - return err -} diff --git a/vendor/github.com/containerd/ttrpc/codec.go b/vendor/github.com/containerd/ttrpc/codec.go deleted file mode 100644 index b4aac2fac0..0000000000 --- a/vendor/github.com/containerd/ttrpc/codec.go +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "github.com/gogo/protobuf/proto" - "github.com/pkg/errors" -) - -type codec struct{} - -func (c codec) Marshal(msg interface{}) ([]byte, error) { - switch v := msg.(type) { - case proto.Message: - return proto.Marshal(v) - default: - return nil, errors.Errorf("ttrpc: cannot marshal unknown type: %T", msg) - } -} - -func (c codec) Unmarshal(p []byte, msg interface{}) error { - switch v := msg.(type) { - case proto.Message: - return proto.Unmarshal(p, v) - default: - return errors.Errorf("ttrpc: cannot unmarshal into unknown type: %T", msg) - } -} diff --git a/vendor/github.com/containerd/ttrpc/config.go b/vendor/github.com/containerd/ttrpc/config.go deleted file mode 100644 index 6a53c112b7..0000000000 --- a/vendor/github.com/containerd/ttrpc/config.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import "github.com/pkg/errors" - -type serverConfig struct { - handshaker Handshaker - interceptor UnaryServerInterceptor -} - -// ServerOpt for configuring a ttrpc server -type ServerOpt func(*serverConfig) error - -// WithServerHandshaker can be passed to NewServer to ensure that the -// handshaker is called before every connection attempt. -// -// Only one handshaker is allowed per server. -func WithServerHandshaker(handshaker Handshaker) ServerOpt { - return func(c *serverConfig) error { - if c.handshaker != nil { - return errors.New("only one handshaker allowed per server") - } - c.handshaker = handshaker - return nil - } -} - -// WithUnaryServerInterceptor sets the provided interceptor on the server -func WithUnaryServerInterceptor(i UnaryServerInterceptor) ServerOpt { - return func(c *serverConfig) error { - if c.interceptor != nil { - return errors.New("only one interceptor allowed per server") - } - c.interceptor = i - return nil - } -} diff --git a/vendor/github.com/containerd/ttrpc/handshake.go b/vendor/github.com/containerd/ttrpc/handshake.go deleted file mode 100644 index a424b67a49..0000000000 --- a/vendor/github.com/containerd/ttrpc/handshake.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "net" -) - -// Handshaker defines the interface for connection handshakes performed on the -// server or client when first connecting. -type Handshaker interface { - // Handshake should confirm or decorate a connection that may be incoming - // to a server or outgoing from a client. - // - // If this returns without an error, the caller should use the connection - // in place of the original connection. - // - // The second return value can contain credential specific data, such as - // unix socket credentials or TLS information. - // - // While we currently only have implementations on the server-side, this - // interface should be sufficient to implement similar handshakes on the - // client-side. - Handshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) -} - -type handshakerFunc func(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) - -func (fn handshakerFunc) Handshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) { - return fn(ctx, conn) -} - -func noopHandshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) { - return conn, nil, nil -} diff --git a/vendor/github.com/containerd/ttrpc/interceptor.go b/vendor/github.com/containerd/ttrpc/interceptor.go deleted file mode 100644 index c1219dac65..0000000000 --- a/vendor/github.com/containerd/ttrpc/interceptor.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import "context" - -// UnaryServerInfo provides information about the server request -type UnaryServerInfo struct { - FullMethod string -} - -// UnaryClientInfo provides information about the client request -type UnaryClientInfo struct { - FullMethod string -} - -// Unmarshaler contains the server request data and allows it to be unmarshaled -// into a concrete type -type Unmarshaler func(interface{}) error - -// Invoker invokes the client's request and response from the ttrpc server -type Invoker func(context.Context, *Request, *Response) error - -// UnaryServerInterceptor specifies the interceptor function for server request/response -type UnaryServerInterceptor func(context.Context, Unmarshaler, *UnaryServerInfo, Method) (interface{}, error) - -// UnaryClientInterceptor specifies the interceptor function for client request/response -type UnaryClientInterceptor func(context.Context, *Request, *Response, *UnaryClientInfo, Invoker) error - -func defaultServerInterceptor(ctx context.Context, unmarshal Unmarshaler, info *UnaryServerInfo, method Method) (interface{}, error) { - return method(ctx, unmarshal) -} - -func defaultClientInterceptor(ctx context.Context, req *Request, resp *Response, _ *UnaryClientInfo, invoker Invoker) error { - return invoker(ctx, req, resp) -} diff --git a/vendor/github.com/containerd/ttrpc/metadata.go b/vendor/github.com/containerd/ttrpc/metadata.go deleted file mode 100644 index ce8c0d13c4..0000000000 --- a/vendor/github.com/containerd/ttrpc/metadata.go +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "strings" -) - -// MD is the user type for ttrpc metadata -type MD map[string][]string - -// Get returns the metadata for a given key when they exist. -// If there is no metadata, a nil slice and false are returned. -func (m MD) Get(key string) ([]string, bool) { - key = strings.ToLower(key) - list, ok := m[key] - if !ok || len(list) == 0 { - return nil, false - } - - return list, true -} - -// Set sets the provided values for a given key. -// The values will overwrite any existing values. -// If no values provided, a key will be deleted. -func (m MD) Set(key string, values ...string) { - key = strings.ToLower(key) - if len(values) == 0 { - delete(m, key) - return - } - m[key] = values -} - -// Append appends additional values to the given key. -func (m MD) Append(key string, values ...string) { - key = strings.ToLower(key) - if len(values) == 0 { - return - } - current, ok := m[key] - if ok { - m.Set(key, append(current, values...)...) - } else { - m.Set(key, values...) - } -} - -func (m MD) setRequest(r *Request) { - for k, values := range m { - for _, v := range values { - r.Metadata = append(r.Metadata, &KeyValue{ - Key: k, - Value: v, - }) - } - } -} - -func (m MD) fromRequest(r *Request) { - for _, kv := range r.Metadata { - m[kv.Key] = append(m[kv.Key], kv.Value) - } -} - -type metadataKey struct{} - -// GetMetadata retrieves metadata from context.Context (previously attached with WithMetadata) -func GetMetadata(ctx context.Context) (MD, bool) { - metadata, ok := ctx.Value(metadataKey{}).(MD) - return metadata, ok -} - -// GetMetadataValue gets a specific metadata value by name from context.Context -func GetMetadataValue(ctx context.Context, name string) (string, bool) { - metadata, ok := GetMetadata(ctx) - if !ok { - return "", false - } - - if list, ok := metadata.Get(name); ok { - return list[0], true - } - - return "", false -} - -// WithMetadata attaches metadata map to a context.Context -func WithMetadata(ctx context.Context, md MD) context.Context { - return context.WithValue(ctx, metadataKey{}, md) -} diff --git a/vendor/github.com/containerd/ttrpc/server.go b/vendor/github.com/containerd/ttrpc/server.go deleted file mode 100644 index 1d4f1df653..0000000000 --- a/vendor/github.com/containerd/ttrpc/server.go +++ /dev/null @@ -1,485 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "io" - "math/rand" - "net" - "sync" - "sync/atomic" - "time" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -var ( - ErrServerClosed = errors.New("ttrpc: server closed") -) - -type Server struct { - config *serverConfig - services *serviceSet - codec codec - - mu sync.Mutex - listeners map[net.Listener]struct{} - connections map[*serverConn]struct{} // all connections to current state - done chan struct{} // marks point at which we stop serving requests -} - -func NewServer(opts ...ServerOpt) (*Server, error) { - config := &serverConfig{} - for _, opt := range opts { - if err := opt(config); err != nil { - return nil, err - } - } - if config.interceptor == nil { - config.interceptor = defaultServerInterceptor - } - - return &Server{ - config: config, - services: newServiceSet(config.interceptor), - done: make(chan struct{}), - listeners: make(map[net.Listener]struct{}), - connections: make(map[*serverConn]struct{}), - }, nil -} - -func (s *Server) Register(name string, methods map[string]Method) { - s.services.register(name, methods) -} - -func (s *Server) Serve(ctx context.Context, l net.Listener) error { - s.addListener(l) - defer s.closeListener(l) - - var ( - backoff time.Duration - handshaker = s.config.handshaker - ) - - if handshaker == nil { - handshaker = handshakerFunc(noopHandshake) - } - - for { - conn, err := l.Accept() - if err != nil { - select { - case <-s.done: - return ErrServerClosed - default: - } - - if terr, ok := err.(interface { - Temporary() bool - }); ok && terr.Temporary() { - if backoff == 0 { - backoff = time.Millisecond - } else { - backoff *= 2 - } - - if max := time.Second; backoff > max { - backoff = max - } - - sleep := time.Duration(rand.Int63n(int64(backoff))) - logrus.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep) - time.Sleep(sleep) - continue - } - - return err - } - - backoff = 0 - - approved, handshake, err := handshaker.Handshake(ctx, conn) - if err != nil { - logrus.WithError(err).Errorf("ttrpc: refusing connection after handshake") - conn.Close() - continue - } - - sc := s.newConn(approved, handshake) - go sc.run(ctx) - } -} - -func (s *Server) Shutdown(ctx context.Context) error { - s.mu.Lock() - select { - case <-s.done: - default: - // protected by mutex - close(s.done) - } - lnerr := s.closeListeners() - s.mu.Unlock() - - ticker := time.NewTicker(200 * time.Millisecond) - defer ticker.Stop() - for { - if s.closeIdleConns() { - return lnerr - } - select { - case <-ctx.Done(): - return ctx.Err() - case <-ticker.C: - } - } -} - -// Close the server without waiting for active connections. -func (s *Server) Close() error { - s.mu.Lock() - defer s.mu.Unlock() - - select { - case <-s.done: - default: - // protected by mutex - close(s.done) - } - - err := s.closeListeners() - for c := range s.connections { - c.close() - delete(s.connections, c) - } - - return err -} - -func (s *Server) addListener(l net.Listener) { - s.mu.Lock() - defer s.mu.Unlock() - s.listeners[l] = struct{}{} -} - -func (s *Server) closeListener(l net.Listener) error { - s.mu.Lock() - defer s.mu.Unlock() - - return s.closeListenerLocked(l) -} - -func (s *Server) closeListenerLocked(l net.Listener) error { - defer delete(s.listeners, l) - return l.Close() -} - -func (s *Server) closeListeners() error { - var err error - for l := range s.listeners { - if cerr := s.closeListenerLocked(l); cerr != nil && err == nil { - err = cerr - } - } - return err -} - -func (s *Server) addConnection(c *serverConn) { - s.mu.Lock() - defer s.mu.Unlock() - - s.connections[c] = struct{}{} -} - -func (s *Server) closeIdleConns() bool { - s.mu.Lock() - defer s.mu.Unlock() - quiescent := true - for c := range s.connections { - st, ok := c.getState() - if !ok || st != connStateIdle { - quiescent = false - continue - } - c.close() - delete(s.connections, c) - } - return quiescent -} - -type connState int - -const ( - connStateActive = iota + 1 // outstanding requests - connStateIdle // no requests - connStateClosed // closed connection -) - -func (cs connState) String() string { - switch cs { - case connStateActive: - return "active" - case connStateIdle: - return "idle" - case connStateClosed: - return "closed" - default: - return "unknown" - } -} - -func (s *Server) newConn(conn net.Conn, handshake interface{}) *serverConn { - c := &serverConn{ - server: s, - conn: conn, - handshake: handshake, - shutdown: make(chan struct{}), - } - c.setState(connStateIdle) - s.addConnection(c) - return c -} - -type serverConn struct { - server *Server - conn net.Conn - handshake interface{} // data from handshake, not used for now - state atomic.Value - - shutdownOnce sync.Once - shutdown chan struct{} // forced shutdown, used by close -} - -func (c *serverConn) getState() (connState, bool) { - cs, ok := c.state.Load().(connState) - return cs, ok -} - -func (c *serverConn) setState(newstate connState) { - c.state.Store(newstate) -} - -func (c *serverConn) close() error { - c.shutdownOnce.Do(func() { - close(c.shutdown) - }) - - return nil -} - -func (c *serverConn) run(sctx context.Context) { - type ( - request struct { - id uint32 - req *Request - } - - response struct { - id uint32 - resp *Response - } - ) - - var ( - ch = newChannel(c.conn) - ctx, cancel = context.WithCancel(sctx) - active int - state connState = connStateIdle - responses = make(chan response) - requests = make(chan request) - recvErr = make(chan error, 1) - shutdown = c.shutdown - done = make(chan struct{}) - ) - - defer c.conn.Close() - defer cancel() - defer close(done) - - go func(recvErr chan error) { - defer close(recvErr) - sendImmediate := func(id uint32, st *status.Status) bool { - select { - case responses <- response{ - // even though we've had an invalid stream id, we send it - // back on the same stream id so the client knows which - // stream id was bad. - id: id, - resp: &Response{ - Status: st.Proto(), - }, - }: - return true - case <-c.shutdown: - return false - case <-done: - return false - } - } - - for { - select { - case <-c.shutdown: - return - case <-done: - return - default: // proceed - } - - mh, p, err := ch.recv() - if err != nil { - status, ok := status.FromError(err) - if !ok { - recvErr <- err - return - } - - // in this case, we send an error for that particular message - // when the status is defined. - if !sendImmediate(mh.StreamID, status) { - return - } - - continue - } - - if mh.Type != messageTypeRequest { - // we must ignore this for future compat. - continue - } - - var req Request - if err := c.server.codec.Unmarshal(p, &req); err != nil { - ch.putmbuf(p) - if !sendImmediate(mh.StreamID, status.Newf(codes.InvalidArgument, "unmarshal request error: %v", err)) { - return - } - continue - } - ch.putmbuf(p) - - if mh.StreamID%2 != 1 { - // enforce odd client initiated identifiers. - if !sendImmediate(mh.StreamID, status.Newf(codes.InvalidArgument, "StreamID must be odd for client initiated streams")) { - return - } - continue - } - - // Forward the request to the main loop. We don't wait on s.done - // because we have already accepted the client request. - select { - case requests <- request{ - id: mh.StreamID, - req: &req, - }: - case <-done: - return - } - } - }(recvErr) - - for { - newstate := state - switch { - case active > 0: - newstate = connStateActive - shutdown = nil - case active == 0: - newstate = connStateIdle - shutdown = c.shutdown // only enable this branch in idle mode - } - - if newstate != state { - c.setState(newstate) - state = newstate - } - - select { - case request := <-requests: - active++ - go func(id uint32) { - ctx, cancel := getRequestContext(ctx, request.req) - defer cancel() - - p, status := c.server.services.call(ctx, request.req.Service, request.req.Method, request.req.Payload) - resp := &Response{ - Status: status.Proto(), - Payload: p, - } - - select { - case responses <- response{ - id: id, - resp: resp, - }: - case <-done: - } - }(request.id) - case response := <-responses: - p, err := c.server.codec.Marshal(response.resp) - if err != nil { - logrus.WithError(err).Error("failed marshaling response") - return - } - - if err := ch.send(response.id, messageTypeResponse, p); err != nil { - logrus.WithError(err).Error("failed sending message on channel") - return - } - - active-- - case err := <-recvErr: - // TODO(stevvooe): Not wildly clear what we should do in this - // branch. Basically, it means that we are no longer receiving - // requests due to a terminal error. - recvErr = nil // connection is now "closing" - if err == io.EOF || err == io.ErrUnexpectedEOF { - // The client went away and we should stop processing - // requests, so that the client connection is closed - return - } - if err != nil { - logrus.WithError(err).Error("error receiving message") - } - case <-shutdown: - return - } - } -} - -var noopFunc = func() {} - -func getRequestContext(ctx context.Context, req *Request) (retCtx context.Context, cancel func()) { - if len(req.Metadata) > 0 { - md := MD{} - md.fromRequest(req) - ctx = WithMetadata(ctx, md) - } - - cancel = noopFunc - if req.TimeoutNano == 0 { - return ctx, cancel - } - - ctx, cancel = context.WithTimeout(ctx, time.Duration(req.TimeoutNano)) - return ctx, cancel -} diff --git a/vendor/github.com/containerd/ttrpc/services.go b/vendor/github.com/containerd/ttrpc/services.go deleted file mode 100644 index 0eacfd79aa..0000000000 --- a/vendor/github.com/containerd/ttrpc/services.go +++ /dev/null @@ -1,156 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "io" - "os" - "path" - - "github.com/gogo/protobuf/proto" - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type Method func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) - -type ServiceDesc struct { - Methods map[string]Method - - // TODO(stevvooe): Add stream support. -} - -type serviceSet struct { - services map[string]ServiceDesc - interceptor UnaryServerInterceptor -} - -func newServiceSet(interceptor UnaryServerInterceptor) *serviceSet { - return &serviceSet{ - services: make(map[string]ServiceDesc), - interceptor: interceptor, - } -} - -func (s *serviceSet) register(name string, methods map[string]Method) { - if _, ok := s.services[name]; ok { - panic(errors.Errorf("duplicate service %v registered", name)) - } - - s.services[name] = ServiceDesc{ - Methods: methods, - } -} - -func (s *serviceSet) call(ctx context.Context, serviceName, methodName string, p []byte) ([]byte, *status.Status) { - p, err := s.dispatch(ctx, serviceName, methodName, p) - st, ok := status.FromError(err) - if !ok { - st = status.New(convertCode(err), err.Error()) - } - - return p, st -} - -func (s *serviceSet) dispatch(ctx context.Context, serviceName, methodName string, p []byte) ([]byte, error) { - method, err := s.resolve(serviceName, methodName) - if err != nil { - return nil, err - } - - unmarshal := func(obj interface{}) error { - switch v := obj.(type) { - case proto.Message: - if err := proto.Unmarshal(p, v); err != nil { - return status.Errorf(codes.Internal, "ttrpc: error unmarshalling payload: %v", err.Error()) - } - default: - return status.Errorf(codes.Internal, "ttrpc: error unsupported request type: %T", v) - } - return nil - } - - info := &UnaryServerInfo{ - FullMethod: fullPath(serviceName, methodName), - } - - resp, err := s.interceptor(ctx, unmarshal, info, method) - if err != nil { - return nil, err - } - - switch v := resp.(type) { - case proto.Message: - r, err := proto.Marshal(v) - if err != nil { - return nil, status.Errorf(codes.Internal, "ttrpc: error marshaling payload: %v", err.Error()) - } - - return r, nil - default: - return nil, status.Errorf(codes.Internal, "ttrpc: error unsupported response type: %T", v) - } -} - -func (s *serviceSet) resolve(service, method string) (Method, error) { - srv, ok := s.services[service] - if !ok { - return nil, status.Errorf(codes.NotFound, "service %v", service) - } - - mthd, ok := srv.Methods[method] - if !ok { - return nil, status.Errorf(codes.NotFound, "method %v", method) - } - - return mthd, nil -} - -// convertCode maps stdlib go errors into grpc space. -// -// This is ripped from the grpc-go code base. -func convertCode(err error) codes.Code { - switch err { - case nil: - return codes.OK - case io.EOF: - return codes.OutOfRange - case io.ErrClosedPipe, io.ErrNoProgress, io.ErrShortBuffer, io.ErrShortWrite, io.ErrUnexpectedEOF: - return codes.FailedPrecondition - case os.ErrInvalid: - return codes.InvalidArgument - case context.Canceled: - return codes.Canceled - case context.DeadlineExceeded: - return codes.DeadlineExceeded - } - switch { - case os.IsExist(err): - return codes.AlreadyExists - case os.IsNotExist(err): - return codes.NotFound - case os.IsPermission(err): - return codes.PermissionDenied - } - return codes.Unknown -} - -func fullPath(service, method string) string { - return "/" + path.Join(service, method) -} diff --git a/vendor/github.com/containerd/ttrpc/types.go b/vendor/github.com/containerd/ttrpc/types.go deleted file mode 100644 index 9a1c19a723..0000000000 --- a/vendor/github.com/containerd/ttrpc/types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "fmt" - - spb "google.golang.org/genproto/googleapis/rpc/status" -) - -type Request struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3"` - Method string `protobuf:"bytes,2,opt,name=method,proto3"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3"` - TimeoutNano int64 `protobuf:"varint,4,opt,name=timeout_nano,proto3"` - Metadata []*KeyValue `protobuf:"bytes,5,rep,name=metadata,proto3"` -} - -func (r *Request) Reset() { *r = Request{} } -func (r *Request) String() string { return fmt.Sprintf("%+#v", r) } -func (r *Request) ProtoMessage() {} - -type Response struct { - Status *spb.Status `protobuf:"bytes,1,opt,name=status,proto3"` - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3"` -} - -func (r *Response) Reset() { *r = Response{} } -func (r *Response) String() string { return fmt.Sprintf("%+#v", r) } -func (r *Response) ProtoMessage() {} - -type StringList struct { - List []string `protobuf:"bytes,1,rep,name=list,proto3"` -} - -func (r *StringList) Reset() { *r = StringList{} } -func (r *StringList) String() string { return fmt.Sprintf("%+#v", r) } -func (r *StringList) ProtoMessage() {} - -func makeStringList(item ...string) StringList { return StringList{List: item} } - -type KeyValue struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3"` - Value string `protobuf:"bytes,2,opt,name=value,proto3"` -} - -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (*KeyValue) ProtoMessage() {} -func (m *KeyValue) String() string { return fmt.Sprintf("%+#v", m) } diff --git a/vendor/github.com/containerd/ttrpc/unixcreds_linux.go b/vendor/github.com/containerd/ttrpc/unixcreds_linux.go deleted file mode 100644 index a471bd365c..0000000000 --- a/vendor/github.com/containerd/ttrpc/unixcreds_linux.go +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package ttrpc - -import ( - "context" - "net" - "os" - "syscall" - - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -type UnixCredentialsFunc func(*unix.Ucred) error - -func (fn UnixCredentialsFunc) Handshake(ctx context.Context, conn net.Conn) (net.Conn, interface{}, error) { - uc, err := requireUnixSocket(conn) - if err != nil { - return nil, nil, errors.Wrap(err, "ttrpc.UnixCredentialsFunc: require unix socket") - } - - rs, err := uc.SyscallConn() - if err != nil { - return nil, nil, errors.Wrap(err, "ttrpc.UnixCredentialsFunc: (net.UnixConn).SyscallConn failed") - } - var ( - ucred *unix.Ucred - ucredErr error - ) - if err := rs.Control(func(fd uintptr) { - ucred, ucredErr = unix.GetsockoptUcred(int(fd), unix.SOL_SOCKET, unix.SO_PEERCRED) - }); err != nil { - return nil, nil, errors.Wrapf(err, "ttrpc.UnixCredentialsFunc: (*syscall.RawConn).Control failed") - } - - if ucredErr != nil { - return nil, nil, errors.Wrapf(err, "ttrpc.UnixCredentialsFunc: failed to retrieve socket peer credentials") - } - - if err := fn(ucred); err != nil { - return nil, nil, errors.Wrapf(err, "ttrpc.UnixCredentialsFunc: credential check failed") - } - - return uc, ucred, nil -} - -// UnixSocketRequireUidGid requires specific *effective* UID/GID, rather than the real UID/GID. -// -// For example, if a daemon binary is owned by the root (UID 0) with SUID bit but running as an -// unprivileged user (UID 1001), the effective UID becomes 0, and the real UID becomes 1001. -// So calling this function with uid=0 allows a connection from effective UID 0 but rejects -// a connection from effective UID 1001. -// -// See socket(7), SO_PEERCRED: "The returned credentials are those that were in effect at the time of the call to connect(2) or socketpair(2)." -func UnixSocketRequireUidGid(uid, gid int) UnixCredentialsFunc { - return func(ucred *unix.Ucred) error { - return requireUidGid(ucred, uid, gid) - } -} - -func UnixSocketRequireRoot() UnixCredentialsFunc { - return UnixSocketRequireUidGid(0, 0) -} - -// UnixSocketRequireSameUser resolves the current effective unix user and returns a -// UnixCredentialsFunc that will validate incoming unix connections against the -// current credentials. -// -// This is useful when using abstract sockets that are accessible by all users. -func UnixSocketRequireSameUser() UnixCredentialsFunc { - euid, egid := os.Geteuid(), os.Getegid() - return UnixSocketRequireUidGid(euid, egid) -} - -func requireRoot(ucred *unix.Ucred) error { - return requireUidGid(ucred, 0, 0) -} - -func requireUidGid(ucred *unix.Ucred, uid, gid int) error { - if (uid != -1 && uint32(uid) != ucred.Uid) || (gid != -1 && uint32(gid) != ucred.Gid) { - return errors.Wrap(syscall.EPERM, "ttrpc: invalid credentials") - } - return nil -} - -func requireUnixSocket(conn net.Conn) (*net.UnixConn, error) { - uc, ok := conn.(*net.UnixConn) - if !ok { - return nil, errors.New("a unix socket connection is required") - } - - return uc, nil -} diff --git a/vendor/github.com/moby/buildkit/README.md b/vendor/github.com/moby/buildkit/README.md index d2b0a6c7b5..b5f6370175 100644 --- a/vendor/github.com/moby/buildkit/README.md +++ b/vendor/github.com/moby/buildkit/README.md @@ -45,7 +45,7 @@ You don't need to read this document unless you want to use the full-featured st - [Building a Dockerfile using external frontend:](#building-a-dockerfile-using-external-frontend) - [Building a Dockerfile with experimental features like `RUN --mount=type=(bind|cache|tmpfs|secret|ssh)`](#building-a-dockerfile-with-experimental-features-like-run---mounttypebindcachetmpfssecretssh) - [Output](#output) - - [Registry](#registry) + - [Image/Registry](#imageregistry) - [Local directory](#local-directory) - [Docker tarball](#docker-tarball) - [OCI tarball](#oci-tarball) @@ -85,6 +85,7 @@ BuildKit is used by the following projects: - [Rio](https://github.com/rancher/rio) - [PouchContainer](https://github.com/alibaba/pouch) - [Docker buildx](https://github.com/docker/buildx) +- [Okteto Cloud](https://okteto.com/) ## Quick start @@ -94,7 +95,7 @@ BuildKit is composed of the `buildkitd` daemon and the `buildctl` client. While the `buildctl` client is available for Linux, macOS, and Windows, the `buildkitd` daemon is only available for Linux currently. The `buildkitd` daemon requires the following components to be installed: -- [runc](https://github.com/opencontainers/runc) +- [runc](https://github.com/opencontainers/runc) or [crun](https://github.com/containers/crun) - [containerd](https://github.com/containerd/containerd) (if you want to use containerd worker) The latest binaries of BuildKit are available [here](https://github.com/moby/buildkit/releases) for Linux, macOS, and Windows. @@ -125,6 +126,11 @@ We are open to adding more backends. The buildkitd daemon listens gRPC API on `/run/buildkit/buildkitd.sock` by default, but you can also use TCP sockets. See [Expose BuildKit as a TCP service](#expose-buildkit-as-a-tcp-service). +:information_source: Notice to Fedora 31 users: + +* As runc still does not work on cgroup v2 environment like Fedora 31, you need to substitute runc with crun. Run `buildkitd` with `--oci-worker-binary=crun`. +* If you want to use runc, you need to configure the system to use cgroup v1. Run `sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"` and reboot. + ### Exploring LLB BuildKit builds are based on a binary intermediate format called LLB that is used for defining the dependency graph for processes running part of your build. tl;dr: LLB is to Dockerfile what LLVM IR is to C. @@ -193,14 +199,14 @@ See [`frontend/dockerfile/docs/experimental.md`](frontend/dockerfile/docs/experi By default, the build result and intermediate cache will only remain internally in BuildKit. An output needs to be specified to retrieve the result. -#### Registry +#### Image/Registry ```bash buildctl build ... --output type=image,name=docker.io/username/image,push=true ``` -To export and import the cache along with the image, you need to specify `--export-cache type=inline` and `--import-cache type=registry,ref=...`. -See [Export cache](#export-cache). +To export the cache embed with the image and pushing them to registry together, type `registry` is required to import the cache, you should specify `--export-cache type=inline` and `--import-cache type=registry,ref=...`. To export the cache to a local directy, you should specify `--export-cache type=local`. +Details in [Export cache](#export-cache). ```bash buildctl build ...\ @@ -209,6 +215,18 @@ buildctl build ...\ --import-cache type=registry,ref=docker.io/username/image ``` +Keys supported by image output: +* `name=[value]`: image name +* `push=true`: push after creating the image +* `push-by-digest=true`: push unnamed image +* `registry.insecure=true`: push to insecure HTTP registry +* `oci-mediatypes=true`: use OCI mediatypes in configuration JSON instead of Docker's +* `unpack=true`: unpack image after creation (for use with containerd) +* `dangling-name-prefix=[value]`: name image with `prefix@` , used for anonymous images +* `name-canonical=true`: add additional canonical name `name@` +* `compression=[uncompressed,gzip]`: choose compression type for layer, gzip is default value + + If credentials are required, `buildctl` will attempt to read Docker configuration file `$DOCKER_CONFIG/config.json`. `$DOCKER_CONFIG` defaults to `~/.docker`. @@ -322,14 +340,11 @@ buildctl build ... \ ```bash buildctl build ... --export-cache type=local,dest=path/to/output-dir -buildctl build ... --import-cache type=local,src=path/to/input-dir,digest=sha256:deadbeef +buildctl build ... --import-cache type=local,src=path/to/input-dir ``` The directory layout conforms to OCI Image Spec v1.0. -Currently, you need to specify the `digest` of the manifest list to import for `local` cache importer. -This is planned to default to the digest of "latest" tag in `index.json` in future. - #### `--export-cache` options - `type`: `inline`, `registry`, or `local` - `mode=min` (default): only export layers for the resulting image @@ -341,7 +356,9 @@ This is planned to default to the digest of "latest" tag in `index.json` in futu - `type`: `registry` or `local`. Use `registry` to import `inline` cache. - `ref=docker.io/user/image:tag`: reference for `registry` cache importer - `src=path/to/input-dir`: directory for `local` cache importer -- `digest=sha256:deadbeef`: digest of the manifest list to import for `local` cache importer. +- `digest=sha256:deadbeef`: digest of the manifest list to import for `local` cache importer. +- `tag=customtag`: custom tag of image for `local` cache importer. + Defaults to the digest of "latest" tag in `index.json` is for digest, not for tag ### Consistent hashing diff --git a/vendor/github.com/moby/buildkit/api/services/control/control.pb.go b/vendor/github.com/moby/buildkit/api/services/control/control.pb.go index 565c569e8b..fdc10596f7 100644 --- a/vendor/github.com/moby/buildkit/api/services/control/control.pb.go +++ b/vendor/github.com/moby/buildkit/api/services/control/control.pb.go @@ -3,27 +3,26 @@ package moby_buildkit_v1 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" -import _ "github.com/golang/protobuf/ptypes/timestamp" -import types "github.com/moby/buildkit/api/types" -import pb "github.com/moby/buildkit/solver/pb" - -import time "time" -import github_com_moby_buildkit_util_entitlements "github.com/moby/buildkit/util/entitlements" -import github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + types "github.com/moby/buildkit/api/types" + pb "github.com/moby/buildkit/solver/pb" + github_com_moby_buildkit_util_entitlements "github.com/moby/buildkit/util/entitlements" + github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + time "time" ) -import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -34,7 +33,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type PruneRequest struct { Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` @@ -50,7 +49,7 @@ func (m *PruneRequest) Reset() { *m = PruneRequest{} } func (m *PruneRequest) String() string { return proto.CompactTextString(m) } func (*PruneRequest) ProtoMessage() {} func (*PruneRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{0} + return fileDescriptor_0c5120591600887d, []int{0} } func (m *PruneRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -60,15 +59,15 @@ func (m *PruneRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PruneRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *PruneRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PruneRequest.Merge(dst, src) +func (m *PruneRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PruneRequest.Merge(m, src) } func (m *PruneRequest) XXX_Size() int { return m.Size() @@ -118,7 +117,7 @@ func (m *DiskUsageRequest) Reset() { *m = DiskUsageRequest{} } func (m *DiskUsageRequest) String() string { return proto.CompactTextString(m) } func (*DiskUsageRequest) ProtoMessage() {} func (*DiskUsageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{1} + return fileDescriptor_0c5120591600887d, []int{1} } func (m *DiskUsageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -128,15 +127,15 @@ func (m *DiskUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_DiskUsageRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *DiskUsageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskUsageRequest.Merge(dst, src) +func (m *DiskUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskUsageRequest.Merge(m, src) } func (m *DiskUsageRequest) XXX_Size() int { return m.Size() @@ -165,7 +164,7 @@ func (m *DiskUsageResponse) Reset() { *m = DiskUsageResponse{} } func (m *DiskUsageResponse) String() string { return proto.CompactTextString(m) } func (*DiskUsageResponse) ProtoMessage() {} func (*DiskUsageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{2} + return fileDescriptor_0c5120591600887d, []int{2} } func (m *DiskUsageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,15 +174,15 @@ func (m *DiskUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_DiskUsageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *DiskUsageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskUsageResponse.Merge(dst, src) +func (m *DiskUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskUsageResponse.Merge(m, src) } func (m *DiskUsageResponse) XXX_Size() int { return m.Size() @@ -222,7 +221,7 @@ func (m *UsageRecord) Reset() { *m = UsageRecord{} } func (m *UsageRecord) String() string { return proto.CompactTextString(m) } func (*UsageRecord) ProtoMessage() {} func (*UsageRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{3} + return fileDescriptor_0c5120591600887d, []int{3} } func (m *UsageRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -232,15 +231,15 @@ func (m *UsageRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UsageRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *UsageRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_UsageRecord.Merge(dst, src) +func (m *UsageRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_UsageRecord.Merge(m, src) } func (m *UsageRecord) XXX_Size() int { return m.Size() @@ -338,6 +337,7 @@ type SolveRequest struct { FrontendAttrs map[string]string `protobuf:"bytes,7,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Cache CacheOptions `protobuf:"bytes,8,opt,name=Cache,proto3" json:"Cache"` Entitlements []github_com_moby_buildkit_util_entitlements.Entitlement `protobuf:"bytes,9,rep,name=Entitlements,proto3,customtype=github.com/moby/buildkit/util/entitlements.Entitlement" json:"Entitlements,omitempty"` + FrontendInputs map[string]*pb.Definition `protobuf:"bytes,10,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -347,7 +347,7 @@ func (m *SolveRequest) Reset() { *m = SolveRequest{} } func (m *SolveRequest) String() string { return proto.CompactTextString(m) } func (*SolveRequest) ProtoMessage() {} func (*SolveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{4} + return fileDescriptor_0c5120591600887d, []int{4} } func (m *SolveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,15 +357,15 @@ func (m *SolveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SolveRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *SolveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SolveRequest.Merge(dst, src) +func (m *SolveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SolveRequest.Merge(m, src) } func (m *SolveRequest) XXX_Size() int { return m.Size() @@ -432,6 +432,13 @@ func (m *SolveRequest) GetCache() CacheOptions { return CacheOptions{} } +func (m *SolveRequest) GetFrontendInputs() map[string]*pb.Definition { + if m != nil { + return m.FrontendInputs + } + return nil +} + type CacheOptions struct { // ExportRefDeprecated is deprecated in favor or the new Exports since BuildKit v0.4.0. // When ExportRefDeprecated is set, the solver appends @@ -459,7 +466,7 @@ func (m *CacheOptions) Reset() { *m = CacheOptions{} } func (m *CacheOptions) String() string { return proto.CompactTextString(m) } func (*CacheOptions) ProtoMessage() {} func (*CacheOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{5} + return fileDescriptor_0c5120591600887d, []int{5} } func (m *CacheOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -469,15 +476,15 @@ func (m *CacheOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_CacheOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CacheOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheOptions.Merge(dst, src) +func (m *CacheOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheOptions.Merge(m, src) } func (m *CacheOptions) XXX_Size() int { return m.Size() @@ -538,7 +545,7 @@ func (m *CacheOptionsEntry) Reset() { *m = CacheOptionsEntry{} } func (m *CacheOptionsEntry) String() string { return proto.CompactTextString(m) } func (*CacheOptionsEntry) ProtoMessage() {} func (*CacheOptionsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{6} + return fileDescriptor_0c5120591600887d, []int{6} } func (m *CacheOptionsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,15 +555,15 @@ func (m *CacheOptionsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_CacheOptionsEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CacheOptionsEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheOptionsEntry.Merge(dst, src) +func (m *CacheOptionsEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheOptionsEntry.Merge(m, src) } func (m *CacheOptionsEntry) XXX_Size() int { return m.Size() @@ -592,7 +599,7 @@ func (m *SolveResponse) Reset() { *m = SolveResponse{} } func (m *SolveResponse) String() string { return proto.CompactTextString(m) } func (*SolveResponse) ProtoMessage() {} func (*SolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{7} + return fileDescriptor_0c5120591600887d, []int{7} } func (m *SolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,15 +609,15 @@ func (m *SolveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_SolveResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *SolveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SolveResponse.Merge(dst, src) +func (m *SolveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SolveResponse.Merge(m, src) } func (m *SolveResponse) XXX_Size() int { return m.Size() @@ -639,7 +646,7 @@ func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (m *StatusRequest) String() string { return proto.CompactTextString(m) } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{8} + return fileDescriptor_0c5120591600887d, []int{8} } func (m *StatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -649,15 +656,15 @@ func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(dst, src) +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) } func (m *StatusRequest) XXX_Size() int { return m.Size() @@ -688,7 +695,7 @@ func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (m *StatusResponse) String() string { return proto.CompactTextString(m) } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{9} + return fileDescriptor_0c5120591600887d, []int{9} } func (m *StatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -698,15 +705,15 @@ func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(dst, src) +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) } func (m *StatusResponse) XXX_Size() int { return m.Size() @@ -755,7 +762,7 @@ func (m *Vertex) Reset() { *m = Vertex{} } func (m *Vertex) String() string { return proto.CompactTextString(m) } func (*Vertex) ProtoMessage() {} func (*Vertex) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{10} + return fileDescriptor_0c5120591600887d, []int{10} } func (m *Vertex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -765,15 +772,15 @@ func (m *Vertex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Vertex.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *Vertex) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vertex.Merge(dst, src) +func (m *Vertex) XXX_Merge(src proto.Message) { + xxx_messageInfo_Vertex.Merge(m, src) } func (m *Vertex) XXX_Size() int { return m.Size() @@ -838,7 +845,7 @@ func (m *VertexStatus) Reset() { *m = VertexStatus{} } func (m *VertexStatus) String() string { return proto.CompactTextString(m) } func (*VertexStatus) ProtoMessage() {} func (*VertexStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{11} + return fileDescriptor_0c5120591600887d, []int{11} } func (m *VertexStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -848,15 +855,15 @@ func (m *VertexStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_VertexStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *VertexStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_VertexStatus.Merge(dst, src) +func (m *VertexStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_VertexStatus.Merge(m, src) } func (m *VertexStatus) XXX_Size() int { return m.Size() @@ -930,7 +937,7 @@ func (m *VertexLog) Reset() { *m = VertexLog{} } func (m *VertexLog) String() string { return proto.CompactTextString(m) } func (*VertexLog) ProtoMessage() {} func (*VertexLog) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{12} + return fileDescriptor_0c5120591600887d, []int{12} } func (m *VertexLog) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -940,15 +947,15 @@ func (m *VertexLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VertexLog.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *VertexLog) XXX_Merge(src proto.Message) { - xxx_messageInfo_VertexLog.Merge(dst, src) +func (m *VertexLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_VertexLog.Merge(m, src) } func (m *VertexLog) XXX_Size() int { return m.Size() @@ -991,7 +998,7 @@ func (m *BytesMessage) Reset() { *m = BytesMessage{} } func (m *BytesMessage) String() string { return proto.CompactTextString(m) } func (*BytesMessage) ProtoMessage() {} func (*BytesMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{13} + return fileDescriptor_0c5120591600887d, []int{13} } func (m *BytesMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1001,15 +1008,15 @@ func (m *BytesMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_BytesMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *BytesMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_BytesMessage.Merge(dst, src) +func (m *BytesMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_BytesMessage.Merge(m, src) } func (m *BytesMessage) XXX_Size() int { return m.Size() @@ -1038,7 +1045,7 @@ func (m *ListWorkersRequest) Reset() { *m = ListWorkersRequest{} } func (m *ListWorkersRequest) String() string { return proto.CompactTextString(m) } func (*ListWorkersRequest) ProtoMessage() {} func (*ListWorkersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{14} + return fileDescriptor_0c5120591600887d, []int{14} } func (m *ListWorkersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1048,15 +1055,15 @@ func (m *ListWorkersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListWorkersRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ListWorkersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListWorkersRequest.Merge(dst, src) +func (m *ListWorkersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListWorkersRequest.Merge(m, src) } func (m *ListWorkersRequest) XXX_Size() int { return m.Size() @@ -1085,7 +1092,7 @@ func (m *ListWorkersResponse) Reset() { *m = ListWorkersResponse{} } func (m *ListWorkersResponse) String() string { return proto.CompactTextString(m) } func (*ListWorkersResponse) ProtoMessage() {} func (*ListWorkersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_86d7f5d7b8f10de2, []int{15} + return fileDescriptor_0c5120591600887d, []int{15} } func (m *ListWorkersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1095,15 +1102,15 @@ func (m *ListWorkersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListWorkersResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ListWorkersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListWorkersResponse.Merge(dst, src) +func (m *ListWorkersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListWorkersResponse.Merge(m, src) } func (m *ListWorkersResponse) XXX_Size() int { return m.Size() @@ -1129,6 +1136,7 @@ func init() { proto.RegisterType((*SolveRequest)(nil), "moby.buildkit.v1.SolveRequest") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.ExporterAttrsEntry") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.SolveRequest.FrontendAttrsEntry") + proto.RegisterMapType((map[string]*pb.Definition)(nil), "moby.buildkit.v1.SolveRequest.FrontendInputsEntry") proto.RegisterType((*CacheOptions)(nil), "moby.buildkit.v1.CacheOptions") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.CacheOptions.ExportAttrsDeprecatedEntry") proto.RegisterType((*CacheOptionsEntry)(nil), "moby.buildkit.v1.CacheOptionsEntry") @@ -1145,6 +1153,100 @@ func init() { proto.RegisterType((*ListWorkersResponse)(nil), "moby.buildkit.v1.ListWorkersResponse") } +func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } + +var fileDescriptor_0c5120591600887d = []byte{ + // 1397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xef, 0xda, 0xf1, 0xdb, 0x63, 0x27, 0x4a, 0xa7, 0xfd, 0x57, 0xab, 0xfd, 0x8b, 0xc4, 0x6c, + 0x8b, 0x64, 0x55, 0xed, 0x3a, 0x35, 0x14, 0x95, 0x08, 0x50, 0xeb, 0xb8, 0xa8, 0xa9, 0x1a, 0x51, + 0x36, 0x2d, 0x95, 0x7a, 0x40, 0x5a, 0xdb, 0x13, 0x77, 0x95, 0xf5, 0xce, 0x32, 0x33, 0x1b, 0x6a, + 0x3e, 0x00, 0x67, 0xbe, 0x03, 0x07, 0x4e, 0x9c, 0x38, 0xf0, 0x09, 0x90, 0x7a, 0xe4, 0xdc, 0x43, + 0x40, 0xb9, 0xc3, 0x9d, 0x1b, 0x9a, 0x97, 0x75, 0xc6, 0xb1, 0x9d, 0xc4, 0xe9, 0xc9, 0xf3, 0x8c, + 0x9f, 0xdf, 0x6f, 0x9f, 0xd7, 0x99, 0x79, 0x60, 0xb9, 0x47, 0x62, 0x4e, 0x49, 0xe4, 0x25, 0x94, + 0x70, 0x82, 0x56, 0x87, 0xa4, 0x3b, 0xf2, 0xba, 0x69, 0x18, 0xf5, 0xf7, 0x43, 0xee, 0x1d, 0xdc, + 0x71, 0x6e, 0x0f, 0x42, 0xfe, 0x2a, 0xed, 0x7a, 0x3d, 0x32, 0x6c, 0x0e, 0xc8, 0x80, 0x34, 0xa5, + 0x62, 0x37, 0xdd, 0x93, 0x92, 0x14, 0xe4, 0x4a, 0x11, 0x38, 0xeb, 0x03, 0x42, 0x06, 0x11, 0x3e, + 0xd6, 0xe2, 0xe1, 0x10, 0x33, 0x1e, 0x0c, 0x13, 0xad, 0x70, 0xcb, 0xe0, 0x13, 0x1f, 0x6b, 0x66, + 0x1f, 0x6b, 0x32, 0x12, 0x1d, 0x60, 0xda, 0x4c, 0xba, 0x4d, 0x92, 0x30, 0xad, 0xdd, 0x9c, 0xab, + 0x1d, 0x24, 0x61, 0x93, 0x8f, 0x12, 0xcc, 0x9a, 0xdf, 0x11, 0xba, 0x8f, 0xa9, 0x02, 0xb8, 0x3f, + 0x58, 0x50, 0x7b, 0x4a, 0xd3, 0x18, 0xfb, 0xf8, 0xdb, 0x14, 0x33, 0x8e, 0xae, 0x41, 0x71, 0x2f, + 0x8c, 0x38, 0xa6, 0xb6, 0x55, 0xcf, 0x37, 0x2a, 0xbe, 0x96, 0xd0, 0x2a, 0xe4, 0x83, 0x28, 0xb2, + 0x73, 0x75, 0xab, 0x51, 0xf6, 0xc5, 0x12, 0x35, 0xa0, 0xb6, 0x8f, 0x71, 0xd2, 0x49, 0x69, 0xc0, + 0x43, 0x12, 0xdb, 0xf9, 0xba, 0xd5, 0xc8, 0xb7, 0x97, 0xde, 0x1c, 0xae, 0x5b, 0xfe, 0xc4, 0x3f, + 0xc8, 0x85, 0x8a, 0x90, 0xdb, 0x23, 0x8e, 0x99, 0xbd, 0x64, 0xa8, 0x1d, 0x6f, 0xbb, 0x37, 0x61, + 0xb5, 0x13, 0xb2, 0xfd, 0xe7, 0x2c, 0x18, 0x9c, 0x65, 0x8b, 0xfb, 0x18, 0x2e, 0x1b, 0xba, 0x2c, + 0x21, 0x31, 0xc3, 0xe8, 0x2e, 0x14, 0x29, 0xee, 0x11, 0xda, 0x97, 0xca, 0xd5, 0xd6, 0x7b, 0xde, + 0xc9, 0xdc, 0x78, 0x1a, 0x20, 0x94, 0x7c, 0xad, 0xec, 0xfe, 0x9b, 0x83, 0xaa, 0xb1, 0x8f, 0x56, + 0x20, 0xb7, 0xdd, 0xb1, 0xad, 0xba, 0xd5, 0xa8, 0xf8, 0xb9, 0xed, 0x0e, 0xb2, 0xa1, 0xb4, 0x93, + 0xf2, 0xa0, 0x1b, 0x61, 0xed, 0x7b, 0x26, 0xa2, 0xab, 0x50, 0xd8, 0x8e, 0x9f, 0x33, 0x2c, 0x1d, + 0x2f, 0xfb, 0x4a, 0x40, 0x08, 0x96, 0x76, 0xc3, 0xef, 0xb1, 0x72, 0xd3, 0x97, 0x6b, 0xe1, 0xc7, + 0xd3, 0x80, 0xe2, 0x98, 0xdb, 0x05, 0xc9, 0xab, 0x25, 0xd4, 0x86, 0xca, 0x16, 0xc5, 0x01, 0xc7, + 0xfd, 0x07, 0xdc, 0x2e, 0xd6, 0xad, 0x46, 0xb5, 0xe5, 0x78, 0xaa, 0x20, 0xbc, 0xac, 0x20, 0xbc, + 0x67, 0x59, 0x41, 0xb4, 0xcb, 0x6f, 0x0e, 0xd7, 0x2f, 0xfd, 0xf8, 0xa7, 0x88, 0xdb, 0x18, 0x86, + 0xee, 0x03, 0x3c, 0x09, 0x18, 0x7f, 0xce, 0x24, 0x49, 0xe9, 0x4c, 0x92, 0x25, 0x49, 0x60, 0x60, + 0xd0, 0x1a, 0x80, 0x0c, 0xc0, 0x16, 0x49, 0x63, 0x6e, 0x97, 0xa5, 0xdd, 0xc6, 0x0e, 0xaa, 0x43, + 0xb5, 0x83, 0x59, 0x8f, 0x86, 0x89, 0x4c, 0x73, 0x45, 0xba, 0x60, 0x6e, 0x09, 0x06, 0x15, 0xbd, + 0x67, 0xa3, 0x04, 0xdb, 0x20, 0x15, 0x8c, 0x1d, 0xe1, 0xff, 0xee, 0xab, 0x80, 0xe2, 0xbe, 0x5d, + 0x95, 0xa1, 0xd2, 0x92, 0xfb, 0x53, 0x11, 0x6a, 0xbb, 0xa2, 0x8a, 0xb3, 0x84, 0xaf, 0x42, 0xde, + 0xc7, 0x7b, 0x3a, 0xfa, 0x62, 0x89, 0x3c, 0x80, 0x0e, 0xde, 0x0b, 0xe3, 0x50, 0x7e, 0x3b, 0x27, + 0xdd, 0x5b, 0xf1, 0x92, 0xae, 0x77, 0xbc, 0xeb, 0x1b, 0x1a, 0xc8, 0x81, 0xf2, 0xc3, 0xd7, 0x09, + 0xa1, 0xa2, 0x68, 0xf2, 0x92, 0x66, 0x2c, 0xa3, 0x17, 0xb0, 0x9c, 0xad, 0x1f, 0x70, 0x4e, 0x45, + 0x29, 0x8a, 0x42, 0xb9, 0x33, 0x5d, 0x28, 0xa6, 0x51, 0xde, 0x04, 0xe6, 0x61, 0xcc, 0xe9, 0xc8, + 0x9f, 0xe4, 0x11, 0x35, 0xb2, 0x8b, 0x19, 0x13, 0x16, 0xaa, 0x04, 0x67, 0xa2, 0x30, 0xe7, 0x0b, + 0x4a, 0x62, 0x8e, 0xe3, 0xbe, 0x4c, 0x70, 0xc5, 0x1f, 0xcb, 0xc2, 0x9c, 0x6c, 0xad, 0xcc, 0x29, + 0x9d, 0xcb, 0x9c, 0x09, 0x8c, 0x36, 0x67, 0x62, 0x0f, 0x6d, 0x42, 0x61, 0x2b, 0xe8, 0xbd, 0xc2, + 0x32, 0x97, 0xd5, 0xd6, 0xda, 0x34, 0xa1, 0xfc, 0xfb, 0x4b, 0x99, 0x3c, 0x26, 0x5b, 0xf1, 0x92, + 0xaf, 0x20, 0xe8, 0x1b, 0xa8, 0x3d, 0x8c, 0x79, 0xc8, 0x23, 0x3c, 0xc4, 0x31, 0x67, 0x76, 0x45, + 0x34, 0x5e, 0x7b, 0xf3, 0xed, 0xe1, 0xfa, 0xc7, 0x73, 0x8f, 0x96, 0x94, 0x87, 0x51, 0x13, 0x1b, + 0x28, 0xcf, 0xa0, 0xf0, 0x27, 0xf8, 0xd0, 0x4b, 0x58, 0xc9, 0x8c, 0xdd, 0x8e, 0x93, 0x94, 0x33, + 0x1b, 0xa4, 0xd7, 0xad, 0x73, 0x7a, 0xad, 0x40, 0xca, 0xed, 0x13, 0x4c, 0xce, 0x7d, 0x40, 0xd3, + 0xb9, 0x12, 0x35, 0xb5, 0x8f, 0x47, 0x59, 0x4d, 0xed, 0xe3, 0x91, 0x68, 0xdc, 0x83, 0x20, 0x4a, + 0x55, 0x43, 0x57, 0x7c, 0x25, 0x6c, 0xe6, 0xee, 0x59, 0x82, 0x61, 0x3a, 0xbc, 0x0b, 0x31, 0x7c, + 0x05, 0x57, 0x66, 0x98, 0x3a, 0x83, 0xe2, 0x86, 0x49, 0x31, 0x5d, 0xd3, 0xc7, 0x94, 0xee, 0x2f, + 0x79, 0xa8, 0x99, 0x09, 0x43, 0x1b, 0x70, 0x45, 0xf9, 0xe9, 0xe3, 0xbd, 0x0e, 0x4e, 0x28, 0xee, + 0x89, 0xb3, 0x40, 0x93, 0xcf, 0xfa, 0x0b, 0xb5, 0xe0, 0xea, 0xf6, 0x50, 0x6f, 0x33, 0x03, 0x92, + 0x93, 0xc7, 0xea, 0xcc, 0xff, 0x10, 0x81, 0xff, 0x29, 0x2a, 0x19, 0x09, 0x03, 0x94, 0x97, 0x09, + 0xfb, 0xe4, 0xf4, 0xaa, 0xf2, 0x66, 0x62, 0x55, 0xde, 0x66, 0xf3, 0xa2, 0xcf, 0xa0, 0xa4, 0xfe, + 0xc8, 0x1a, 0xf3, 0xfa, 0xe9, 0x9f, 0x50, 0x64, 0x19, 0x46, 0xc0, 0x95, 0x1f, 0xcc, 0x2e, 0x2c, + 0x00, 0xd7, 0x18, 0xe7, 0x11, 0x38, 0xf3, 0x4d, 0x5e, 0xa4, 0x04, 0xdc, 0x9f, 0x2d, 0xb8, 0x3c, + 0xf5, 0x21, 0x71, 0x2f, 0xc8, 0xd3, 0x51, 0x51, 0xc8, 0x35, 0xea, 0x40, 0x41, 0x75, 0x7e, 0x4e, + 0x1a, 0xec, 0x9d, 0xc3, 0x60, 0xcf, 0x68, 0x7b, 0x05, 0x76, 0xee, 0x01, 0x5c, 0xac, 0x58, 0xdd, + 0xdf, 0x2c, 0x58, 0xd6, 0x5d, 0xa6, 0x2f, 0xd1, 0x00, 0x56, 0xb3, 0x16, 0xca, 0xf6, 0xf4, 0x75, + 0x7a, 0x77, 0x6e, 0x83, 0x2a, 0x35, 0xef, 0x24, 0x4e, 0xd9, 0x38, 0x45, 0xe7, 0x6c, 0x65, 0x75, + 0x75, 0x42, 0x75, 0x21, 0xcb, 0xdf, 0x87, 0xe5, 0x5d, 0x1e, 0xf0, 0x94, 0xcd, 0xbd, 0x39, 0xdc, + 0x5f, 0x2d, 0x58, 0xc9, 0x74, 0xb4, 0x77, 0x1f, 0x41, 0xf9, 0x00, 0x53, 0x8e, 0x5f, 0x63, 0xa6, + 0xbd, 0xb2, 0xa7, 0xbd, 0xfa, 0x5a, 0x6a, 0xf8, 0x63, 0x4d, 0xb4, 0x09, 0x65, 0x26, 0x79, 0x70, + 0x96, 0xa8, 0xb5, 0x79, 0x28, 0xfd, 0xbd, 0xb1, 0x3e, 0x6a, 0xc2, 0x52, 0x44, 0x06, 0x4c, 0xf7, + 0xcc, 0xff, 0xe7, 0xe1, 0x9e, 0x90, 0x81, 0x2f, 0x15, 0xdd, 0xc3, 0x1c, 0x14, 0xd5, 0x1e, 0x7a, + 0x0c, 0xc5, 0x7e, 0x38, 0xc0, 0x8c, 0x2b, 0xaf, 0xda, 0x2d, 0x71, 0x4e, 0xbf, 0x3d, 0x5c, 0xbf, + 0x69, 0x1c, 0xc4, 0x24, 0xc1, 0xb1, 0x78, 0x91, 0x06, 0x61, 0x8c, 0x29, 0x6b, 0x0e, 0xc8, 0x6d, + 0x05, 0xf1, 0x3a, 0xf2, 0xc7, 0xd7, 0x0c, 0x82, 0x2b, 0x54, 0xc7, 0xad, 0x6c, 0xf9, 0x8b, 0x71, + 0x29, 0x06, 0x51, 0xc9, 0x71, 0x30, 0xc4, 0xfa, 0x7a, 0x95, 0x6b, 0x71, 0xc3, 0xf7, 0x44, 0xa9, + 0xf6, 0xe5, 0xbb, 0xa7, 0xec, 0x6b, 0x09, 0x6d, 0x42, 0x89, 0xf1, 0x80, 0x8a, 0x63, 0xa3, 0x70, + 0xce, 0xa7, 0x49, 0x06, 0x40, 0x9f, 0x43, 0xa5, 0x47, 0x86, 0x49, 0x84, 0x05, 0xba, 0x78, 0x4e, + 0xf4, 0x31, 0x44, 0x54, 0x0f, 0xa6, 0x94, 0x50, 0xf9, 0x28, 0xaa, 0xf8, 0x4a, 0x70, 0xff, 0xc9, + 0x41, 0xcd, 0x4c, 0xd6, 0xd4, 0x83, 0xef, 0x31, 0x14, 0x55, 0xea, 0x55, 0xd5, 0x5d, 0x2c, 0x54, + 0x8a, 0x61, 0x66, 0xa8, 0x6c, 0x28, 0xf5, 0x52, 0x2a, 0x5f, 0x83, 0xea, 0x8d, 0x98, 0x89, 0xc2, + 0x60, 0x4e, 0x78, 0x10, 0xc9, 0x50, 0xe5, 0x7d, 0x25, 0x88, 0x47, 0xe2, 0x78, 0x26, 0x58, 0xec, + 0x91, 0x38, 0x86, 0x99, 0x69, 0x28, 0xbd, 0x53, 0x1a, 0xca, 0x0b, 0xa7, 0xc1, 0xfd, 0xdd, 0x82, + 0xca, 0xb8, 0xca, 0x8d, 0xe8, 0x5a, 0xef, 0x1c, 0xdd, 0x89, 0xc8, 0xe4, 0x2e, 0x16, 0x99, 0x6b, + 0x50, 0x64, 0x9c, 0xe2, 0x60, 0xa8, 0xc6, 0x17, 0x5f, 0x4b, 0xe2, 0x3c, 0x19, 0xb2, 0x81, 0xcc, + 0x50, 0xcd, 0x17, 0x4b, 0xd7, 0x85, 0x9a, 0x9c, 0x54, 0x76, 0x30, 0x13, 0x6f, 0x63, 0x91, 0xdb, + 0x7e, 0xc0, 0x03, 0xe9, 0x47, 0xcd, 0x97, 0x6b, 0xf7, 0x16, 0xa0, 0x27, 0x21, 0xe3, 0x2f, 0xe4, + 0x84, 0xc5, 0xce, 0x1a, 0x63, 0x76, 0xe1, 0xca, 0x84, 0xb6, 0x3e, 0xa5, 0x3e, 0x3d, 0x31, 0xc8, + 0xdc, 0x98, 0x3e, 0x35, 0xe4, 0x20, 0xe7, 0x29, 0xe0, 0xe4, 0x3c, 0xd3, 0xfa, 0x3b, 0x0f, 0xa5, + 0x2d, 0x35, 0xa3, 0xa2, 0x67, 0x50, 0x19, 0xcf, 0x49, 0xc8, 0x9d, 0xa6, 0x39, 0x39, 0x70, 0x39, + 0xd7, 0x4f, 0xd5, 0xd1, 0xf6, 0x3d, 0x82, 0x82, 0x9c, 0x18, 0xd1, 0x8c, 0x63, 0xd0, 0x1c, 0x25, + 0x9d, 0xd3, 0x27, 0xb0, 0x0d, 0x4b, 0x30, 0xc9, 0x3b, 0x64, 0x16, 0x93, 0xf9, 0xfa, 0x73, 0xd6, + 0xcf, 0xb8, 0x7c, 0xd0, 0x0e, 0x14, 0x75, 0x3b, 0xcf, 0x52, 0x35, 0x6f, 0x0a, 0xa7, 0x3e, 0x5f, + 0x41, 0x91, 0x6d, 0x58, 0x68, 0x67, 0xfc, 0xa0, 0x9f, 0x65, 0x9a, 0x59, 0x06, 0xce, 0x19, 0xff, + 0x37, 0xac, 0x0d, 0x0b, 0xbd, 0x84, 0xaa, 0x91, 0x68, 0x34, 0x23, 0xa1, 0xd3, 0x55, 0xe3, 0x7c, + 0x70, 0x86, 0x96, 0x32, 0xb6, 0x5d, 0x7b, 0x73, 0xb4, 0x66, 0xfd, 0x71, 0xb4, 0x66, 0xfd, 0x75, + 0xb4, 0x66, 0x75, 0x8b, 0xb2, 0xee, 0x3f, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x65, 0x7c, + 0xd6, 0xa7, 0x10, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -1305,6 +1407,29 @@ type ControlServer interface { ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) } +// UnimplementedControlServer can be embedded to have forward compatible implementations. +type UnimplementedControlServer struct { +} + +func (*UnimplementedControlServer) DiskUsage(ctx context.Context, req *DiskUsageRequest) (*DiskUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DiskUsage not implemented") +} +func (*UnimplementedControlServer) Prune(req *PruneRequest, srv Control_PruneServer) error { + return status.Errorf(codes.Unimplemented, "method Prune not implemented") +} +func (*UnimplementedControlServer) Solve(ctx context.Context, req *SolveRequest) (*SolveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Solve not implemented") +} +func (*UnimplementedControlServer) Status(req *StatusRequest, srv Control_StatusServer) error { + return status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (*UnimplementedControlServer) Session(srv Control_SessionServer) error { + return status.Errorf(codes.Unimplemented, "method Session not implemented") +} +func (*UnimplementedControlServer) ListWorkers(ctx context.Context, req *ListWorkersRequest) (*ListWorkersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListWorkers not implemented") +} + func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) } @@ -1472,7 +1597,7 @@ var _Control_serviceDesc = grpc.ServiceDesc{ func (m *PruneRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1480,55 +1605,55 @@ func (m *PruneRequest) Marshal() (dAtA []byte, err error) { } func (m *PruneRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PruneRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Filter) > 0 { - for _, s := range m.Filter { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.KeepBytes != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.KeepBytes)) + i-- + dAtA[i] = 0x20 + } + if m.KeepDuration != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.KeepDuration)) + i-- + dAtA[i] = 0x18 } if m.All { - dAtA[i] = 0x10 - i++ + i-- if m.All { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.KeepDuration != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.KeepDuration)) + if len(m.Filter) > 0 { + for iNdEx := len(m.Filter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Filter[iNdEx]) + copy(dAtA[i:], m.Filter[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Filter[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - if m.KeepBytes != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.KeepBytes)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *DiskUsageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1536,35 +1661,35 @@ func (m *DiskUsageRequest) Marshal() (dAtA []byte, err error) { } func (m *DiskUsageRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DiskUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Filter) > 0 { - for _, s := range m.Filter { + for iNdEx := len(m.Filter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Filter[iNdEx]) + copy(dAtA[i:], m.Filter[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Filter[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *DiskUsageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1572,32 +1697,40 @@ func (m *DiskUsageResponse) Marshal() (dAtA []byte, err error) { } func (m *DiskUsageResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DiskUsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Record) > 0 { - for _, msg := range m.Record { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Record) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Record[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *UsageRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1605,102 +1738,112 @@ func (m *UsageRecord) Marshal() (dAtA []byte, err error) { } func (m *UsageRecord) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UsageRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.Mutable { - dAtA[i] = 0x10 - i++ - if m.Mutable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.InUse { - dAtA[i] = 0x18 - i++ - if m.InUse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Size_ != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Size_)) - } - if len(m.Parent) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Parent))) - i += copy(dAtA[i:], m.Parent) - } - dAtA[i] = 0x32 - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.LastUsedAt != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.LastUsedAt))) - n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.LastUsedAt, dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.UsageCount != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.UsageCount)) - } - if len(m.Description) > 0 { - dAtA[i] = 0x4a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) - } - if len(m.RecordType) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.RecordType))) - i += copy(dAtA[i:], m.RecordType) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Shared { - dAtA[i] = 0x58 - i++ + i-- if m.Shared { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x58 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.RecordType) > 0 { + i -= len(m.RecordType) + copy(dAtA[i:], m.RecordType) + i = encodeVarintControl(dAtA, i, uint64(len(m.RecordType))) + i-- + dAtA[i] = 0x52 } - return i, nil + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintControl(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x4a + } + if m.UsageCount != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.UsageCount)) + i-- + dAtA[i] = 0x40 + } + if m.LastUsedAt != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.LastUsedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.LastUsedAt):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintControl(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintControl(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + if len(m.Parent) > 0 { + i -= len(m.Parent) + copy(dAtA[i:], m.Parent) + i = encodeVarintControl(dAtA, i, uint64(len(m.Parent))) + i-- + dAtA[i] = 0x2a + } + if m.Size_ != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Size_)) + i-- + dAtA[i] = 0x20 + } + if m.InUse { + i-- + if m.InUse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Mutable { + i-- + if m.Mutable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SolveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1708,111 +1851,149 @@ func (m *SolveRequest) Marshal() (dAtA []byte, err error) { } func (m *SolveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Definition != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Definition.Size())) - n3, err := m.Definition.MarshalTo(dAtA[i:]) + if len(m.FrontendInputs) > 0 { + for k := range m.FrontendInputs { + v := m.FrontendInputs[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + if len(m.Entitlements) > 0 { + for iNdEx := len(m.Entitlements) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Entitlements[iNdEx]) + copy(dAtA[i:], m.Entitlements[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Entitlements[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + { + size, err := m.Cache.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n3 + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - if len(m.Exporter) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Exporter))) - i += copy(dAtA[i:], m.Exporter) - } - if len(m.ExporterAttrs) > 0 { - for k, _ := range m.ExporterAttrs { - dAtA[i] = 0x22 - i++ - v := m.ExporterAttrs[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + i-- + dAtA[i] = 0x42 + if len(m.FrontendAttrs) > 0 { + for k := range m.FrontendAttrs { + v := m.FrontendAttrs[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a } } - if len(m.Session) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Session))) - i += copy(dAtA[i:], m.Session) - } if len(m.Frontend) > 0 { - dAtA[i] = 0x32 - i++ + i -= len(m.Frontend) + copy(dAtA[i:], m.Frontend) i = encodeVarintControl(dAtA, i, uint64(len(m.Frontend))) - i += copy(dAtA[i:], m.Frontend) + i-- + dAtA[i] = 0x32 } - if len(m.FrontendAttrs) > 0 { - for k, _ := range m.FrontendAttrs { - dAtA[i] = 0x3a - i++ - v := m.FrontendAttrs[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.Session) > 0 { + i -= len(m.Session) + copy(dAtA[i:], m.Session) + i = encodeVarintControl(dAtA, i, uint64(len(m.Session))) + i-- + dAtA[i] = 0x2a + } + if len(m.ExporterAttrs) > 0 { + for k := range m.ExporterAttrs { + v := m.ExporterAttrs[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - dAtA[i] = 0x42 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Cache.Size())) - n4, err := m.Cache.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Exporter) > 0 { + i -= len(m.Exporter) + copy(dAtA[i:], m.Exporter) + i = encodeVarintControl(dAtA, i, uint64(len(m.Exporter))) + i-- + dAtA[i] = 0x1a } - i += n4 - if len(m.Entitlements) > 0 { - for _, s := range m.Entitlements { - dAtA[i] = 0x4a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.Definition != nil { + { + size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintControl(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CacheOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1820,82 +2001,89 @@ func (m *CacheOptions) Marshal() (dAtA []byte, err error) { } func (m *CacheOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CacheOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ExportRefDeprecated) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ExportRefDeprecated))) - i += copy(dAtA[i:], m.ExportRefDeprecated) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.ImportRefsDeprecated) > 0 { - for _, s := range m.ImportRefsDeprecated { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.Imports) > 0 { + for iNdEx := len(m.Imports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Imports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.ExportAttrsDeprecated) > 0 { - for k, _ := range m.ExportAttrsDeprecated { - dAtA[i] = 0x1a - i++ - v := m.ExportAttrsDeprecated[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x2a } } if len(m.Exports) > 0 { - for _, msg := range m.Exports { + for iNdEx := len(m.Exports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x22 - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Imports) > 0 { - for _, msg := range m.Imports { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.ExportAttrsDeprecated) > 0 { + for k := range m.ExportAttrsDeprecated { + v := m.ExportAttrsDeprecated[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintControl(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ImportRefsDeprecated) > 0 { + for iNdEx := len(m.ImportRefsDeprecated) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ImportRefsDeprecated[iNdEx]) + copy(dAtA[i:], m.ImportRefsDeprecated[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.ImportRefsDeprecated[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - return i, nil + if len(m.ExportRefDeprecated) > 0 { + i -= len(m.ExportRefDeprecated) + copy(dAtA[i:], m.ExportRefDeprecated) + i = encodeVarintControl(dAtA, i, uint64(len(m.ExportRefDeprecated))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *CacheOptionsEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1903,43 +2091,52 @@ func (m *CacheOptionsEntry) Marshal() (dAtA []byte, err error) { } func (m *CacheOptionsEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CacheOptionsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Type) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Attrs) > 0 { - for k, _ := range m.Attrs { - dAtA[i] = 0x12 - i++ + for k := range m.Attrs { v := m.Attrs[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintControl(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SolveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1947,37 +2144,45 @@ func (m *SolveResponse) Marshal() (dAtA []byte, err error) { } func (m *SolveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ExporterResponse) > 0 { - for k, _ := range m.ExporterResponse { - dAtA[i] = 0xa - i++ + for k := range m.ExporterResponse { v := m.ExporterResponse[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1985,26 +2190,33 @@ func (m *StatusRequest) Marshal() (dAtA []byte, err error) { } func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) - } if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintControl(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2012,56 +2224,68 @@ func (m *StatusResponse) Marshal() (dAtA []byte, err error) { } func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Vertexes) > 0 { - for _, msg := range m.Vertexes { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } if len(m.Statuses) > 0 { - for _, msg := range m.Statuses { + for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Logs) > 0 { - for _, msg := range m.Logs { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Vertexes) > 0 { + for iNdEx := len(m.Vertexes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Vertexes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *Vertex) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2069,83 +2293,86 @@ func (m *Vertex) Marshal() (dAtA []byte, err error) { } func (m *Vertex) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Vertex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Digest) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Digest))) - i += copy(dAtA[i:], m.Digest) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Inputs) > 0 { - for _, s := range m.Inputs { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintControl(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x3a + } + if m.Completed != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed):]) + if err6 != nil { + return 0, err6 } + i -= n6 + i = encodeVarintControl(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x32 } - if len(m.Name) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.Started != nil { + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Started, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Started):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintControl(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x2a } if m.Cached { - dAtA[i] = 0x20 - i++ + i-- if m.Cached { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.Started != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.Started))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Started, dAtA[i:]) - if err != nil { - return 0, err + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Inputs) > 0 { + for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Inputs[iNdEx]) + copy(dAtA[i:], m.Inputs[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Inputs[iNdEx]))) + i-- + dAtA[i] = 0x12 } - i += n5 } - if m.Completed != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 + if len(m.Digest) > 0 { + i -= len(m.Digest) + copy(dAtA[i:], m.Digest) + i = encodeVarintControl(dAtA, i, uint64(len(m.Digest))) + i-- + dAtA[i] = 0xa } - if len(m.Error) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Error))) - i += copy(dAtA[i:], m.Error) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VertexStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2153,76 +2380,85 @@ func (m *VertexStatus) Marshal() (dAtA []byte, err error) { } func (m *VertexStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VertexStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if len(m.Vertex) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Vertex))) - i += copy(dAtA[i:], m.Vertex) - } - if len(m.Name) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Current != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Current)) - } - if m.Total != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Total)) - } - dAtA[i] = 0x32 - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n7, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - if m.Started != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.Started))) - n8, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Started, dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Completed != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed))) - n9, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i:]) - if err != nil { - return 0, err + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Completed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Completed):]) + if err8 != nil { + return 0, err8 } - i += n9 + i -= n8 + i = encodeVarintControl(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x42 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Started != nil { + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Started, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Started):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintControl(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x3a } - return i, nil + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err10 != nil { + return 0, err10 + } + i -= n10 + i = encodeVarintControl(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x32 + if m.Total != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x28 + } + if m.Current != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Current)) + i-- + dAtA[i] = 0x20 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Vertex) > 0 { + i -= len(m.Vertex) + copy(dAtA[i:], m.Vertex) + i = encodeVarintControl(dAtA, i, uint64(len(m.Vertex))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *VertexLog) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2230,45 +2466,53 @@ func (m *VertexLog) Marshal() (dAtA []byte, err error) { } func (m *VertexLog) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VertexLog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Vertex) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Vertex))) - i += copy(dAtA[i:], m.Vertex) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n10, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - if m.Stream != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Stream)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Msg) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) i = encodeVarintControl(dAtA, i, uint64(len(m.Msg))) - i += copy(dAtA[i:], m.Msg) + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Stream != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Stream)) + i-- + dAtA[i] = 0x18 } - return i, nil + n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err11 != nil { + return 0, err11 + } + i -= n11 + i = encodeVarintControl(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0x12 + if len(m.Vertex) > 0 { + i -= len(m.Vertex) + copy(dAtA[i:], m.Vertex) + i = encodeVarintControl(dAtA, i, uint64(len(m.Vertex))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *BytesMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2276,26 +2520,33 @@ func (m *BytesMessage) Marshal() (dAtA []byte, err error) { } func (m *BytesMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BytesMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintControl(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ListWorkersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2303,35 +2554,35 @@ func (m *ListWorkersRequest) Marshal() (dAtA []byte, err error) { } func (m *ListWorkersRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListWorkersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Filter) > 0 { - for _, s := range m.Filter { + for iNdEx := len(m.Filter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Filter[iNdEx]) + copy(dAtA[i:], m.Filter[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Filter[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ListWorkersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2339,36 +2590,46 @@ func (m *ListWorkersResponse) Marshal() (dAtA []byte, err error) { } func (m *ListWorkersResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListWorkersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Record) > 0 { - for _, msg := range m.Record { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Record) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Record[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintControl(dAtA []byte, offset int, v uint64) int { + offset -= sovControl(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *PruneRequest) Size() (n int) { if m == nil { @@ -2532,6 +2793,19 @@ func (m *SolveRequest) Size() (n int) { n += 1 + l + sovControl(uint64(l)) } } + if len(m.FrontendInputs) > 0 { + for k, v := range m.FrontendInputs { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovControl(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + l + n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2829,14 +3103,7 @@ func (m *ListWorkersResponse) Size() (n int) { } func sovControl(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozControl(x uint64) (n int) { return sovControl(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2856,7 +3123,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2884,7 +3151,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2894,6 +3161,9 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2913,7 +3183,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2933,7 +3203,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.KeepDuration |= (int64(b) & 0x7F) << shift + m.KeepDuration |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -2952,7 +3222,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.KeepBytes |= (int64(b) & 0x7F) << shift + m.KeepBytes |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -2966,6 +3236,9 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2994,7 +3267,7 @@ func (m *DiskUsageRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3022,7 +3295,7 @@ func (m *DiskUsageRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3032,6 +3305,9 @@ func (m *DiskUsageRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3046,6 +3322,9 @@ func (m *DiskUsageRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3074,7 +3353,7 @@ func (m *DiskUsageResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3102,7 +3381,7 @@ func (m *DiskUsageResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3111,6 +3390,9 @@ func (m *DiskUsageResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3128,6 +3410,9 @@ func (m *DiskUsageResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3156,7 +3441,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3184,7 +3469,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3194,6 +3479,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3213,7 +3501,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3233,7 +3521,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3253,7 +3541,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size_ |= (int64(b) & 0x7F) << shift + m.Size_ |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -3272,7 +3560,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3282,6 +3570,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3301,7 +3592,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3310,6 +3601,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3331,7 +3625,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3340,6 +3634,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3364,7 +3661,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.UsageCount |= (int64(b) & 0x7F) << shift + m.UsageCount |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -3383,7 +3680,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3393,6 +3690,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3412,7 +3712,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3422,6 +3722,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3441,7 +3744,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3456,6 +3759,9 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3484,7 +3790,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3512,7 +3818,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3522,6 +3828,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3541,7 +3850,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3550,6 +3859,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3574,7 +3886,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3584,6 +3896,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3603,7 +3918,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3612,6 +3927,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3632,7 +3950,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3649,7 +3967,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3659,6 +3977,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -3675,7 +3996,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3685,6 +4006,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -3721,7 +4045,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3731,6 +4055,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3750,7 +4077,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3760,6 +4087,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3779,7 +4109,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3788,6 +4118,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3808,7 +4141,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3825,7 +4158,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3835,6 +4168,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -3851,7 +4187,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3861,6 +4197,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -3897,7 +4236,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3906,6 +4245,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3927,7 +4269,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3937,11 +4279,143 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } m.Entitlements = append(m.Entitlements, github_com_moby_buildkit_util_entitlements.Entitlement(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontendInputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrontendInputs == nil { + m.FrontendInputs = make(map[string]*pb.Definition) + } + var mapkey string + var mapvalue *pb.Definition + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + 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 ErrIntOverflowControl + } + 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 ErrInvalidLengthControl + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } + 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 ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthControl + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthControl + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &pb.Definition{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.FrontendInputs[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipControl(dAtA[iNdEx:]) @@ -3951,6 +4425,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3979,7 +4456,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4007,7 +4484,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4017,6 +4494,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4036,7 +4516,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4046,6 +4526,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4065,7 +4548,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4074,6 +4557,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4094,7 +4580,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4111,7 +4597,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4121,6 +4607,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -4137,7 +4626,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4147,6 +4636,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -4183,7 +4675,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4192,6 +4684,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4214,7 +4709,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4223,6 +4718,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4240,6 +4738,9 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4268,7 +4769,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4296,7 +4797,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4306,6 +4807,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4325,7 +4829,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4334,6 +4838,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4354,7 +4861,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4371,7 +4878,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4381,6 +4888,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -4397,7 +4907,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4407,6 +4917,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -4438,6 +4951,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4466,7 +4982,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4494,7 +5010,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4503,6 +5019,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4523,7 +5042,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4540,7 +5059,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4550,6 +5069,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -4566,7 +5088,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4576,6 +5098,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthControl + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -4607,6 +5132,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4635,7 +5163,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4663,7 +5191,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4673,6 +5201,9 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4687,6 +5218,9 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4715,7 +5249,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4743,7 +5277,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4752,6 +5286,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4774,7 +5311,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4783,6 +5320,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4805,7 +5345,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4814,6 +5354,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4831,6 +5374,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4859,7 +5405,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4887,7 +5433,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4897,6 +5443,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4916,7 +5465,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4926,6 +5475,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4945,7 +5497,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4955,6 +5507,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4974,7 +5529,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4994,7 +5549,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5003,6 +5558,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5027,7 +5585,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5036,6 +5594,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5060,7 +5621,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5070,6 +5631,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5084,6 +5648,9 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5112,7 +5679,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5140,7 +5707,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5150,6 +5717,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5169,7 +5739,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5179,6 +5749,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5198,7 +5771,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5208,6 +5781,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5227,7 +5803,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Current |= (int64(b) & 0x7F) << shift + m.Current |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -5246,7 +5822,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= (int64(b) & 0x7F) << shift + m.Total |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -5265,7 +5841,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5274,6 +5850,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5295,7 +5874,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5304,6 +5883,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5328,7 +5910,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5337,6 +5919,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5356,6 +5941,9 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5384,7 +5972,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5412,7 +6000,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5422,6 +6010,9 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5441,7 +6032,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5450,6 +6041,9 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5471,7 +6065,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Stream |= (int64(b) & 0x7F) << shift + m.Stream |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -5490,7 +6084,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5499,6 +6093,9 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5516,6 +6113,9 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5544,7 +6144,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5572,7 +6172,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5581,6 +6181,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5598,6 +6201,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5626,7 +6232,7 @@ func (m *ListWorkersRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5654,7 +6260,7 @@ func (m *ListWorkersRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5664,6 +6270,9 @@ func (m *ListWorkersRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5678,6 +6287,9 @@ func (m *ListWorkersRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5706,7 +6318,7 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5734,7 +6346,7 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5743,6 +6355,9 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthControl } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5760,6 +6375,9 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthControl } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthControl + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5776,6 +6394,7 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { func skipControl(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -5807,10 +6426,8 @@ func skipControl(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -5827,144 +6444,34 @@ func skipControl(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthControl } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowControl - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipControl(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupControl + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthControl + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupControl = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("control.proto", fileDescriptor_control_86d7f5d7b8f10de2) } - -var fileDescriptor_control_86d7f5d7b8f10de2 = []byte{ - // 1359 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4b, 0x6f, 0x1b, 0xb7, - 0x16, 0xce, 0x48, 0xd6, 0xeb, 0x48, 0x0e, 0x1c, 0x26, 0x37, 0x18, 0xcc, 0xc5, 0xb5, 0x75, 0x27, - 0x2d, 0x20, 0x04, 0xc9, 0xc8, 0x71, 0x9b, 0x22, 0x35, 0xda, 0x22, 0x91, 0x95, 0x22, 0x0e, 0x62, - 0x34, 0xa0, 0x93, 0x06, 0xe8, 0xa2, 0xc0, 0x48, 0xa2, 0x95, 0x81, 0x47, 0xc3, 0x29, 0xc9, 0x71, - 0xa3, 0xfe, 0x80, 0xae, 0xfb, 0x2f, 0xba, 0xea, 0xaa, 0x8b, 0xfe, 0x82, 0x02, 0x59, 0x76, 0x9d, - 0x85, 0x5b, 0x64, 0xdf, 0xae, 0xba, 0xe9, 0xae, 0xe0, 0x63, 0x64, 0xca, 0x92, 0xfc, 0xca, 0x6a, - 0x78, 0x38, 0xe7, 0xfb, 0x78, 0x5e, 0x24, 0x0f, 0x61, 0xb9, 0x4f, 0x13, 0xc1, 0x68, 0x1c, 0xa4, - 0x8c, 0x0a, 0x8a, 0x56, 0x46, 0xb4, 0x37, 0x0e, 0x7a, 0x59, 0x14, 0x0f, 0xf6, 0x23, 0x11, 0x1c, - 0xdc, 0xf1, 0x6e, 0x0f, 0x23, 0xf1, 0x32, 0xeb, 0x05, 0x7d, 0x3a, 0x6a, 0x0f, 0xe9, 0x90, 0xb6, - 0x95, 0x62, 0x2f, 0xdb, 0x53, 0x92, 0x12, 0xd4, 0x48, 0x13, 0x78, 0x6b, 0x43, 0x4a, 0x87, 0x31, - 0x39, 0xd2, 0x12, 0xd1, 0x88, 0x70, 0x11, 0x8e, 0x52, 0xa3, 0x70, 0xcb, 0xe2, 0x93, 0x8b, 0xb5, - 0xf3, 0xc5, 0xda, 0x9c, 0xc6, 0x07, 0x84, 0xb5, 0xd3, 0x5e, 0x9b, 0xa6, 0xdc, 0x68, 0xb7, 0x17, - 0x6a, 0x87, 0x69, 0xd4, 0x16, 0xe3, 0x94, 0xf0, 0xf6, 0xb7, 0x94, 0xed, 0x13, 0xa6, 0x01, 0xfe, - 0xf7, 0x0e, 0x34, 0x9e, 0xb2, 0x2c, 0x21, 0x98, 0x7c, 0x93, 0x11, 0x2e, 0xd0, 0x75, 0x28, 0xef, - 0x45, 0xb1, 0x20, 0xcc, 0x75, 0x9a, 0xc5, 0x56, 0x0d, 0x1b, 0x09, 0xad, 0x40, 0x31, 0x8c, 0x63, - 0xb7, 0xd0, 0x74, 0x5a, 0x55, 0x2c, 0x87, 0xa8, 0x05, 0x8d, 0x7d, 0x42, 0xd2, 0x6e, 0xc6, 0x42, - 0x11, 0xd1, 0xc4, 0x2d, 0x36, 0x9d, 0x56, 0xb1, 0xb3, 0xf4, 0xfa, 0x70, 0xcd, 0xc1, 0x53, 0x7f, - 0x90, 0x0f, 0x35, 0x29, 0x77, 0xc6, 0x82, 0x70, 0x77, 0xc9, 0x52, 0x3b, 0x9a, 0xf6, 0x6f, 0xc2, - 0x4a, 0x37, 0xe2, 0xfb, 0xcf, 0x79, 0x38, 0x3c, 0xcd, 0x16, 0xff, 0x31, 0x5c, 0xb1, 0x74, 0x79, - 0x4a, 0x13, 0x4e, 0xd0, 0x5d, 0x28, 0x33, 0xd2, 0xa7, 0x6c, 0xa0, 0x94, 0xeb, 0x1b, 0xff, 0x0b, - 0x8e, 0xe7, 0x26, 0x30, 0x00, 0xa9, 0x84, 0x8d, 0xb2, 0xff, 0x4f, 0x01, 0xea, 0xd6, 0x3c, 0xba, - 0x0c, 0x85, 0xed, 0xae, 0xeb, 0x34, 0x9d, 0x56, 0x0d, 0x17, 0xb6, 0xbb, 0xc8, 0x85, 0xca, 0x4e, - 0x26, 0xc2, 0x5e, 0x4c, 0x8c, 0xef, 0xb9, 0x88, 0xae, 0x41, 0x69, 0x3b, 0x79, 0xce, 0x89, 0x72, - 0xbc, 0x8a, 0xb5, 0x80, 0x10, 0x2c, 0xed, 0x46, 0xdf, 0x11, 0xed, 0x26, 0x56, 0x63, 0xe9, 0xc7, - 0xd3, 0x90, 0x91, 0x44, 0xb8, 0x25, 0xc5, 0x6b, 0x24, 0xd4, 0x81, 0xda, 0x16, 0x23, 0xa1, 0x20, - 0x83, 0x07, 0xc2, 0x2d, 0x37, 0x9d, 0x56, 0x7d, 0xc3, 0x0b, 0x74, 0x41, 0x04, 0x79, 0x41, 0x04, - 0xcf, 0xf2, 0x82, 0xe8, 0x54, 0x5f, 0x1f, 0xae, 0x5d, 0xfa, 0xe1, 0x77, 0x19, 0xb7, 0x09, 0x0c, - 0xdd, 0x07, 0x78, 0x12, 0x72, 0xf1, 0x9c, 0x2b, 0x92, 0xca, 0xa9, 0x24, 0x4b, 0x8a, 0xc0, 0xc2, - 0xa0, 0x55, 0x00, 0x15, 0x80, 0x2d, 0x9a, 0x25, 0xc2, 0xad, 0x2a, 0xbb, 0xad, 0x19, 0xd4, 0x84, - 0x7a, 0x97, 0xf0, 0x3e, 0x8b, 0x52, 0x95, 0xe6, 0x9a, 0x72, 0xc1, 0x9e, 0x92, 0x0c, 0x3a, 0x7a, - 0xcf, 0xc6, 0x29, 0x71, 0x41, 0x29, 0x58, 0x33, 0xd2, 0xff, 0xdd, 0x97, 0x21, 0x23, 0x03, 0xb7, - 0xae, 0x42, 0x65, 0x24, 0xff, 0xef, 0x25, 0x68, 0xec, 0xca, 0x2a, 0xce, 0x13, 0xbe, 0x02, 0x45, - 0x4c, 0xf6, 0x4c, 0xf4, 0xe5, 0x10, 0x05, 0x00, 0x5d, 0xb2, 0x17, 0x25, 0x91, 0x5a, 0xbb, 0xa0, - 0xdc, 0xbb, 0x1c, 0xa4, 0xbd, 0xe0, 0x68, 0x16, 0x5b, 0x1a, 0xc8, 0x83, 0xea, 0xc3, 0x57, 0x29, - 0x65, 0xb2, 0x68, 0x8a, 0x8a, 0x66, 0x22, 0xa3, 0x17, 0xb0, 0x9c, 0x8f, 0x1f, 0x08, 0xc1, 0x64, - 0x29, 0xca, 0x42, 0xb9, 0x33, 0x5b, 0x28, 0xb6, 0x51, 0xc1, 0x14, 0xe6, 0x61, 0x22, 0xd8, 0x18, - 0x4f, 0xf3, 0xc8, 0x1a, 0xd9, 0x25, 0x9c, 0x4b, 0x0b, 0x75, 0x82, 0x73, 0x51, 0x9a, 0xf3, 0x39, - 0xa3, 0x89, 0x20, 0xc9, 0x40, 0x25, 0xb8, 0x86, 0x27, 0xb2, 0x34, 0x27, 0x1f, 0x6b, 0x73, 0x2a, - 0x67, 0x32, 0x67, 0x0a, 0x63, 0xcc, 0x99, 0x9a, 0x43, 0x9b, 0x50, 0xda, 0x0a, 0xfb, 0x2f, 0x89, - 0xca, 0x65, 0x7d, 0x63, 0x75, 0x96, 0x50, 0xfd, 0xfe, 0x42, 0x25, 0x8f, 0xab, 0xad, 0x78, 0x09, - 0x6b, 0x08, 0xfa, 0x1a, 0x1a, 0x0f, 0x13, 0x11, 0x89, 0x98, 0x8c, 0x48, 0x22, 0xb8, 0x5b, 0x93, - 0x1b, 0xaf, 0xb3, 0xf9, 0xe6, 0x70, 0xed, 0xa3, 0x85, 0x47, 0x4b, 0x26, 0xa2, 0xb8, 0x4d, 0x2c, - 0x54, 0x60, 0x51, 0xe0, 0x29, 0x3e, 0xef, 0x3e, 0xa0, 0xd9, 0x78, 0xca, 0xbc, 0xef, 0x93, 0x71, - 0x9e, 0xf7, 0x7d, 0x32, 0x96, 0x9b, 0xeb, 0x20, 0x8c, 0x33, 0xbd, 0xe9, 0x6a, 0x58, 0x0b, 0x9b, - 0x85, 0x7b, 0x8e, 0x64, 0x98, 0x0d, 0xc1, 0x79, 0x18, 0xfc, 0x9f, 0x8a, 0xd0, 0xb0, 0x23, 0x80, - 0xd6, 0xe1, 0xaa, 0x36, 0x0a, 0x93, 0xbd, 0x2e, 0x49, 0x19, 0xe9, 0xcb, 0xcd, 0x65, 0xc8, 0xe6, - 0xfd, 0x42, 0x1b, 0x70, 0x6d, 0x7b, 0x64, 0xa6, 0xb9, 0x05, 0x29, 0xa8, 0x73, 0x6a, 0xee, 0x3f, - 0x44, 0xe1, 0x3f, 0x9a, 0x4a, 0x99, 0x6d, 0x81, 0x8a, 0x2a, 0xef, 0x1f, 0x9f, 0x9c, 0xa6, 0x60, - 0x2e, 0x56, 0xe7, 0x7f, 0x3e, 0x2f, 0xfa, 0x14, 0x2a, 0xfa, 0x47, 0x5e, 0xe9, 0x37, 0x4e, 0x5e, - 0x42, 0x93, 0xe5, 0x18, 0x09, 0xd7, 0x7e, 0x70, 0xb7, 0x74, 0x0e, 0xb8, 0xc1, 0x78, 0x8f, 0xc0, - 0x5b, 0x6c, 0xf2, 0xb9, 0xf2, 0xf5, 0xa3, 0x03, 0x57, 0x66, 0x16, 0x92, 0x07, 0xad, 0x3a, 0x6e, - 0x34, 0x85, 0x1a, 0xa3, 0x2e, 0x94, 0xf4, 0x56, 0x2a, 0x28, 0x83, 0x83, 0x33, 0x18, 0x1c, 0x58, - 0xfb, 0x48, 0x83, 0xbd, 0x7b, 0x00, 0x17, 0xac, 0xac, 0x5f, 0x1c, 0x58, 0x36, 0x9b, 0xd5, 0xdc, - 0x4a, 0x21, 0xac, 0xe4, 0xf5, 0x9e, 0xcf, 0x99, 0xfb, 0xe9, 0xee, 0xc2, 0x7d, 0xae, 0xd5, 0x82, - 0xe3, 0x38, 0x6d, 0xe3, 0x0c, 0x9d, 0xb7, 0x95, 0xd7, 0xd5, 0x31, 0xd5, 0x73, 0x59, 0xfe, 0x7f, - 0x58, 0xde, 0x15, 0xa1, 0xc8, 0xf8, 0xc2, 0xa3, 0xd8, 0xff, 0xd9, 0x81, 0xcb, 0xb9, 0x8e, 0xf1, - 0xee, 0x43, 0xa8, 0x1e, 0x10, 0x26, 0xc8, 0x2b, 0xc2, 0x8d, 0x57, 0xee, 0xac, 0x57, 0x5f, 0x2a, - 0x0d, 0x3c, 0xd1, 0x44, 0x9b, 0x50, 0xe5, 0x8a, 0x87, 0xe4, 0x89, 0x5a, 0x5d, 0x84, 0x32, 0xeb, - 0x4d, 0xf4, 0x51, 0x1b, 0x96, 0x62, 0x3a, 0xe4, 0x66, 0xcf, 0xfc, 0x77, 0x11, 0xee, 0x09, 0x1d, - 0x62, 0xa5, 0xe8, 0x1f, 0x16, 0xa0, 0xac, 0xe7, 0xd0, 0x63, 0x28, 0x0f, 0xa2, 0x21, 0xe1, 0x42, - 0x7b, 0xd5, 0xd9, 0x90, 0x07, 0xdf, 0x9b, 0xc3, 0xb5, 0x9b, 0xd6, 0xc9, 0x46, 0x53, 0x92, 0xc8, - 0x16, 0x2f, 0x8c, 0x12, 0xc2, 0x78, 0x7b, 0x48, 0x6f, 0x6b, 0x48, 0xd0, 0x55, 0x1f, 0x6c, 0x18, - 0x24, 0x57, 0x94, 0xa4, 0x99, 0xd0, 0x1e, 0x5c, 0x90, 0x4b, 0x33, 0xc8, 0x4a, 0x4e, 0xc2, 0x11, - 0x31, 0xf7, 0x95, 0x1a, 0xcb, 0x2b, 0xb3, 0x2f, 0x4b, 0x75, 0xa0, 0x1a, 0x89, 0x2a, 0x36, 0x12, - 0xda, 0x84, 0x0a, 0x17, 0x21, 0x93, 0xc7, 0x46, 0xe9, 0x8c, 0x77, 0x7d, 0x0e, 0x40, 0x9f, 0x41, - 0xad, 0x4f, 0x47, 0x69, 0x4c, 0x24, 0xba, 0x7c, 0x46, 0xf4, 0x11, 0x44, 0x56, 0x0f, 0x61, 0x8c, - 0x32, 0xd5, 0x65, 0xd4, 0xb0, 0x16, 0xfc, 0xbf, 0x0a, 0xd0, 0xb0, 0x93, 0x35, 0xd3, 0x41, 0x3d, - 0x86, 0xb2, 0x4e, 0xbd, 0xae, 0xba, 0x8b, 0x85, 0x4a, 0x33, 0xcc, 0x0d, 0x95, 0x0b, 0x95, 0x7e, - 0xc6, 0x54, 0x7b, 0xa5, 0x9b, 0xae, 0x5c, 0x94, 0x06, 0x0b, 0x2a, 0xc2, 0x58, 0x85, 0xaa, 0x88, - 0xb5, 0x20, 0xbb, 0xae, 0x49, 0x93, 0x7d, 0xbe, 0xae, 0x6b, 0x02, 0xb3, 0xd3, 0x50, 0x79, 0xa7, - 0x34, 0x54, 0xcf, 0x9d, 0x06, 0xff, 0x57, 0x07, 0x6a, 0x93, 0x2a, 0xb7, 0xa2, 0xeb, 0xbc, 0x73, - 0x74, 0xa7, 0x22, 0x53, 0xb8, 0x58, 0x64, 0xae, 0x43, 0x99, 0x0b, 0x46, 0xc2, 0x91, 0x7e, 0x0f, - 0x60, 0x23, 0xc9, 0xf3, 0x64, 0xc4, 0x87, 0x2a, 0x43, 0x0d, 0x2c, 0x87, 0xbe, 0x0f, 0x0d, 0xd5, - 0xfa, 0xef, 0x10, 0x2e, 0x9b, 0x4d, 0x99, 0xdb, 0x41, 0x28, 0x42, 0xe5, 0x47, 0x03, 0xab, 0xb1, - 0x7f, 0x0b, 0xd0, 0x93, 0x88, 0x8b, 0x17, 0xea, 0xc9, 0xc2, 0x4f, 0x7b, 0x17, 0xec, 0xc2, 0xd5, - 0x29, 0x6d, 0x73, 0x4a, 0x7d, 0x72, 0xec, 0x65, 0xf0, 0xde, 0xec, 0xa9, 0xa1, 0x5e, 0x46, 0x81, - 0x06, 0x4e, 0x3f, 0x10, 0x36, 0xfe, 0x2c, 0x42, 0x65, 0x4b, 0x3f, 0xfa, 0xd0, 0x33, 0xa8, 0x4d, - 0x1e, 0x1e, 0xc8, 0x9f, 0xa5, 0x39, 0xfe, 0x82, 0xf1, 0x6e, 0x9c, 0xa8, 0x63, 0xec, 0x7b, 0x04, - 0x25, 0xf5, 0x04, 0x43, 0x73, 0x8e, 0x41, 0xfb, 0x6d, 0xe6, 0x9d, 0xfc, 0xa4, 0x59, 0x77, 0x24, - 0x93, 0xba, 0x43, 0xe6, 0x31, 0xd9, 0x4d, 0xa4, 0xb7, 0x76, 0xca, 0xe5, 0x83, 0x76, 0xa0, 0x6c, - 0xb6, 0xf3, 0x3c, 0x55, 0xfb, 0xa6, 0xf0, 0x9a, 0x8b, 0x15, 0x34, 0xd9, 0xba, 0x83, 0x76, 0x26, - 0x1d, 0xf2, 0x3c, 0xd3, 0xec, 0x32, 0xf0, 0x4e, 0xf9, 0xdf, 0x72, 0xd6, 0x1d, 0xf4, 0x15, 0xd4, - 0xad, 0x44, 0xa3, 0x39, 0x09, 0x9d, 0xad, 0x1a, 0xef, 0xfd, 0x53, 0xb4, 0xb4, 0xb1, 0x9d, 0xc6, - 0xeb, 0xb7, 0xab, 0xce, 0x6f, 0x6f, 0x57, 0x9d, 0x3f, 0xde, 0xae, 0x3a, 0xbd, 0xb2, 0xaa, 0xfb, - 0x0f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x7a, 0xbe, 0x54, 0xf8, 0x0f, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/api/services/control/control.proto b/vendor/github.com/moby/buildkit/api/services/control/control.proto index 350576bc0e..fe10b6ac0d 100644 --- a/vendor/github.com/moby/buildkit/api/services/control/control.proto +++ b/vendor/github.com/moby/buildkit/api/services/control/control.proto @@ -63,6 +63,7 @@ message SolveRequest { map FrontendAttrs = 7; CacheOptions Cache = 8 [(gogoproto.nullable) = false]; repeated string Entitlements = 9 [(gogoproto.customtype) = "github.com/moby/buildkit/util/entitlements.Entitlement" ]; + map FrontendInputs = 10; } message CacheOptions { diff --git a/vendor/github.com/moby/buildkit/api/types/worker.pb.go b/vendor/github.com/moby/buildkit/api/types/worker.pb.go index 318c243f4b..728cccf759 100644 --- a/vendor/github.com/moby/buildkit/api/types/worker.pb.go +++ b/vendor/github.com/moby/buildkit/api/types/worker.pb.go @@ -3,13 +3,15 @@ package moby_buildkit_v1_types -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" -import pb "github.com/moby/buildkit/solver/pb" - -import io "io" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + pb "github.com/moby/buildkit/solver/pb" + io "io" + math "math" + math_bits "math/bits" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -20,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type WorkerRecord struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -36,7 +38,7 @@ func (m *WorkerRecord) Reset() { *m = WorkerRecord{} } func (m *WorkerRecord) String() string { return proto.CompactTextString(m) } func (*WorkerRecord) ProtoMessage() {} func (*WorkerRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_worker_1d0a62be5114ecbf, []int{0} + return fileDescriptor_e4ff6184b07e587a, []int{0} } func (m *WorkerRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -46,15 +48,15 @@ func (m *WorkerRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WorkerRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *WorkerRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkerRecord.Merge(dst, src) +func (m *WorkerRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkerRecord.Merge(m, src) } func (m *WorkerRecord) XXX_Size() int { return m.Size() @@ -107,7 +109,7 @@ func (m *GCPolicy) Reset() { *m = GCPolicy{} } func (m *GCPolicy) String() string { return proto.CompactTextString(m) } func (*GCPolicy) ProtoMessage() {} func (*GCPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_worker_1d0a62be5114ecbf, []int{1} + return fileDescriptor_e4ff6184b07e587a, []int{1} } func (m *GCPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,15 +119,15 @@ func (m *GCPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GCPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *GCPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_GCPolicy.Merge(dst, src) +func (m *GCPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_GCPolicy.Merge(m, src) } func (m *GCPolicy) XXX_Size() int { return m.Size() @@ -169,10 +171,40 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.types.WorkerRecord.LabelsEntry") proto.RegisterType((*GCPolicy)(nil), "moby.buildkit.v1.types.GCPolicy") } + +func init() { proto.RegisterFile("worker.proto", fileDescriptor_e4ff6184b07e587a) } + +var fileDescriptor_e4ff6184b07e587a = []byte{ + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4e, 0xea, 0x40, + 0x14, 0x86, 0x6f, 0x5b, 0x2e, 0x97, 0x0e, 0xcd, 0x8d, 0x99, 0x18, 0xd3, 0x10, 0x83, 0x84, 0x15, + 0x0b, 0x9d, 0xa2, 0x6e, 0xd4, 0xb8, 0x42, 0x8c, 0x92, 0xb8, 0x20, 0xb3, 0x71, 0xdd, 0x81, 0x01, + 0x9b, 0x0e, 0x9c, 0xc9, 0x74, 0x8a, 0xf6, 0x39, 0x7c, 0x29, 0x96, 0x3e, 0x81, 0x31, 0x3c, 0x89, + 0x99, 0x29, 0x08, 0x26, 0xba, 0x3b, 0xff, 0x9f, 0xff, 0xfb, 0xe7, 0x9c, 0x0c, 0x0a, 0x9e, 0x41, + 0xa5, 0x5c, 0x11, 0xa9, 0x40, 0x03, 0x3e, 0x98, 0x01, 0x2b, 0x08, 0xcb, 0x13, 0x31, 0x4e, 0x13, + 0x4d, 0x16, 0xa7, 0x44, 0x17, 0x92, 0x67, 0x8d, 0x93, 0x69, 0xa2, 0x9f, 0x72, 0x46, 0x46, 0x30, + 0x8b, 0xa6, 0x30, 0x85, 0xc8, 0xc6, 0x59, 0x3e, 0xb1, 0xca, 0x0a, 0x3b, 0x95, 0x35, 0x8d, 0xe3, + 0x9d, 0xb8, 0x69, 0x8c, 0x36, 0x8d, 0x51, 0x06, 0x62, 0xc1, 0x55, 0x24, 0x59, 0x04, 0x32, 0x2b, + 0xd3, 0xed, 0x57, 0x17, 0x05, 0x8f, 0x76, 0x0b, 0xca, 0x47, 0xa0, 0xc6, 0xf8, 0x3f, 0x72, 0x07, + 0xfd, 0xd0, 0x69, 0x39, 0x1d, 0x9f, 0xba, 0x83, 0x3e, 0xbe, 0x47, 0xd5, 0x87, 0x98, 0x71, 0x91, + 0x85, 0x6e, 0xcb, 0xeb, 0xd4, 0xcf, 0xba, 0xe4, 0xe7, 0x35, 0xc9, 0x6e, 0x0b, 0x29, 0x91, 0xdb, + 0xb9, 0x56, 0x05, 0x5d, 0xf3, 0xb8, 0x8b, 0x7c, 0x29, 0x62, 0x3d, 0x01, 0x35, 0xcb, 0x42, 0xcf, + 0x96, 0x05, 0x44, 0x32, 0x32, 0x5c, 0x9b, 0xbd, 0xca, 0xf2, 0xfd, 0xe8, 0x0f, 0xdd, 0x86, 0xf0, + 0x35, 0xaa, 0xdd, 0xdd, 0x0c, 0x41, 0x24, 0xa3, 0x22, 0xac, 0x58, 0xa0, 0xf5, 0xdb, 0xeb, 0x9b, + 0x1c, 0xfd, 0x22, 0x1a, 0x97, 0xa8, 0xbe, 0xb3, 0x06, 0xde, 0x43, 0x5e, 0xca, 0x8b, 0xf5, 0x65, + 0x66, 0xc4, 0xfb, 0xe8, 0xef, 0x22, 0x16, 0x39, 0x0f, 0x5d, 0xeb, 0x95, 0xe2, 0xca, 0xbd, 0x70, + 0xda, 0x2f, 0xdb, 0x87, 0x0d, 0x17, 0x0b, 0x61, 0xb9, 0x1a, 0x35, 0x23, 0x6e, 0xa3, 0x20, 0xe5, + 0x5c, 0xf6, 0x73, 0x15, 0xeb, 0x04, 0xe6, 0x16, 0xf7, 0xe8, 0x37, 0x0f, 0x1f, 0x22, 0xdf, 0xe8, + 0x5e, 0xa1, 0xb9, 0x39, 0xd6, 0x04, 0xb6, 0x06, 0x0e, 0xd1, 0xbf, 0x49, 0x22, 0x34, 0x57, 0x99, + 0xbd, 0xcb, 0xa7, 0x1b, 0xd9, 0x0b, 0x96, 0xab, 0xa6, 0xf3, 0xb6, 0x6a, 0x3a, 0x1f, 0xab, 0xa6, + 0xc3, 0xaa, 0xf6, 0x93, 0xce, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x79, 0x52, 0x6a, 0x29, + 0x02, 0x00, 0x00, +} + func (m *WorkerRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -180,67 +212,80 @@ func (m *WorkerRecord) Marshal() (dAtA []byte, err error) { } func (m *WorkerRecord) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkerRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWorker(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovWorker(uint64(len(k))) + 1 + len(v) + sovWorker(uint64(len(v))) - i = encodeVarintWorker(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintWorker(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintWorker(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if len(m.GCPolicy) > 0 { + for iNdEx := len(m.GCPolicy) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GCPolicy[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWorker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } if len(m.Platforms) > 0 { - for _, msg := range m.Platforms { + for iNdEx := len(m.Platforms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Platforms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWorker(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintWorker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.GCPolicy) > 0 { - for _, msg := range m.GCPolicy { - dAtA[i] = 0x22 - i++ - i = encodeVarintWorker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintWorker(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintWorker(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintWorker(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintWorker(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GCPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -248,59 +293,61 @@ func (m *GCPolicy) Marshal() (dAtA []byte, err error) { } func (m *GCPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GCPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Filters) > 0 { + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Filters[iNdEx]) + copy(dAtA[i:], m.Filters[iNdEx]) + i = encodeVarintWorker(dAtA, i, uint64(len(m.Filters[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.KeepBytes != 0 { + i = encodeVarintWorker(dAtA, i, uint64(m.KeepBytes)) + i-- + dAtA[i] = 0x18 + } + if m.KeepDuration != 0 { + i = encodeVarintWorker(dAtA, i, uint64(m.KeepDuration)) + i-- + dAtA[i] = 0x10 + } if m.All { - dAtA[i] = 0x8 - i++ + i-- if m.All { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if m.KeepDuration != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintWorker(dAtA, i, uint64(m.KeepDuration)) - } - if m.KeepBytes != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintWorker(dAtA, i, uint64(m.KeepBytes)) - } - if len(m.Filters) > 0 { - for _, s := range m.Filters { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintWorker(dAtA []byte, offset int, v uint64) int { + offset -= sovWorker(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *WorkerRecord) Size() (n int) { if m == nil { @@ -366,14 +413,7 @@ func (m *GCPolicy) Size() (n int) { } func sovWorker(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozWorker(x uint64) (n int) { return sovWorker(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -393,7 +433,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -421,7 +461,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -431,6 +471,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorker + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -450,7 +493,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -459,6 +502,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorker + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -479,7 +525,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -496,7 +542,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -506,6 +552,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthWorker + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -522,7 +571,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -532,6 +581,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthWorker + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -568,7 +620,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -577,6 +629,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorker + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -599,7 +654,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -608,6 +663,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorker + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -625,6 +683,9 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthWorker } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthWorker + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -653,7 +714,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -681,7 +742,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -701,7 +762,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.KeepDuration |= (int64(b) & 0x7F) << shift + m.KeepDuration |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -720,7 +781,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.KeepBytes |= (int64(b) & 0x7F) << shift + m.KeepBytes |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -739,7 +800,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -749,6 +810,9 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthWorker } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorker + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -763,6 +827,9 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthWorker } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthWorker + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -779,6 +846,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { func skipWorker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -810,10 +878,8 @@ func skipWorker(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -830,82 +896,34 @@ func skipWorker(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthWorker } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWorker - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipWorker(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupWorker + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthWorker + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthWorker = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWorker = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthWorker = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowWorker = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupWorker = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("worker.proto", fileDescriptor_worker_1d0a62be5114ecbf) } - -var fileDescriptor_worker_1d0a62be5114ecbf = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4e, 0xea, 0x40, - 0x14, 0x86, 0x6f, 0x5b, 0x2e, 0x97, 0x0e, 0xcd, 0x8d, 0x99, 0x18, 0xd3, 0x10, 0x83, 0x84, 0x15, - 0x0b, 0x9d, 0xa2, 0x6e, 0xd4, 0xb8, 0x42, 0x8c, 0x92, 0xb8, 0x20, 0xb3, 0x71, 0xdd, 0x81, 0x01, - 0x9b, 0x0e, 0x9c, 0xc9, 0x74, 0x8a, 0xf6, 0x39, 0x7c, 0x29, 0x96, 0x3e, 0x81, 0x31, 0x3c, 0x89, - 0x99, 0x29, 0x08, 0x26, 0xba, 0x3b, 0xff, 0x9f, 0xff, 0xfb, 0xe7, 0x9c, 0x0c, 0x0a, 0x9e, 0x41, - 0xa5, 0x5c, 0x11, 0xa9, 0x40, 0x03, 0x3e, 0x98, 0x01, 0x2b, 0x08, 0xcb, 0x13, 0x31, 0x4e, 0x13, - 0x4d, 0x16, 0xa7, 0x44, 0x17, 0x92, 0x67, 0x8d, 0x93, 0x69, 0xa2, 0x9f, 0x72, 0x46, 0x46, 0x30, - 0x8b, 0xa6, 0x30, 0x85, 0xc8, 0xc6, 0x59, 0x3e, 0xb1, 0xca, 0x0a, 0x3b, 0x95, 0x35, 0x8d, 0xe3, - 0x9d, 0xb8, 0x69, 0x8c, 0x36, 0x8d, 0x51, 0x06, 0x62, 0xc1, 0x55, 0x24, 0x59, 0x04, 0x32, 0x2b, - 0xd3, 0xed, 0x57, 0x17, 0x05, 0x8f, 0x76, 0x0b, 0xca, 0x47, 0xa0, 0xc6, 0xf8, 0x3f, 0x72, 0x07, - 0xfd, 0xd0, 0x69, 0x39, 0x1d, 0x9f, 0xba, 0x83, 0x3e, 0xbe, 0x47, 0xd5, 0x87, 0x98, 0x71, 0x91, - 0x85, 0x6e, 0xcb, 0xeb, 0xd4, 0xcf, 0xba, 0xe4, 0xe7, 0x35, 0xc9, 0x6e, 0x0b, 0x29, 0x91, 0xdb, - 0xb9, 0x56, 0x05, 0x5d, 0xf3, 0xb8, 0x8b, 0x7c, 0x29, 0x62, 0x3d, 0x01, 0x35, 0xcb, 0x42, 0xcf, - 0x96, 0x05, 0x44, 0x32, 0x32, 0x5c, 0x9b, 0xbd, 0xca, 0xf2, 0xfd, 0xe8, 0x0f, 0xdd, 0x86, 0xf0, - 0x35, 0xaa, 0xdd, 0xdd, 0x0c, 0x41, 0x24, 0xa3, 0x22, 0xac, 0x58, 0xa0, 0xf5, 0xdb, 0xeb, 0x9b, - 0x1c, 0xfd, 0x22, 0x1a, 0x97, 0xa8, 0xbe, 0xb3, 0x06, 0xde, 0x43, 0x5e, 0xca, 0x8b, 0xf5, 0x65, - 0x66, 0xc4, 0xfb, 0xe8, 0xef, 0x22, 0x16, 0x39, 0x0f, 0x5d, 0xeb, 0x95, 0xe2, 0xca, 0xbd, 0x70, - 0xda, 0x2f, 0xdb, 0x87, 0x0d, 0x17, 0x0b, 0x61, 0xb9, 0x1a, 0x35, 0x23, 0x6e, 0xa3, 0x20, 0xe5, - 0x5c, 0xf6, 0x73, 0x15, 0xeb, 0x04, 0xe6, 0x16, 0xf7, 0xe8, 0x37, 0x0f, 0x1f, 0x22, 0xdf, 0xe8, - 0x5e, 0xa1, 0xb9, 0x39, 0xd6, 0x04, 0xb6, 0x06, 0x0e, 0xd1, 0xbf, 0x49, 0x22, 0x34, 0x57, 0x99, - 0xbd, 0xcb, 0xa7, 0x1b, 0xd9, 0x0b, 0x96, 0xab, 0xa6, 0xf3, 0xb6, 0x6a, 0x3a, 0x1f, 0xab, 0xa6, - 0xc3, 0xaa, 0xf6, 0x93, 0xce, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x79, 0x52, 0x6a, 0x29, - 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/client/build.go b/vendor/github.com/moby/buildkit/client/build.go index f23df4450e..2518cd7c7a 100644 --- a/vendor/github.com/moby/buildkit/client/build.go +++ b/vendor/github.com/moby/buildkit/client/build.go @@ -103,3 +103,8 @@ func (g *gatewayClientForBuild) Return(ctx context.Context, in *gatewayapi.Retur ctx = buildid.AppendToOutgoingContext(ctx, g.buildID) return g.gateway.Return(ctx, in, opts...) } + +func (g *gatewayClientForBuild) Inputs(ctx context.Context, in *gatewayapi.InputsRequest, opts ...grpc.CallOption) (*gatewayapi.InputsResponse, error) { + ctx = buildid.AppendToOutgoingContext(ctx, g.buildID) + return g.gateway.Inputs(ctx, in, opts...) +} diff --git a/vendor/github.com/moby/buildkit/client/client.go b/vendor/github.com/moby/buildkit/client/client.go index 6b8240945c..d256ec37e4 100644 --- a/vendor/github.com/moby/buildkit/client/client.go +++ b/vendor/github.com/moby/buildkit/client/client.go @@ -11,6 +11,8 @@ import ( "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client/connhelper" + "github.com/moby/buildkit/session" + "github.com/moby/buildkit/session/grpchijack" "github.com/moby/buildkit/util/appdefaults" opentracing "github.com/opentracing/opentracing-go" "github.com/pkg/errors" @@ -80,6 +82,10 @@ func (c *Client) controlClient() controlapi.ControlClient { return controlapi.NewControlClient(c.conn) } +func (c *Client) Dialer() session.Dialer { + return grpchijack.Dialer(c.controlClient()) +} + func (c *Client) Close() error { return c.conn.Close() } diff --git a/vendor/github.com/moby/buildkit/client/client_windows.go b/vendor/github.com/moby/buildkit/client/client_windows.go index 7ad54ea38d..d0d8a1b408 100644 --- a/vendor/github.com/moby/buildkit/client/client_windows.go +++ b/vendor/github.com/moby/buildkit/client/client_windows.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Microsoft/go-winio" + winio "github.com/Microsoft/go-winio" "github.com/pkg/errors" ) diff --git a/vendor/github.com/moby/buildkit/client/llb/async.go b/vendor/github.com/moby/buildkit/client/llb/async.go new file mode 100644 index 0000000000..bf28a957c7 --- /dev/null +++ b/vendor/github.com/moby/buildkit/client/llb/async.go @@ -0,0 +1,98 @@ +package llb + +import ( + "context" + + "github.com/moby/buildkit/solver/pb" + "github.com/moby/buildkit/util/flightcontrol" + digest "github.com/opencontainers/go-digest" + "github.com/pkg/errors" +) + +type asyncState struct { + f func(context.Context, State) (State, error) + prev State + target State + set bool + err error + g flightcontrol.Group +} + +func (as *asyncState) Output() Output { + return as +} + +func (as *asyncState) Vertex(ctx context.Context) Vertex { + err := as.Do(ctx) + if err != nil { + return &errVertex{err} + } + if as.set { + out := as.target.Output() + if out == nil { + return nil + } + return out.Vertex(ctx) + } + return nil +} + +func (as *asyncState) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error) { + err := as.Do(ctx) + if err != nil { + return nil, err + } + if as.set { + out := as.target.Output() + if out == nil { + return nil, nil + } + return out.ToInput(ctx, c) + } + return nil, nil +} + +func (as *asyncState) Do(ctx context.Context) error { + _, err := as.g.Do(ctx, "", func(ctx context.Context) (interface{}, error) { + if as.set { + return as.target, as.err + } + res, err := as.f(ctx, as.prev) + if err != nil { + select { + case <-ctx.Done(): + if errors.Cause(err) == ctx.Err() { + return res, err + } + default: + } + } + as.target = res + as.err = err + as.set = true + return res, err + }) + if err != nil { + return err + } + return as.err +} + +type errVertex struct { + err error +} + +func (v *errVertex) Validate(context.Context) error { + return v.err +} +func (v *errVertex) Marshal(context.Context, *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { + return "", nil, nil, v.err +} +func (v *errVertex) Output() Output { + return nil +} +func (v *errVertex) Inputs() []Output { + return nil +} + +var _ Vertex = &errVertex{} diff --git a/vendor/github.com/moby/buildkit/client/llb/definition.go b/vendor/github.com/moby/buildkit/client/llb/definition.go new file mode 100644 index 0000000000..9be2b299ae --- /dev/null +++ b/vendor/github.com/moby/buildkit/client/llb/definition.go @@ -0,0 +1,171 @@ +package llb + +import ( + "context" + "sync" + + "github.com/moby/buildkit/solver/pb" + digest "github.com/opencontainers/go-digest" + specs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/pkg/errors" +) + +// DefinitionOp implements llb.Vertex using a marshalled definition. +// +// For example, after marshalling a LLB state and sending over the wire, the +// LLB state can be reconstructed from the definition. +type DefinitionOp struct { + MarshalCache + mu sync.Mutex + ops map[digest.Digest]*pb.Op + defs map[digest.Digest][]byte + metas map[digest.Digest]pb.OpMetadata + platforms map[digest.Digest]*specs.Platform + dgst digest.Digest + index pb.OutputIndex +} + +// NewDefinitionOp returns a new operation from a marshalled definition. +func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) { + ops := make(map[digest.Digest]*pb.Op) + defs := make(map[digest.Digest][]byte) + platforms := make(map[digest.Digest]*specs.Platform) + + var dgst digest.Digest + for _, dt := range def.Def { + var op pb.Op + if err := (&op).Unmarshal(dt); err != nil { + return nil, errors.Wrap(err, "failed to parse llb proto op") + } + dgst = digest.FromBytes(dt) + ops[dgst] = &op + defs[dgst] = dt + + var platform *specs.Platform + if op.Platform != nil { + spec := op.Platform.Spec() + platform = &spec + } + platforms[dgst] = platform + } + + var index pb.OutputIndex + if dgst != "" { + index = ops[dgst].Inputs[0].Index + dgst = ops[dgst].Inputs[0].Digest + } + + return &DefinitionOp{ + ops: ops, + defs: defs, + metas: def.Metadata, + platforms: platforms, + dgst: dgst, + index: index, + }, nil +} + +func (d *DefinitionOp) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error) { + return d.Output().ToInput(ctx, c) +} + +func (d *DefinitionOp) Vertex(context.Context) Vertex { + return d +} + +func (d *DefinitionOp) Validate(context.Context) error { + // Scratch state has no digest, ops or metas. + if d.dgst == "" { + return nil + } + + d.mu.Lock() + defer d.mu.Unlock() + + if len(d.ops) == 0 || len(d.defs) == 0 || len(d.metas) == 0 { + return errors.Errorf("invalid definition op with no ops %d %d", len(d.ops), len(d.metas)) + } + + _, ok := d.ops[d.dgst] + if !ok { + return errors.Errorf("invalid definition op with unknown op %q", d.dgst) + } + + _, ok = d.defs[d.dgst] + if !ok { + return errors.Errorf("invalid definition op with unknown def %q", d.dgst) + } + + _, ok = d.metas[d.dgst] + if !ok { + return errors.Errorf("invalid definition op with unknown metas %q", d.dgst) + } + + // It is possible for d.index >= len(d.ops[d.dgst]) when depending on scratch + // images. + if d.index < 0 { + return errors.Errorf("invalid definition op with invalid index") + } + + return nil +} + +func (d *DefinitionOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { + if d.dgst == "" { + return "", nil, nil, errors.Errorf("cannot marshal empty definition op") + } + + if err := d.Validate(ctx); err != nil { + return "", nil, nil, err + } + + d.mu.Lock() + defer d.mu.Unlock() + + meta := d.metas[d.dgst] + return d.dgst, d.defs[d.dgst], &meta, nil + +} + +func (d *DefinitionOp) Output() Output { + if d.dgst == "" { + return nil + } + + d.mu.Lock() + platform := d.platforms[d.dgst] + d.mu.Unlock() + + return &output{vertex: d, platform: platform, getIndex: func() (pb.OutputIndex, error) { + return d.index, nil + }} +} + +func (d *DefinitionOp) Inputs() []Output { + if d.dgst == "" { + return nil + } + + var inputs []Output + + d.mu.Lock() + op := d.ops[d.dgst] + platform := d.platforms[d.dgst] + d.mu.Unlock() + + for _, input := range op.Inputs { + vtx := &DefinitionOp{ + ops: d.ops, + defs: d.defs, + metas: d.metas, + platforms: d.platforms, + dgst: input.Digest, + index: input.Index, + } + inputs = append(inputs, &output{vertex: vtx, platform: platform, getIndex: func() (pb.OutputIndex, error) { + return pb.OutputIndex(vtx.index), nil + }}) + } + + return inputs +} diff --git a/vendor/github.com/moby/buildkit/client/llb/exec.go b/vendor/github.com/moby/buildkit/client/llb/exec.go index ade992780e..75617d94dc 100644 --- a/vendor/github.com/moby/buildkit/client/llb/exec.go +++ b/vendor/github.com/moby/buildkit/client/llb/exec.go @@ -1,6 +1,7 @@ package llb import ( + "context" _ "crypto/sha256" "fmt" "net" @@ -12,19 +13,9 @@ import ( "github.com/pkg/errors" ) -type Meta struct { - Args []string - Env EnvList - Cwd string - User string - ProxyEnv *ProxyEnv - ExtraHosts []HostIP - Network pb.NetMode - Security pb.SecurityMode -} - -func NewExecOp(root Output, meta Meta, readOnly bool, c Constraints) *ExecOp { - e := &ExecOp{meta: meta, constraints: c} +func NewExecOp(base State, proxyEnv *ProxyEnv, readOnly bool, c Constraints) *ExecOp { + e := &ExecOp{base: base, constraints: c, proxyEnv: proxyEnv} + root := base.Output() rootMount := &mount{ target: pb.RootMount, source: root, @@ -58,9 +49,10 @@ type mount struct { type ExecOp struct { MarshalCache + proxyEnv *ProxyEnv root Output mounts []*mount - meta Meta + base State constraints Constraints isValidated bool secrets []SecretInfo @@ -103,19 +95,27 @@ func (e *ExecOp) GetMount(target string) Output { return nil } -func (e *ExecOp) Validate() error { +func (e *ExecOp) Validate(ctx context.Context) error { if e.isValidated { return nil } - if len(e.meta.Args) == 0 { + args, err := getArgs(e.base)(ctx) + if err != nil { + return err + } + if len(args) == 0 { return errors.Errorf("arguments are required") } - if e.meta.Cwd == "" { + cwd, err := getDir(e.base)(ctx) + if err != nil { + return err + } + if cwd == "" { return errors.Errorf("working directory is required") } for _, m := range e.mounts { if m.source != nil { - if err := m.source.Vertex().Validate(); err != nil { + if err := m.source.Vertex(ctx).Validate(ctx); err != nil { return err } } @@ -124,11 +124,11 @@ func (e *ExecOp) Validate() error { return nil } -func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { +func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { if e.Cached(c) { return e.Load() } - if err := e.Validate(); err != nil { + if err := e.Validate(ctx); err != nil { return "", nil, nil, err } // make sure mounts are sorted @@ -136,52 +136,86 @@ func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, return e.mounts[i].target < e.mounts[j].target }) + env, err := getEnv(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + if len(e.ssh) > 0 { for i, s := range e.ssh { if s.Target == "" { e.ssh[i].Target = fmt.Sprintf("/run/buildkit/ssh_agent.%d", i) } } - if _, ok := e.meta.Env.Get("SSH_AUTH_SOCK"); !ok { - e.meta.Env = e.meta.Env.AddOrReplace("SSH_AUTH_SOCK", e.ssh[0].Target) + if _, ok := env.Get("SSH_AUTH_SOCK"); !ok { + env = env.AddOrReplace("SSH_AUTH_SOCK", e.ssh[0].Target) } } if c.Caps != nil { if err := c.Caps.Supports(pb.CapExecMetaSetsDefaultPath); err != nil { - e.meta.Env = e.meta.Env.SetDefault("PATH", system.DefaultPathEnv) + env = env.SetDefault("PATH", system.DefaultPathEnv) } else { addCap(&e.constraints, pb.CapExecMetaSetsDefaultPath) } } - meta := &pb.Meta{ - Args: e.meta.Args, - Env: e.meta.Env.ToArray(), - Cwd: e.meta.Cwd, - User: e.meta.User, + args, err := getArgs(e.base)(ctx) + if err != nil { + return "", nil, nil, err } - if len(e.meta.ExtraHosts) > 0 { - hosts := make([]*pb.HostIP, len(e.meta.ExtraHosts)) - for i, h := range e.meta.ExtraHosts { + + cwd, err := getDir(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + + user, err := getUser(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + + meta := &pb.Meta{ + Args: args, + Env: env.ToArray(), + Cwd: cwd, + User: user, + } + extraHosts, err := getExtraHosts(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + if len(extraHosts) > 0 { + hosts := make([]*pb.HostIP, len(extraHosts)) + for i, h := range extraHosts { hosts[i] = &pb.HostIP{Host: h.Host, IP: h.IP.String()} } meta.ExtraHosts = hosts } + network, err := getNetwork(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + + security, err := getSecurity(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + peo := &pb.ExecOp{ Meta: meta, - Network: e.meta.Network, - Security: e.meta.Security, + Network: network, + Security: security, } - if e.meta.Network != NetModeSandbox { + if network != NetModeSandbox { addCap(&e.constraints, pb.CapExecMetaNetwork) } - if e.meta.Security != SecurityModeSandbox { + if security != SecurityModeSandbox { addCap(&e.constraints, pb.CapExecMetaSecurity) } - if p := e.meta.ProxyEnv; p != nil { + if p := e.proxyEnv; p != nil { peo.Meta.ProxyEnv = &pb.ProxyEnv{ HttpProxy: p.HttpProxy, HttpsProxy: p.HttpsProxy, @@ -215,6 +249,14 @@ func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, addCap(&e.constraints, pb.CapExecMountSSH) } + if e.constraints.Platform == nil { + p, err := getPlatform(e.base)(ctx) + if err != nil { + return "", nil, nil, err + } + e.constraints.Platform = p + } + pop, md := MarshalConstraints(c, &e.constraints) pop.Op = &pb.Op_Exec{ Exec: peo, @@ -227,7 +269,7 @@ func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, if m.tmpfs { return "", nil, nil, errors.Errorf("tmpfs mounts must use scratch") } - inp, err := m.source.ToInput(c) + inp, err := m.source.ToInput(ctx, c) if err != nil { return "", nil, nil, err } @@ -414,17 +456,11 @@ func (fn runOptionFunc) SetRunOption(ei *ExecInfo) { fn(ei) } -func Network(n pb.NetMode) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = network(n)(ei.State) - }) +func (fn StateOption) SetRunOption(ei *ExecInfo) { + ei.State = ei.State.With(fn) } -func Security(s pb.SecurityMode) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = security(s)(ei.State) - }) -} +var _ RunOption = StateOption(func(_ State) State { return State{} }) func Shlex(str string) RunOption { return runOptionFunc(func(ei *ExecInfo) { @@ -443,47 +479,12 @@ func Args(a []string) RunOption { }) } -func AddEnv(key, value string) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.AddEnv(key, value) - }) -} - -func AddEnvf(key, value string, v ...interface{}) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.AddEnvf(key, value, v...) - }) -} - -func User(str string) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.User(str) - }) -} - -func Dir(str string) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.Dir(str) - }) -} -func Dirf(str string, v ...interface{}) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.Dirf(str, v...) - }) -} - func AddExtraHost(host string, ip net.IP) RunOption { return runOptionFunc(func(ei *ExecInfo) { ei.State = ei.State.AddExtraHost(host, ip) }) } -func Reset(s State) RunOption { - return runOptionFunc(func(ei *ExecInfo) { - ei.State = ei.State.Reset(s) - }) -} - func With(so ...StateOption) RunOption { return runOptionFunc(func(ei *ExecInfo) { ei.State = ei.State.With(so...) diff --git a/vendor/github.com/moby/buildkit/client/llb/fileop.go b/vendor/github.com/moby/buildkit/client/llb/fileop.go index c95a1d6561..de1512348c 100644 --- a/vendor/github.com/moby/buildkit/client/llb/fileop.go +++ b/vendor/github.com/moby/buildkit/client/llb/fileop.go @@ -1,6 +1,7 @@ package llb import ( + "context" _ "crypto/sha256" "os" "path" @@ -52,7 +53,7 @@ type CopyInput interface { } type subAction interface { - toProtoAction(string, pb.InputIndex) pb.IsFileAction + toProtoAction(context.Context, string, pb.InputIndex) (pb.IsFileAction, error) } type FileAction struct { @@ -146,7 +147,7 @@ type fileActionMkdir struct { info MkdirInfo } -func (a *fileActionMkdir) toProtoAction(parent string, base pb.InputIndex) pb.IsFileAction { +func (a *fileActionMkdir) toProtoAction(ctx context.Context, parent string, base pb.InputIndex) (pb.IsFileAction, error) { return &pb.FileAction_Mkdir{ Mkdir: &pb.FileActionMkDir{ Path: normalizePath(parent, a.file, false), @@ -155,7 +156,7 @@ func (a *fileActionMkdir) toProtoAction(parent string, base pb.InputIndex) pb.Is Owner: a.info.ChownOpt.marshal(base), Timestamp: marshalTime(a.info.CreatedTime), }, - } + }, nil } type MkdirOption interface { @@ -315,7 +316,7 @@ type fileActionMkfile struct { info MkfileInfo } -func (a *fileActionMkfile) toProtoAction(parent string, base pb.InputIndex) pb.IsFileAction { +func (a *fileActionMkfile) toProtoAction(ctx context.Context, parent string, base pb.InputIndex) (pb.IsFileAction, error) { return &pb.FileAction_Mkfile{ Mkfile: &pb.FileActionMkFile{ Path: normalizePath(parent, a.file, false), @@ -324,7 +325,7 @@ func (a *fileActionMkfile) toProtoAction(parent string, base pb.InputIndex) pb.I Owner: a.info.ChownOpt.marshal(base), Timestamp: marshalTime(a.info.CreatedTime), }, - } + }, nil } func Rm(p string, opts ...RmOption) *FileAction { @@ -379,14 +380,14 @@ type fileActionRm struct { info RmInfo } -func (a *fileActionRm) toProtoAction(parent string, base pb.InputIndex) pb.IsFileAction { +func (a *fileActionRm) toProtoAction(ctx context.Context, parent string, base pb.InputIndex) (pb.IsFileAction, error) { return &pb.FileAction_Rm{ Rm: &pb.FileActionRm{ Path: normalizePath(parent, a.file, false), AllowNotFound: a.info.AllowNotFound, AllowWildcard: a.info.AllowWildcard, }, - } + }, nil } func Copy(input CopyInput, src, dest string, opts ...CopyOption) *FileAction { @@ -448,9 +449,13 @@ type fileActionCopy struct { info CopyInfo } -func (a *fileActionCopy) toProtoAction(parent string, base pb.InputIndex) pb.IsFileAction { +func (a *fileActionCopy) toProtoAction(ctx context.Context, parent string, base pb.InputIndex) (pb.IsFileAction, error) { + src, err := a.sourcePath(ctx) + if err != nil { + return nil, err + } c := &pb.FileActionCopy{ - Src: a.sourcePath(), + Src: src, Dest: normalizePath(parent, a.dest, true), Owner: a.info.ChownOpt.marshal(base), AllowWildcard: a.info.AllowWildcard, @@ -468,19 +473,27 @@ func (a *fileActionCopy) toProtoAction(parent string, base pb.InputIndex) pb.IsF } return &pb.FileAction_Copy{ Copy: c, - } + }, nil } -func (c *fileActionCopy) sourcePath() string { +func (c *fileActionCopy) sourcePath(ctx context.Context) (string, error) { p := path.Clean(c.src) if !path.IsAbs(p) { if c.state != nil { - p = path.Join("/", c.state.GetDir(), p) + dir, err := c.state.GetDir(ctx) + if err != nil { + return "", err + } + p = path.Join("/", dir, p) } else if c.fas != nil { - p = path.Join("/", c.fas.state.GetDir(), p) + dir, err := c.fas.state.GetDir(ctx) + if err != nil { + return "", err + } + p = path.Join("/", dir, p) } } - return p + return p, nil } type CreatedTime time.Time @@ -517,7 +530,7 @@ type FileOp struct { isValidated bool } -func (f *FileOp) Validate() error { +func (f *FileOp) Validate(context.Context) error { if f.isValidated { return nil } @@ -529,14 +542,16 @@ func (f *FileOp) Validate() error { } type marshalState struct { + ctx context.Context visited map[*FileAction]*fileActionState inputs []*pb.Input actions []*fileActionState } -func newMarshalState() *marshalState { +func newMarshalState(ctx context.Context) *marshalState { return &marshalState{ visited: map[*FileAction]*fileActionState{}, + ctx: ctx, } } @@ -552,7 +567,7 @@ type fileActionState struct { } func (ms *marshalState) addInput(st *fileActionState, c *Constraints, o Output) (pb.InputIndex, error) { - inp, err := o.ToInput(c) + inp, err := o.ToInput(ms.ctx, c) if err != nil { return 0, err } @@ -634,11 +649,11 @@ func (ms *marshalState) add(fa *FileAction, c *Constraints) (*fileActionState, e return st, nil } -func (f *FileOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { +func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { if f.Cached(c) { return f.Load() } - if err := f.Validate(); err != nil { + if err := f.Validate(ctx); err != nil { return "", nil, nil, err } @@ -651,7 +666,7 @@ func (f *FileOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, File: pfo, } - state := newMarshalState() + state := newMarshalState(ctx) _, err := state.add(f.action, c) if err != nil { return "", nil, nil, err @@ -666,14 +681,22 @@ func (f *FileOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, var parent string if st.fa.state != nil { - parent = st.fa.state.GetDir() + parent, err = st.fa.state.GetDir(ctx) + if err != nil { + return "", nil, nil, err + } + } + + action, err := st.action.toProtoAction(ctx, parent, st.base) + if err != nil { + return "", nil, nil, err } pfo.Actions = append(pfo.Actions, &pb.FileAction{ Input: getIndex(st.input, len(state.inputs), st.inputRelative), SecondaryInput: getIndex(st.input2, len(state.inputs), st.input2Relative), Output: output, - Action: st.action.toProtoAction(parent, st.base), + Action: action, }) } diff --git a/vendor/github.com/moby/buildkit/client/llb/meta.go b/vendor/github.com/moby/buildkit/client/llb/meta.go index 54b14c4c42..ab0f59328e 100644 --- a/vendor/github.com/moby/buildkit/client/llb/meta.go +++ b/vendor/github.com/moby/buildkit/client/llb/meta.go @@ -1,6 +1,7 @@ package llb import ( + "context" "fmt" "net" "path" @@ -24,79 +25,122 @@ var ( keySecurity = contextKeyT("llb.security") ) +func AddEnvf(key, value string, v ...interface{}) StateOption { + return addEnvf(key, value, true, v...) +} + +func AddEnv(key, value string) StateOption { + return addEnvf(key, value, false) +} + func addEnvf(key, value string, replace bool, v ...interface{}) StateOption { if replace { value = fmt.Sprintf(value, v...) } return func(s State) State { - return s.WithValue(keyEnv, getEnv(s).AddOrReplace(key, value)) + return s.withValue(keyEnv, func(ctx context.Context) (interface{}, error) { + env, err := getEnv(s)(ctx) + if err != nil { + return nil, err + } + return env.AddOrReplace(key, value), nil + }) } } -func dir(str string) StateOption { +func Dir(str string) StateOption { return dirf(str, false) } +func Dirf(str string, v ...interface{}) StateOption { + return dirf(str, true, v...) +} + func dirf(value string, replace bool, v ...interface{}) StateOption { if replace { value = fmt.Sprintf(value, v...) } return func(s State) State { - if !path.IsAbs(value) { - prev := getDir(s) - if prev == "" { - prev = "/" + return s.withValue(keyDir, func(ctx context.Context) (interface{}, error) { + if !path.IsAbs(value) { + prev, err := getDir(s)(ctx) + if err != nil { + return nil, err + } + if prev == "" { + prev = "/" + } + value = path.Join(prev, value) } - value = path.Join(prev, value) - } - return s.WithValue(keyDir, value) + return value, nil + }) } } -func user(str string) StateOption { +func User(str string) StateOption { return func(s State) State { return s.WithValue(keyUser, str) } } -func reset(s_ State) StateOption { +func Reset(other State) StateOption { return func(s State) State { s = NewState(s.Output()) - s.ctx = s_.ctx + s.prev = &other return s } } -func getEnv(s State) EnvList { - v := s.Value(keyEnv) - if v != nil { - return v.(EnvList) +func getEnv(s State) func(context.Context) (EnvList, error) { + return func(ctx context.Context) (EnvList, error) { + v, err := s.getValue(keyEnv)(ctx) + if err != nil { + return nil, err + } + if v != nil { + return v.(EnvList), nil + } + return EnvList{}, nil } - return EnvList{} } -func getDir(s State) string { - v := s.Value(keyDir) - if v != nil { - return v.(string) +func getDir(s State) func(context.Context) (string, error) { + return func(ctx context.Context) (string, error) { + v, err := s.getValue(keyDir)(ctx) + if err != nil { + return "", err + } + if v != nil { + return v.(string), nil + } + return "", nil } - return "" } -func getArgs(s State) []string { - v := s.Value(keyArgs) - if v != nil { - return v.([]string) +func getArgs(s State) func(context.Context) ([]string, error) { + return func(ctx context.Context) ([]string, error) { + v, err := s.getValue(keyArgs)(ctx) + if err != nil { + return nil, err + } + if v != nil { + return v.([]string), nil + } + return nil, nil } - return nil } -func getUser(s State) string { - v := s.Value(keyUser) - if v != nil { - return v.(string) +func getUser(s State) func(context.Context) (string, error) { + return func(ctx context.Context) (string, error) { + v, err := s.getValue(keyUser)(ctx) + if err != nil { + return "", err + } + if v != nil { + return v.(string), nil + } + return "", nil } - return "" } func args(args ...string) StateOption { @@ -124,27 +168,43 @@ func platform(p specs.Platform) StateOption { } } -func getPlatform(s State) *specs.Platform { - v := s.Value(keyPlatform) - if v != nil { - p := v.(specs.Platform) - return &p +func getPlatform(s State) func(context.Context) (*specs.Platform, error) { + return func(ctx context.Context) (*specs.Platform, error) { + v, err := s.getValue(keyPlatform)(ctx) + if err != nil { + return nil, err + } + if v != nil { + p := v.(specs.Platform) + return &p, nil + } + return nil, nil } - return nil } func extraHost(host string, ip net.IP) StateOption { return func(s State) State { - return s.WithValue(keyExtraHost, append(getExtraHosts(s), HostIP{Host: host, IP: ip})) + return s.withValue(keyExtraHost, func(ctx context.Context) (interface{}, error) { + v, err := getExtraHosts(s)(ctx) + if err != nil { + return nil, err + } + return append(v, HostIP{Host: host, IP: ip}), nil + }) } } -func getExtraHosts(s State) []HostIP { - v := s.Value(keyExtraHost) - if v != nil { - return v.([]HostIP) +func getExtraHosts(s State) func(context.Context) ([]HostIP, error) { + return func(ctx context.Context) ([]HostIP, error) { + v, err := s.getValue(keyExtraHost)(ctx) + if err != nil { + return nil, err + } + if v != nil { + return v.([]HostIP), nil + } + return nil, nil } - return nil } type HostIP struct { @@ -152,32 +212,42 @@ type HostIP struct { IP net.IP } -func network(v pb.NetMode) StateOption { +func Network(v pb.NetMode) StateOption { return func(s State) State { return s.WithValue(keyNetwork, v) } } -func getNetwork(s State) pb.NetMode { - v := s.Value(keyNetwork) - if v != nil { - n := v.(pb.NetMode) - return n +func getNetwork(s State) func(context.Context) (pb.NetMode, error) { + return func(ctx context.Context) (pb.NetMode, error) { + v, err := s.getValue(keyNetwork)(ctx) + if err != nil { + return 0, err + } + if v != nil { + n := v.(pb.NetMode) + return n, nil + } + return NetModeSandbox, nil } - return NetModeSandbox } -func security(v pb.SecurityMode) StateOption { +func Security(v pb.SecurityMode) StateOption { return func(s State) State { return s.WithValue(keySecurity, v) } } -func getSecurity(s State) pb.SecurityMode { - v := s.Value(keySecurity) - if v != nil { - n := v.(pb.SecurityMode) - return n +func getSecurity(s State) func(context.Context) (pb.SecurityMode, error) { + return func(ctx context.Context) (pb.SecurityMode, error) { + v, err := s.getValue(keySecurity)(ctx) + if err != nil { + return 0, err + } + if v != nil { + n := v.(pb.SecurityMode) + return n, nil + } + return SecurityModeSandbox, nil } - return SecurityModeSandbox } type EnvList []KeyValue diff --git a/vendor/github.com/moby/buildkit/client/llb/resolver.go b/vendor/github.com/moby/buildkit/client/llb/resolver.go index d670a99188..31fc395993 100644 --- a/vendor/github.com/moby/buildkit/client/llb/resolver.go +++ b/vendor/github.com/moby/buildkit/client/llb/resolver.go @@ -3,8 +3,8 @@ package llb import ( "context" - gw "github.com/moby/buildkit/frontend/gateway/client" digest "github.com/opencontainers/go-digest" + specs "github.com/opencontainers/image-spec/specs-go/v1" ) // WithMetaResolver adds a metadata resolver to an image @@ -14,7 +14,22 @@ func WithMetaResolver(mr ImageMetaResolver) ImageOption { }) } +// ResolveDigest uses the meta resolver to update the ref of image with full digest before marshaling. +// This makes image ref immutable and is recommended if you want to make sure meta resolver data +// matches the image used during the build. +func ResolveDigest(v bool) ImageOption { + return imageOptionFunc(func(ii *ImageInfo) { + ii.resolveDigest = v + }) +} + // ImageMetaResolver can resolve image config metadata from a reference type ImageMetaResolver interface { - ResolveImageConfig(ctx context.Context, ref string, opt gw.ResolveImageConfigOpt) (digest.Digest, []byte, error) + ResolveImageConfig(ctx context.Context, ref string, opt ResolveImageConfigOpt) (digest.Digest, []byte, error) +} + +type ResolveImageConfigOpt struct { + Platform *specs.Platform + ResolveMode string + LogName string } diff --git a/vendor/github.com/moby/buildkit/client/llb/source.go b/vendor/github.com/moby/buildkit/client/llb/source.go index 52d40be8b7..b64cfbcc5e 100644 --- a/vendor/github.com/moby/buildkit/client/llb/source.go +++ b/vendor/github.com/moby/buildkit/client/llb/source.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/docker/distribution/reference" - gw "github.com/moby/buildkit/frontend/gateway/client" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/apicaps" digest "github.com/opencontainers/go-digest" @@ -35,7 +34,7 @@ func NewSource(id string, attrs map[string]string, c Constraints) *SourceOp { return s } -func (s *SourceOp) Validate() error { +func (s *SourceOp) Validate(ctx context.Context) error { if s.err != nil { return s.err } @@ -45,11 +44,11 @@ func (s *SourceOp) Validate() error { return nil } -func (s *SourceOp) Marshal(constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { +func (s *SourceOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) { if s.Cached(constraints) { return s.Load() } - if err := s.Validate(); err != nil { + if err := s.Validate(ctx); err != nil { return "", nil, nil, err } @@ -93,7 +92,8 @@ func (s *SourceOp) Inputs() []Output { func Image(ref string, opts ...ImageOption) State { r, err := reference.ParseNormalizedNamed(ref) if err == nil { - ref = reference.TagNameOnly(r).String() + r = reference.TagNameOnly(r) + ref = r.String() } var info ImageInfo for _, opt := range opts { @@ -117,21 +117,35 @@ func Image(ref string, opts ...ImageOption) State { src := NewSource("docker-image://"+ref, attrs, info.Constraints) // controversial if err != nil { src.err = err - } - if info.metaResolver != nil { - _, dt, err := info.metaResolver.ResolveImageConfig(context.TODO(), ref, gw.ResolveImageConfigOpt{ - Platform: info.Constraints.Platform, - ResolveMode: info.resolveMode.String(), - }) - if err != nil { - src.err = err - } else { - st, err := NewState(src.Output()).WithImageConfig(dt) - if err == nil { - return st - } - src.err = err + } else if info.metaResolver != nil { + if _, ok := r.(reference.Digested); ok || !info.resolveDigest { + return NewState(src.Output()).Async(func(ctx context.Context, st State) (State, error) { + _, dt, err := info.metaResolver.ResolveImageConfig(ctx, ref, ResolveImageConfigOpt{ + Platform: info.Constraints.Platform, + ResolveMode: info.resolveMode.String(), + }) + if err != nil { + return State{}, err + } + return st.WithImageConfig(dt) + }) } + return Scratch().Async(func(ctx context.Context, _ State) (State, error) { + dgst, dt, err := info.metaResolver.ResolveImageConfig(context.TODO(), ref, ResolveImageConfigOpt{ + Platform: info.Constraints.Platform, + ResolveMode: info.resolveMode.String(), + }) + if err != nil { + return State{}, err + } + if dgst != "" { + r, err = reference.WithDigest(r, dgst) + if err != nil { + return State{}, err + } + } + return NewState(NewSource("docker-image://"+r.String(), attrs, info.Constraints).Output()).WithImageConfig(dt) + }) } return NewState(src.Output()) } @@ -177,9 +191,10 @@ func (r ResolveMode) String() string { type ImageInfo struct { constraintsWrapper - metaResolver ImageMetaResolver - resolveMode ResolveMode - RecordType string + metaResolver ImageMetaResolver + resolveDigest bool + resolveMode ResolveMode + RecordType string } func Git(remote, ref string, opts ...GitOption) State { diff --git a/vendor/github.com/moby/buildkit/client/llb/state.go b/vendor/github.com/moby/buildkit/client/llb/state.go index ba8845e086..195cee3e3d 100644 --- a/vendor/github.com/moby/buildkit/client/llb/state.go +++ b/vendor/github.com/moby/buildkit/client/llb/state.go @@ -18,13 +18,13 @@ import ( type StateOption func(State) State type Output interface { - ToInput(*Constraints) (*pb.Input, error) - Vertex() Vertex + ToInput(context.Context, *Constraints) (*pb.Input, error) + Vertex(context.Context) Vertex } type Vertex interface { - Validate() error - Marshal(*Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) + Validate(context.Context) error + Marshal(context.Context, *Constraints) (digest.Digest, []byte, *pb.OpMetadata, error) Output() Output Inputs() []Output } @@ -32,17 +32,18 @@ type Vertex interface { func NewState(o Output) State { s := State{ out: o, - ctx: context.Background(), - } - s = dir("/")(s) + }.Dir("/") s = s.ensurePlatform() return s } type State struct { - out Output - ctx context.Context - opts []ConstraintsOpt + out Output + prev *State + key interface{} + value func(context.Context) (interface{}, error) + opts []ConstraintsOpt + async *asyncState } func (s State) ensurePlatform() State { @@ -57,14 +58,48 @@ func (s State) ensurePlatform() State { } func (s State) WithValue(k, v interface{}) State { + return s.withValue(k, func(context.Context) (interface{}, error) { + return v, nil + }) +} + +func (s State) withValue(k interface{}, v func(context.Context) (interface{}, error)) State { return State{ - out: s.out, - ctx: context.WithValue(s.ctx, k, v), + out: s.Output(), + prev: &s, // doesn't need to be original pointer + key: k, + value: v, } } -func (s State) Value(k interface{}) interface{} { - return s.ctx.Value(k) +func (s State) Value(ctx context.Context, k interface{}) (interface{}, error) { + return s.getValue(k)(ctx) +} + +func (s State) getValue(k interface{}) func(context.Context) (interface{}, error) { + if s.key == k { + return s.value + } + if s.async != nil { + return func(ctx context.Context) (interface{}, error) { + err := s.async.Do(ctx) + if err != nil { + return nil, err + } + return s.async.target.getValue(k)(ctx) + } + } + if s.prev == nil { + return nilValue + } + return s.prev.getValue(k) +} + +func (s State) Async(f func(context.Context, State) (State, error)) State { + s2 := State{ + async: &asyncState{f: f, prev: s}, + } + return s2 } func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State { @@ -72,11 +107,11 @@ func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State { return s } -func (s State) Marshal(co ...ConstraintsOpt) (*Definition, error) { +func (s State) Marshal(ctx context.Context, co ...ConstraintsOpt) (*Definition, error) { def := &Definition{ Metadata: make(map[digest.Digest]pb.OpMetadata, 0), } - if s.Output() == nil { + if s.Output() == nil || s.Output().Vertex(ctx) == nil { return def, nil } @@ -89,11 +124,11 @@ func (s State) Marshal(co ...ConstraintsOpt) (*Definition, error) { o.SetConstraintsOption(c) } - def, err := marshal(s.Output().Vertex(), def, map[digest.Digest]struct{}{}, map[Vertex]struct{}{}, c) + def, err := marshal(ctx, s.Output().Vertex(ctx), def, map[digest.Digest]struct{}{}, map[Vertex]struct{}{}, c) if err != nil { return def, err } - inp, err := s.Output().ToInput(c) + inp, err := s.Output().ToInput(ctx, c) if err != nil { return def, err } @@ -128,19 +163,19 @@ func (s State) Marshal(co ...ConstraintsOpt) (*Definition, error) { return def, nil } -func marshal(v Vertex, def *Definition, cache map[digest.Digest]struct{}, vertexCache map[Vertex]struct{}, c *Constraints) (*Definition, error) { +func marshal(ctx context.Context, v Vertex, def *Definition, cache map[digest.Digest]struct{}, vertexCache map[Vertex]struct{}, c *Constraints) (*Definition, error) { if _, ok := vertexCache[v]; ok { return def, nil } for _, inp := range v.Inputs() { var err error - def, err = marshal(inp.Vertex(), def, cache, vertexCache, c) + def, err = marshal(ctx, inp.Vertex(ctx), def, cache, vertexCache, c) if err != nil { return def, err } } - dgst, dt, opMeta, err := v.Marshal(c) + dgst, dt, opMeta, err := v.Marshal(ctx, c) if err != nil { return def, err } @@ -156,18 +191,22 @@ func marshal(v Vertex, def *Definition, cache map[digest.Digest]struct{}, vertex return def, nil } -func (s State) Validate() error { - return s.Output().Vertex().Validate() +func (s State) Validate(ctx context.Context) error { + return s.Output().Vertex(ctx).Validate(ctx) } func (s State) Output() Output { + if s.async != nil { + return s.async.Output() + } return s.out } func (s State) WithOutput(o Output) State { + prev := s s = State{ - out: o, - ctx: s.ctx, + out: o, + prev: &prev, } s = s.ensurePlatform() return s @@ -200,24 +239,10 @@ func (s State) WithImageConfig(c []byte) (State, error) { func (s State) Run(ro ...RunOption) ExecState { ei := &ExecInfo{State: s} - if p := s.GetPlatform(); p != nil { - ei.Constraints.Platform = p - } for _, o := range ro { o.SetRunOption(ei) } - meta := Meta{ - Args: getArgs(ei.State), - Cwd: getDir(ei.State), - Env: getEnv(ei.State), - User: getUser(ei.State), - ProxyEnv: ei.ProxyEnv, - ExtraHosts: getExtraHosts(ei.State), - Network: getNetwork(ei.State), - Security: getSecurity(ei.State), - } - - exec := NewExecOp(s.Output(), meta, ei.ReadonlyRootFS, ei.Constraints) + exec := NewExecOp(ei.State, ei.ProxyEnv, ei.ReadonlyRootFS, ei.Constraints) for _, m := range ei.Mounts { exec.AddMount(m.Target, m.Source, m.Opts...) } @@ -240,65 +265,74 @@ func (s State) File(a *FileAction, opts ...ConstraintsOpt) State { } func (s State) AddEnv(key, value string) State { - return addEnvf(key, value, false)(s) + return AddEnv(key, value)(s) } func (s State) AddEnvf(key, value string, v ...interface{}) State { - return addEnvf(key, value, true, v...)(s) + return AddEnvf(key, value, v...)(s) } func (s State) Dir(str string) State { - return dirf(str, false)(s) + return Dir(str)(s) } func (s State) Dirf(str string, v ...interface{}) State { - return dirf(str, true, v...)(s) + return Dirf(str, v...)(s) } -func (s State) GetEnv(key string) (string, bool) { - return getEnv(s).Get(key) +func (s State) GetEnv(ctx context.Context, key string) (string, bool, error) { + env, err := getEnv(s)(ctx) + if err != nil { + return "", false, err + } + v, ok := env.Get(key) + return v, ok, nil } -func (s State) Env() []string { - return getEnv(s).ToArray() +func (s State) Env(ctx context.Context) ([]string, error) { + env, err := getEnv(s)(ctx) + if err != nil { + return nil, err + } + return env.ToArray(), nil } -func (s State) GetDir() string { - return getDir(s) +func (s State) GetDir(ctx context.Context) (string, error) { + return getDir(s)(ctx) } -func (s State) GetArgs() []string { - return getArgs(s) +func (s State) GetArgs(ctx context.Context) ([]string, error) { + return getArgs(s)(ctx) } func (s State) Reset(s2 State) State { - return reset(s2)(s) + return Reset(s2)(s) } func (s State) User(v string) State { - return user(v)(s) + return User(v)(s) } func (s State) Platform(p specs.Platform) State { return platform(p)(s) } -func (s State) GetPlatform() *specs.Platform { - return getPlatform(s) +func (s State) GetPlatform(ctx context.Context) (*specs.Platform, error) { + return getPlatform(s)(ctx) } func (s State) Network(n pb.NetMode) State { - return network(n)(s) + return Network(n)(s) } -func (s State) GetNetwork() pb.NetMode { - return getNetwork(s) +func (s State) GetNetwork(ctx context.Context) (pb.NetMode, error) { + return getNetwork(s)(ctx) } func (s State) Security(n pb.SecurityMode) State { - return security(n)(s) + return Security(n)(s) } -func (s State) GetSecurity() pb.SecurityMode { - return getSecurity(s) +func (s State) GetSecurity(ctx context.Context) (pb.SecurityMode, error) { + return getSecurity(s)(ctx) } func (s State) With(so ...StateOption) State { @@ -321,7 +355,7 @@ type output struct { platform *specs.Platform } -func (o *output) ToInput(c *Constraints) (*pb.Input, error) { +func (o *output) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error) { if o.err != nil { return nil, o.err } @@ -333,14 +367,14 @@ func (o *output) ToInput(c *Constraints) (*pb.Input, error) { return nil, err } } - dgst, _, _, err := o.vertex.Marshal(c) + dgst, _, _, err := o.vertex.Marshal(ctx, c) if err != nil { return nil, err } return &pb.Input{Digest: dgst, Index: index}, nil } -func (o *output) Vertex() Vertex { +func (o *output) Vertex(context.Context) Vertex { return o.vertex } @@ -513,3 +547,7 @@ func Require(filters ...string) ConstraintsOpt { } }) } + +func nilValue(context.Context) (interface{}, error) { + return nil, nil +} diff --git a/vendor/github.com/moby/buildkit/client/solve.go b/vendor/github.com/moby/buildkit/client/solve.go index d09c5f764e..1d77bc4588 100644 --- a/vendor/github.com/moby/buildkit/client/solve.go +++ b/vendor/github.com/moby/buildkit/client/solve.go @@ -35,6 +35,7 @@ type SolveOpt struct { SharedKey string Frontend string FrontendAttrs map[string]string + FrontendInputs map[string]llb.State CacheExports []CacheOptionsEntry CacheImports []CacheOptionsEntry Session []session.Attachable @@ -114,6 +115,12 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG } var ex ExportEntry + if len(opt.Exports) > 1 { + return nil, errors.New("currently only single Exports can be specified") + } + if len(opt.Exports) == 1 { + ex = opt.Exports[0] + } if !opt.SessionPreInitialized { if len(syncedDirs) > 0 { @@ -124,13 +131,6 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG s.Allow(a) } - if len(opt.Exports) > 1 { - return nil, errors.New("currently only single Exports can be specified") - } - if len(opt.Exports) == 1 { - ex = opt.Exports[0] - } - switch ex.Type { case ExporterLocal: if ex.Output != nil { @@ -188,16 +188,27 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG if def != nil { pbd = def.ToPB() } + + frontendInputs := make(map[string]*pb.Definition) + for key, st := range opt.FrontendInputs { + def, err := st.Marshal(ctx) + if err != nil { + return err + } + frontendInputs[key] = def.ToPB() + } + resp, err := c.controlClient().Solve(ctx, &controlapi.SolveRequest{ - Ref: ref, - Definition: pbd, - Exporter: ex.Type, - ExporterAttrs: ex.Attrs, - Session: s.ID(), - Frontend: opt.Frontend, - FrontendAttrs: opt.FrontendAttrs, - Cache: cacheOpt.options, - Entitlements: opt.AllowedEntitlements, + Ref: ref, + Definition: pbd, + Exporter: ex.Type, + ExporterAttrs: ex.Attrs, + Session: s.ID(), + Frontend: opt.Frontend, + FrontendAttrs: opt.FrontendAttrs, + FrontendInputs: frontendInputs, + Cache: cacheOpt.options, + Entitlements: opt.AllowedEntitlements, }) if err != nil { return errors.Wrap(err, "failed to solve") @@ -412,26 +423,28 @@ func parseCacheOptions(opt SolveOpt) (*cacheOptions, error) { } cs, err := contentlocal.NewStore(csDir) if err != nil { - return nil, err + logrus.Warning("local cache import at " + csDir + " not found due to err: " + err.Error()) + continue } - contentStores["local:"+csDir] = cs - // if digest is not specified, load from "latest" tag if attrs["digest"] == "" { idx, err := ociindex.ReadIndexJSONFileLocked(filepath.Join(csDir, "index.json")) if err != nil { - return nil, err + logrus.Warning("local cache import at " + csDir + " not found due to err: " + err.Error()) + continue } for _, m := range idx.Manifests { - if m.Annotations[ocispec.AnnotationRefName] == "latest" { + if (m.Annotations[ocispec.AnnotationRefName] == "latest" && attrs["tag"] == "") || (attrs["tag"] != "" && m.Annotations[ocispec.AnnotationRefName] == attrs["tag"]) { attrs["digest"] = string(m.Digest) break } } if attrs["digest"] == "" { - return nil, errors.New("local cache importer requires either explicit digest or \"latest\" tag on index.json") + return nil, errors.New("local cache importer requires either explicit digest, \"latest\" tag or custom tag on index.json") } } + contentStores["local:"+csDir] = cs + } if im.Type == "registry" { legacyImportRef := attrs["ref"] diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/client/client.go b/vendor/github.com/moby/buildkit/frontend/gateway/client/client.go index 02c9c9495c..bc7f96b5fe 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/client/client.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/client/client.go @@ -3,6 +3,7 @@ package client import ( "context" + "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/apicaps" digest "github.com/opencontainers/go-digest" @@ -12,11 +13,13 @@ import ( type Client interface { Solve(ctx context.Context, req SolveRequest) (*Result, error) - ResolveImageConfig(ctx context.Context, ref string, opt ResolveImageConfigOpt) (digest.Digest, []byte, error) + ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt) (digest.Digest, []byte, error) BuildOpts() BuildOpts + Inputs(ctx context.Context) (map[string]llb.State, error) } type Reference interface { + ToState() (llb.State, error) ReadFile(ctx context.Context, req ReadRequest) ([]byte, error) StatFile(ctx context.Context, req StatRequest) (*fstypes.Stat, error) ReadDir(ctx context.Context, req ReadDirRequest) ([]*fstypes.Stat, error) @@ -43,10 +46,11 @@ type StatRequest struct { // SolveRequest is same as frontend.SolveRequest but avoiding dependency type SolveRequest struct { - Definition *pb.Definition - Frontend string - FrontendOpt map[string]string - CacheImports []CacheOptionsEntry + Definition *pb.Definition + Frontend string + FrontendOpt map[string]string + FrontendInputs map[string]*pb.Definition + CacheImports []CacheOptionsEntry } type CacheOptionsEntry struct { @@ -68,9 +72,3 @@ type BuildOpts struct { LLBCaps apicaps.CapSet Caps apicaps.CapSet } - -type ResolveImageConfigOpt struct { - Platform *specs.Platform - ResolveMode string - LogName string -} diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go b/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go index 1a1ff07571..427758e66c 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go @@ -10,6 +10,7 @@ import ( "time" "github.com/gogo/googleapis/google/rpc" + "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/frontend/gateway/client" pb "github.com/moby/buildkit/frontend/gateway/pb" opspb "github.com/moby/buildkit/solver/pb" @@ -68,15 +69,15 @@ func current() (GrpcClient, error) { return New(ctx, opts(), sessionID(), product(), pb.NewLLBBridgeClient(conn), workers()) } -func convertRef(ref client.Reference) (string, error) { +func convertRef(ref client.Reference) (*pb.Ref, error) { if ref == nil { - return "", nil + return &pb.Ref{}, nil } r, ok := ref.(*reference) if !ok { - return "", errors.Errorf("invalid return reference type %T", ref) + return nil, errors.Errorf("invalid return reference type %T", ref) } - return r.id, nil + return &pb.Ref{Id: r.id, Def: r.def}, nil } func RunFromEnvironment(ctx context.Context, f client.BuildFunc) error { @@ -105,22 +106,43 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro Metadata: res.Metadata, } if res.Refs != nil { - m := map[string]string{} - for k, r := range res.Refs { - id, err := convertRef(r) - if err != nil { - retError = err - continue + if c.caps.Supports(pb.CapProtoRefArray) == nil { + m := map[string]*pb.Ref{} + for k, r := range res.Refs { + pbRef, err := convertRef(r) + if err != nil { + retError = err + continue + } + m[k] = pbRef } - m[k] = id + pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: m}} + } else { + // Server doesn't support the new wire format for refs, so we construct + // a deprecated result ref map. + m := map[string]string{} + for k, r := range res.Refs { + pbRef, err := convertRef(r) + if err != nil { + retError = err + continue + } + m[k] = pbRef.Id + } + pbRes.Result = &pb.Result_RefsDeprecated{RefsDeprecated: &pb.RefMapDeprecated{Refs: m}} } - pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: m}} } else { - id, err := convertRef(res.Ref) + pbRef, err := convertRef(res.Ref) if err != nil { retError = err } else { - pbRes.Result = &pb.Result_Ref{Ref: id} + if c.caps.Supports(pb.CapProtoRefArray) == nil { + pbRes.Result = &pb.Result_Ref{Ref: pbRef} + } else { + // Server doesn't support the new wire format for refs, so we construct + // a deprecated result ref. + pbRes.Result = &pb.Result_RefDeprecated{RefDeprecated: pbRef.Id} + } } } if retError == nil { @@ -280,10 +302,12 @@ func (c *grpcClient) Solve(ctx context.Context, creq client.SolveRequest) (*clie } req := &pb.SolveRequest{ - Definition: creq.Definition, - Frontend: creq.Frontend, - FrontendOpt: creq.FrontendOpt, - AllowResultReturn: true, + Definition: creq.Definition, + Frontend: creq.Frontend, + FrontendOpt: creq.FrontendOpt, + FrontendInputs: creq.FrontendInputs, + AllowResultReturn: true, + AllowResultArrayRef: true, // old API ImportCacheRefsDeprecated: legacyRegistryCacheImports, // new API @@ -310,25 +334,44 @@ func (c *grpcClient) Solve(ctx context.Context, creq client.SolveRequest) (*clie } else { res.Metadata = resp.Result.Metadata switch pbRes := resp.Result.Result.(type) { - case *pb.Result_Ref: - if id := pbRes.Ref; id != "" { + case *pb.Result_RefDeprecated: + if id := pbRes.RefDeprecated; id != "" { res.SetRef(&reference{id: id, c: c}) } - case *pb.Result_Refs: - for k, v := range pbRes.Refs.Refs { + case *pb.Result_RefsDeprecated: + for k, v := range pbRes.RefsDeprecated.Refs { ref := &reference{id: v, c: c} if v == "" { ref = nil } res.AddRef(k, ref) } + case *pb.Result_Ref: + if pbRes.Ref.Id != "" { + ref, err := newReference(c, pbRes.Ref) + if err != nil { + return nil, err + } + res.SetRef(ref) + } + case *pb.Result_Refs: + for k, v := range pbRes.Refs.Refs { + var ref *reference + if v.Id != "" { + ref, err = newReference(c, v) + if err != nil { + return nil, err + } + } + res.AddRef(k, ref) + } } } return res, nil } -func (c *grpcClient) ResolveImageConfig(ctx context.Context, ref string, opt client.ResolveImageConfigOpt) (digest.Digest, []byte, error) { +func (c *grpcClient) ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt) (digest.Digest, []byte, error) { var p *opspb.Platform if platform := opt.Platform; platform != nil { p = &opspb.Platform{ @@ -357,9 +400,56 @@ func (c *grpcClient) BuildOpts() client.BuildOpts { } } +func (c *grpcClient) Inputs(ctx context.Context) (map[string]llb.State, error) { + err := c.caps.Supports(pb.CapFrontendInputs) + if err != nil { + return nil, err + } + + resp, err := c.client.Inputs(ctx, &pb.InputsRequest{}) + if err != nil { + return nil, err + } + + inputs := make(map[string]llb.State) + for key, def := range resp.Definitions { + op, err := llb.NewDefinitionOp(def) + if err != nil { + return nil, err + } + inputs[key] = llb.NewState(op) + } + return inputs, nil + +} + type reference struct { - id string - c *grpcClient + c *grpcClient + id string + def *opspb.Definition + output llb.Output +} + +func newReference(c *grpcClient, ref *pb.Ref) (*reference, error) { + return &reference{c: c, id: ref.Id, def: ref.Def}, nil +} + +func (r *reference) ToState() (st llb.State, err error) { + err = r.c.caps.Supports(pb.CapReferenceOutput) + if err != nil { + return st, err + } + + if r.def == nil { + return st, errors.Errorf("gateway did not return reference with definition") + } + + defop, err := llb.NewDefinitionOp(r.def) + if err != nil { + return st, err + } + + return llb.NewState(defop), nil } func (r *reference) ReadFile(ctx context.Context, req client.ReadRequest) ([]byte, error) { diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/pb/caps.go b/vendor/github.com/moby/buildkit/frontend/gateway/pb/caps.go index 1acde729a3..6e811d3d99 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/pb/caps.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/pb/caps.go @@ -19,6 +19,19 @@ const ( CapReadDir apicaps.CapID = "readdir" CapStatFile apicaps.CapID = "statfile" CapImportCaches apicaps.CapID = "importcaches" + + // CapProtoRefArray is a capability to return arrays of refs instead of single + // refs. This capability is only for the wire format change and shouldn't be + // used in frontends for feature detection. + CapProtoRefArray apicaps.CapID = "proto.refarray" + + // CapReferenceOutput is a capability to use a reference of a solved result as + // an llb.Output. + CapReferenceOutput apicaps.CapID = "reference.output" + + // CapFrontendInputs is a capability to request frontend inputs from the + // LLBBridge GRPC server. + CapFrontendInputs apicaps.CapID = "frontend.inputs" ) func init() { @@ -92,4 +105,25 @@ func init() { Enabled: true, Status: apicaps.CapStatusExperimental, }) + + Caps.Init(apicaps.Cap{ + ID: CapProtoRefArray, + Name: "wire format ref arrays", + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + + Caps.Init(apicaps.Cap{ + ID: CapReferenceOutput, + Name: "reference output", + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + + Caps.Init(apicaps.Cap{ + ID: CapFrontendInputs, + Name: "frontend inputs", + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) } diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go index 412892fe04..a155367e1a 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go @@ -3,25 +3,25 @@ package moby_buildkit_v1_frontend -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import rpc "github.com/gogo/googleapis/google/rpc" -import _ "github.com/gogo/protobuf/gogoproto" -import types1 "github.com/moby/buildkit/api/types" -import pb "github.com/moby/buildkit/solver/pb" -import pb1 "github.com/moby/buildkit/util/apicaps/pb" -import types "github.com/tonistiigi/fsutil/types" - -import github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + rpc "github.com/gogo/googleapis/google/rpc" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types1 "github.com/moby/buildkit/api/types" + pb "github.com/moby/buildkit/solver/pb" + pb1 "github.com/moby/buildkit/util/apicaps/pb" + github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" + types "github.com/tonistiigi/fsutil/types" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -31,10 +31,12 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Result struct { // Types that are valid to be assigned to Result: + // *Result_RefDeprecated + // *Result_RefsDeprecated // *Result_Ref // *Result_Refs Result isResult_Result `protobuf_oneof:"result"` @@ -48,7 +50,7 @@ func (m *Result) Reset() { *m = Result{} } func (m *Result) String() string { return proto.CompactTextString(m) } func (*Result) ProtoMessage() {} func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{0} + return fileDescriptor_f1a937782ebbded5, []int{0} } func (m *Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -58,15 +60,15 @@ func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Result.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *Result) XXX_Merge(src proto.Message) { - xxx_messageInfo_Result.Merge(dst, src) +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) } func (m *Result) XXX_Size() int { return m.Size() @@ -83,15 +85,23 @@ type isResult_Result interface { Size() int } +type Result_RefDeprecated struct { + RefDeprecated string `protobuf:"bytes,1,opt,name=refDeprecated,proto3,oneof" json:"refDeprecated,omitempty"` +} +type Result_RefsDeprecated struct { + RefsDeprecated *RefMapDeprecated `protobuf:"bytes,2,opt,name=refsDeprecated,proto3,oneof" json:"refsDeprecated,omitempty"` +} type Result_Ref struct { - Ref string `protobuf:"bytes,1,opt,name=ref,proto3,oneof"` + Ref *Ref `protobuf:"bytes,3,opt,name=ref,proto3,oneof" json:"ref,omitempty"` } type Result_Refs struct { - Refs *RefMap `protobuf:"bytes,2,opt,name=refs,proto3,oneof"` + Refs *RefMap `protobuf:"bytes,4,opt,name=refs,proto3,oneof" json:"refs,omitempty"` } -func (*Result_Ref) isResult_Result() {} -func (*Result_Refs) isResult_Result() {} +func (*Result_RefDeprecated) isResult_Result() {} +func (*Result_RefsDeprecated) isResult_Result() {} +func (*Result_Ref) isResult_Result() {} +func (*Result_Refs) isResult_Result() {} func (m *Result) GetResult() isResult_Result { if m != nil { @@ -100,11 +110,25 @@ func (m *Result) GetResult() isResult_Result { return nil } -func (m *Result) GetRef() string { +func (m *Result) GetRefDeprecated() string { + if x, ok := m.GetResult().(*Result_RefDeprecated); ok { + return x.RefDeprecated + } + return "" +} + +func (m *Result) GetRefsDeprecated() *RefMapDeprecated { + if x, ok := m.GetResult().(*Result_RefsDeprecated); ok { + return x.RefsDeprecated + } + return nil +} + +func (m *Result) GetRef() *Ref { if x, ok := m.GetResult().(*Result_Ref); ok { return x.Ref } - return "" + return nil } func (m *Result) GetRefs() *RefMap { @@ -121,88 +145,130 @@ func (m *Result) GetMetadata() map[string][]byte { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Result) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Result_OneofMarshaler, _Result_OneofUnmarshaler, _Result_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_RefDeprecated)(nil), + (*Result_RefsDeprecated)(nil), (*Result_Ref)(nil), (*Result_Refs)(nil), } } -func _Result_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Result) - // result - switch x := m.Result.(type) { - case *Result_Ref: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Ref) - case *Result_Refs: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Refs); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Result.Result has unexpected type %T", x) - } - return nil -} - -func _Result_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Result) - switch tag { - case 1: // result.ref - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Result = &Result_Ref{x} - return true, err - case 2: // result.refs - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RefMap) - err := b.DecodeMessage(msg) - m.Result = &Result_Refs{msg} - return true, err - default: - return false, nil - } -} - -func _Result_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Result) - // result - switch x := m.Result.(type) { - case *Result_Ref: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Ref))) - n += len(x.Ref) - case *Result_Refs: - s := proto.Size(x.Refs) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type RefMap struct { +type RefMapDeprecated struct { Refs map[string]string `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *RefMapDeprecated) Reset() { *m = RefMapDeprecated{} } +func (m *RefMapDeprecated) String() string { return proto.CompactTextString(m) } +func (*RefMapDeprecated) ProtoMessage() {} +func (*RefMapDeprecated) Descriptor() ([]byte, []int) { + return fileDescriptor_f1a937782ebbded5, []int{1} +} +func (m *RefMapDeprecated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RefMapDeprecated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RefMapDeprecated.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RefMapDeprecated) XXX_Merge(src proto.Message) { + xxx_messageInfo_RefMapDeprecated.Merge(m, src) +} +func (m *RefMapDeprecated) XXX_Size() int { + return m.Size() +} +func (m *RefMapDeprecated) XXX_DiscardUnknown() { + xxx_messageInfo_RefMapDeprecated.DiscardUnknown(m) +} + +var xxx_messageInfo_RefMapDeprecated proto.InternalMessageInfo + +func (m *RefMapDeprecated) GetRefs() map[string]string { + if m != nil { + return m.Refs + } + return nil +} + +type Ref struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Def *pb.Definition `protobuf:"bytes,2,opt,name=def,proto3" json:"def,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Ref) Reset() { *m = Ref{} } +func (m *Ref) String() string { return proto.CompactTextString(m) } +func (*Ref) ProtoMessage() {} +func (*Ref) Descriptor() ([]byte, []int) { + return fileDescriptor_f1a937782ebbded5, []int{2} +} +func (m *Ref) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ref) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ref.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Ref) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ref.Merge(m, src) +} +func (m *Ref) XXX_Size() int { + return m.Size() +} +func (m *Ref) XXX_DiscardUnknown() { + xxx_messageInfo_Ref.DiscardUnknown(m) +} + +var xxx_messageInfo_Ref proto.InternalMessageInfo + +func (m *Ref) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Ref) GetDef() *pb.Definition { + if m != nil { + return m.Def + } + return nil +} + +type RefMap struct { + Refs map[string]*Ref `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *RefMap) Reset() { *m = RefMap{} } func (m *RefMap) String() string { return proto.CompactTextString(m) } func (*RefMap) ProtoMessage() {} func (*RefMap) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{1} + return fileDescriptor_f1a937782ebbded5, []int{3} } func (m *RefMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,15 +278,15 @@ func (m *RefMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RefMap.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *RefMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_RefMap.Merge(dst, src) +func (m *RefMap) XXX_Merge(src proto.Message) { + xxx_messageInfo_RefMap.Merge(m, src) } func (m *RefMap) XXX_Size() int { return m.Size() @@ -231,7 +297,7 @@ func (m *RefMap) XXX_DiscardUnknown() { var xxx_messageInfo_RefMap proto.InternalMessageInfo -func (m *RefMap) GetRefs() map[string]string { +func (m *RefMap) GetRefs() map[string]*Ref { if m != nil { return m.Refs } @@ -250,7 +316,7 @@ func (m *ReturnRequest) Reset() { *m = ReturnRequest{} } func (m *ReturnRequest) String() string { return proto.CompactTextString(m) } func (*ReturnRequest) ProtoMessage() {} func (*ReturnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{2} + return fileDescriptor_f1a937782ebbded5, []int{4} } func (m *ReturnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -260,15 +326,15 @@ func (m *ReturnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ReturnRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReturnRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReturnRequest.Merge(dst, src) +func (m *ReturnRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReturnRequest.Merge(m, src) } func (m *ReturnRequest) XXX_Size() int { return m.Size() @@ -303,7 +369,7 @@ func (m *ReturnResponse) Reset() { *m = ReturnResponse{} } func (m *ReturnResponse) String() string { return proto.CompactTextString(m) } func (*ReturnResponse) ProtoMessage() {} func (*ReturnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{3} + return fileDescriptor_f1a937782ebbded5, []int{5} } func (m *ReturnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,15 +379,15 @@ func (m *ReturnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ReturnResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReturnResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReturnResponse.Merge(dst, src) +func (m *ReturnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReturnResponse.Merge(m, src) } func (m *ReturnResponse) XXX_Size() int { return m.Size() @@ -332,6 +398,92 @@ func (m *ReturnResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ReturnResponse proto.InternalMessageInfo +type InputsRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InputsRequest) Reset() { *m = InputsRequest{} } +func (m *InputsRequest) String() string { return proto.CompactTextString(m) } +func (*InputsRequest) ProtoMessage() {} +func (*InputsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f1a937782ebbded5, []int{6} +} +func (m *InputsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InputsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InputsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InputsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InputsRequest.Merge(m, src) +} +func (m *InputsRequest) XXX_Size() int { + return m.Size() +} +func (m *InputsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InputsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_InputsRequest proto.InternalMessageInfo + +type InputsResponse struct { + Definitions map[string]*pb.Definition `protobuf:"bytes,1,rep,name=Definitions,proto3" json:"Definitions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InputsResponse) Reset() { *m = InputsResponse{} } +func (m *InputsResponse) String() string { return proto.CompactTextString(m) } +func (*InputsResponse) ProtoMessage() {} +func (*InputsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f1a937782ebbded5, []int{7} +} +func (m *InputsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InputsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InputsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InputsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InputsResponse.Merge(m, src) +} +func (m *InputsResponse) XXX_Size() int { + return m.Size() +} +func (m *InputsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InputsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_InputsResponse proto.InternalMessageInfo + +func (m *InputsResponse) GetDefinitions() map[string]*pb.Definition { + if m != nil { + return m.Definitions + } + return nil +} + type ResolveImageConfigRequest struct { Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` @@ -346,7 +498,7 @@ func (m *ResolveImageConfigRequest) Reset() { *m = ResolveImageConfigReq func (m *ResolveImageConfigRequest) String() string { return proto.CompactTextString(m) } func (*ResolveImageConfigRequest) ProtoMessage() {} func (*ResolveImageConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{4} + return fileDescriptor_f1a937782ebbded5, []int{8} } func (m *ResolveImageConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -356,15 +508,15 @@ func (m *ResolveImageConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ResolveImageConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ResolveImageConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResolveImageConfigRequest.Merge(dst, src) +func (m *ResolveImageConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResolveImageConfigRequest.Merge(m, src) } func (m *ResolveImageConfigRequest) XXX_Size() int { return m.Size() @@ -415,7 +567,7 @@ func (m *ResolveImageConfigResponse) Reset() { *m = ResolveImageConfigRe func (m *ResolveImageConfigResponse) String() string { return proto.CompactTextString(m) } func (*ResolveImageConfigResponse) ProtoMessage() {} func (*ResolveImageConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{5} + return fileDescriptor_f1a937782ebbded5, []int{9} } func (m *ResolveImageConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -425,15 +577,15 @@ func (m *ResolveImageConfigResponse) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ResolveImageConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ResolveImageConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResolveImageConfigResponse.Merge(dst, src) +func (m *ResolveImageConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResolveImageConfigResponse.Merge(m, src) } func (m *ResolveImageConfigResponse) XXX_Size() int { return m.Size() @@ -461,22 +613,25 @@ type SolveRequest struct { // for each of the ImportCacheRefs entry to CacheImports for compatibility. (planned to be removed) ImportCacheRefsDeprecated []string `protobuf:"bytes,4,rep,name=ImportCacheRefsDeprecated,proto3" json:"ImportCacheRefsDeprecated,omitempty"` AllowResultReturn bool `protobuf:"varint,5,opt,name=allowResultReturn,proto3" json:"allowResultReturn,omitempty"` + AllowResultArrayRef bool `protobuf:"varint,6,opt,name=allowResultArrayRef,proto3" json:"allowResultArrayRef,omitempty"` // apicaps.CapSolveInlineReturn deprecated Final bool `protobuf:"varint,10,opt,name=Final,proto3" json:"Final,omitempty"` ExporterAttr []byte `protobuf:"bytes,11,opt,name=ExporterAttr,proto3" json:"ExporterAttr,omitempty"` // CacheImports was added in BuildKit v0.4.0. // apicaps:CapImportCaches - CacheImports []*CacheOptionsEntry `protobuf:"bytes,12,rep,name=CacheImports,proto3" json:"CacheImports,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CacheImports []*CacheOptionsEntry `protobuf:"bytes,12,rep,name=CacheImports,proto3" json:"CacheImports,omitempty"` + // apicaps:CapFrontendInputs + FrontendInputs map[string]*pb.Definition `protobuf:"bytes,13,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SolveRequest) Reset() { *m = SolveRequest{} } func (m *SolveRequest) String() string { return proto.CompactTextString(m) } func (*SolveRequest) ProtoMessage() {} func (*SolveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{6} + return fileDescriptor_f1a937782ebbded5, []int{10} } func (m *SolveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,15 +641,15 @@ func (m *SolveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SolveRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *SolveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SolveRequest.Merge(dst, src) +func (m *SolveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SolveRequest.Merge(m, src) } func (m *SolveRequest) XXX_Size() int { return m.Size() @@ -540,6 +695,13 @@ func (m *SolveRequest) GetAllowResultReturn() bool { return false } +func (m *SolveRequest) GetAllowResultArrayRef() bool { + if m != nil { + return m.AllowResultArrayRef + } + return false +} + func (m *SolveRequest) GetFinal() bool { if m != nil { return m.Final @@ -561,6 +723,13 @@ func (m *SolveRequest) GetCacheImports() []*CacheOptionsEntry { return nil } +func (m *SolveRequest) GetFrontendInputs() map[string]*pb.Definition { + if m != nil { + return m.FrontendInputs + } + return nil +} + // CacheOptionsEntry corresponds to the control.CacheOptionsEntry type CacheOptionsEntry struct { Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` @@ -574,7 +743,7 @@ func (m *CacheOptionsEntry) Reset() { *m = CacheOptionsEntry{} } func (m *CacheOptionsEntry) String() string { return proto.CompactTextString(m) } func (*CacheOptionsEntry) ProtoMessage() {} func (*CacheOptionsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{7} + return fileDescriptor_f1a937782ebbded5, []int{11} } func (m *CacheOptionsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -584,15 +753,15 @@ func (m *CacheOptionsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_CacheOptionsEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CacheOptionsEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheOptionsEntry.Merge(dst, src) +func (m *CacheOptionsEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheOptionsEntry.Merge(m, src) } func (m *CacheOptionsEntry) XXX_Size() int { return m.Size() @@ -631,7 +800,7 @@ func (m *SolveResponse) Reset() { *m = SolveResponse{} } func (m *SolveResponse) String() string { return proto.CompactTextString(m) } func (*SolveResponse) ProtoMessage() {} func (*SolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{8} + return fileDescriptor_f1a937782ebbded5, []int{12} } func (m *SolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -641,15 +810,15 @@ func (m *SolveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_SolveResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *SolveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SolveResponse.Merge(dst, src) +func (m *SolveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SolveResponse.Merge(m, src) } func (m *SolveResponse) XXX_Size() int { return m.Size() @@ -687,7 +856,7 @@ func (m *ReadFileRequest) Reset() { *m = ReadFileRequest{} } func (m *ReadFileRequest) String() string { return proto.CompactTextString(m) } func (*ReadFileRequest) ProtoMessage() {} func (*ReadFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{9} + return fileDescriptor_f1a937782ebbded5, []int{13} } func (m *ReadFileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -697,15 +866,15 @@ func (m *ReadFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ReadFileRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReadFileRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadFileRequest.Merge(dst, src) +func (m *ReadFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileRequest.Merge(m, src) } func (m *ReadFileRequest) XXX_Size() int { return m.Size() @@ -749,7 +918,7 @@ func (m *FileRange) Reset() { *m = FileRange{} } func (m *FileRange) String() string { return proto.CompactTextString(m) } func (*FileRange) ProtoMessage() {} func (*FileRange) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{10} + return fileDescriptor_f1a937782ebbded5, []int{14} } func (m *FileRange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -759,15 +928,15 @@ func (m *FileRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileRange.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *FileRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileRange.Merge(dst, src) +func (m *FileRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileRange.Merge(m, src) } func (m *FileRange) XXX_Size() int { return m.Size() @@ -803,7 +972,7 @@ func (m *ReadFileResponse) Reset() { *m = ReadFileResponse{} } func (m *ReadFileResponse) String() string { return proto.CompactTextString(m) } func (*ReadFileResponse) ProtoMessage() {} func (*ReadFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{11} + return fileDescriptor_f1a937782ebbded5, []int{15} } func (m *ReadFileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -813,15 +982,15 @@ func (m *ReadFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ReadFileResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReadFileResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadFileResponse.Merge(dst, src) +func (m *ReadFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileResponse.Merge(m, src) } func (m *ReadFileResponse) XXX_Size() int { return m.Size() @@ -852,7 +1021,7 @@ func (m *ReadDirRequest) Reset() { *m = ReadDirRequest{} } func (m *ReadDirRequest) String() string { return proto.CompactTextString(m) } func (*ReadDirRequest) ProtoMessage() {} func (*ReadDirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{12} + return fileDescriptor_f1a937782ebbded5, []int{16} } func (m *ReadDirRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -862,15 +1031,15 @@ func (m *ReadDirRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ReadDirRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReadDirRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadDirRequest.Merge(dst, src) +func (m *ReadDirRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadDirRequest.Merge(m, src) } func (m *ReadDirRequest) XXX_Size() int { return m.Size() @@ -913,7 +1082,7 @@ func (m *ReadDirResponse) Reset() { *m = ReadDirResponse{} } func (m *ReadDirResponse) String() string { return proto.CompactTextString(m) } func (*ReadDirResponse) ProtoMessage() {} func (*ReadDirResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{13} + return fileDescriptor_f1a937782ebbded5, []int{17} } func (m *ReadDirResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -923,15 +1092,15 @@ func (m *ReadDirResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ReadDirResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *ReadDirResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadDirResponse.Merge(dst, src) +func (m *ReadDirResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadDirResponse.Merge(m, src) } func (m *ReadDirResponse) XXX_Size() int { return m.Size() @@ -961,7 +1130,7 @@ func (m *StatFileRequest) Reset() { *m = StatFileRequest{} } func (m *StatFileRequest) String() string { return proto.CompactTextString(m) } func (*StatFileRequest) ProtoMessage() {} func (*StatFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{14} + return fileDescriptor_f1a937782ebbded5, []int{18} } func (m *StatFileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -971,15 +1140,15 @@ func (m *StatFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_StatFileRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *StatFileRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatFileRequest.Merge(dst, src) +func (m *StatFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatFileRequest.Merge(m, src) } func (m *StatFileRequest) XXX_Size() int { return m.Size() @@ -1015,7 +1184,7 @@ func (m *StatFileResponse) Reset() { *m = StatFileResponse{} } func (m *StatFileResponse) String() string { return proto.CompactTextString(m) } func (*StatFileResponse) ProtoMessage() {} func (*StatFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{15} + return fileDescriptor_f1a937782ebbded5, []int{19} } func (m *StatFileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1025,15 +1194,15 @@ func (m *StatFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_StatFileResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *StatFileResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatFileResponse.Merge(dst, src) +func (m *StatFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatFileResponse.Merge(m, src) } func (m *StatFileResponse) XXX_Size() int { return m.Size() @@ -1061,7 +1230,7 @@ func (m *PingRequest) Reset() { *m = PingRequest{} } func (m *PingRequest) String() string { return proto.CompactTextString(m) } func (*PingRequest) ProtoMessage() {} func (*PingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{16} + return fileDescriptor_f1a937782ebbded5, []int{20} } func (m *PingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1071,15 +1240,15 @@ func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *PingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingRequest.Merge(dst, src) +func (m *PingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PingRequest.Merge(m, src) } func (m *PingRequest) XXX_Size() int { return m.Size() @@ -1103,7 +1272,7 @@ func (m *PongResponse) Reset() { *m = PongResponse{} } func (m *PongResponse) String() string { return proto.CompactTextString(m) } func (*PongResponse) ProtoMessage() {} func (*PongResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{17} + return fileDescriptor_f1a937782ebbded5, []int{21} } func (m *PongResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1113,15 +1282,15 @@ func (m *PongResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PongResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *PongResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PongResponse.Merge(dst, src) +func (m *PongResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PongResponse.Merge(m, src) } func (m *PongResponse) XXX_Size() int { return m.Size() @@ -1156,13 +1325,20 @@ func (m *PongResponse) GetWorkers() []*types1.WorkerRecord { func init() { proto.RegisterType((*Result)(nil), "moby.buildkit.v1.frontend.Result") proto.RegisterMapType((map[string][]byte)(nil), "moby.buildkit.v1.frontend.Result.MetadataEntry") + proto.RegisterType((*RefMapDeprecated)(nil), "moby.buildkit.v1.frontend.RefMapDeprecated") + proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry") + proto.RegisterType((*Ref)(nil), "moby.buildkit.v1.frontend.Ref") proto.RegisterType((*RefMap)(nil), "moby.buildkit.v1.frontend.RefMap") - proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.RefMap.RefsEntry") + proto.RegisterMapType((map[string]*Ref)(nil), "moby.buildkit.v1.frontend.RefMap.RefsEntry") proto.RegisterType((*ReturnRequest)(nil), "moby.buildkit.v1.frontend.ReturnRequest") proto.RegisterType((*ReturnResponse)(nil), "moby.buildkit.v1.frontend.ReturnResponse") + proto.RegisterType((*InputsRequest)(nil), "moby.buildkit.v1.frontend.InputsRequest") + proto.RegisterType((*InputsResponse)(nil), "moby.buildkit.v1.frontend.InputsResponse") + proto.RegisterMapType((map[string]*pb.Definition)(nil), "moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntry") proto.RegisterType((*ResolveImageConfigRequest)(nil), "moby.buildkit.v1.frontend.ResolveImageConfigRequest") proto.RegisterType((*ResolveImageConfigResponse)(nil), "moby.buildkit.v1.frontend.ResolveImageConfigResponse") proto.RegisterType((*SolveRequest)(nil), "moby.buildkit.v1.frontend.SolveRequest") + proto.RegisterMapType((map[string]*pb.Definition)(nil), "moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntry") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntry") proto.RegisterType((*CacheOptionsEntry)(nil), "moby.buildkit.v1.frontend.CacheOptionsEntry") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntry") @@ -1178,6 +1354,102 @@ func init() { proto.RegisterType((*PongResponse)(nil), "moby.buildkit.v1.frontend.PongResponse") } +func init() { proto.RegisterFile("gateway.proto", fileDescriptor_f1a937782ebbded5) } + +var fileDescriptor_f1a937782ebbded5 = []byte{ + // 1436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0x36, 0xad, 0x1f, 0x5b, 0x47, 0x92, 0xad, 0x4c, 0x2e, 0x2e, 0x14, 0x2e, 0x1c, 0x5d, 0x22, + 0xf0, 0x55, 0x12, 0x87, 0x6a, 0x9d, 0x04, 0x4e, 0x9d, 0x22, 0x69, 0x14, 0x27, 0xb0, 0x5b, 0x3b, + 0x51, 0x27, 0x2d, 0x02, 0x04, 0x29, 0x50, 0x4a, 0x1c, 0x32, 0x44, 0x24, 0x0e, 0x3b, 0x1c, 0x25, + 0x15, 0xba, 0x69, 0x77, 0xdd, 0x17, 0xe8, 0x03, 0xf4, 0x01, 0x8a, 0x3e, 0x41, 0xd7, 0x59, 0x76, + 0x59, 0x74, 0x11, 0x14, 0x7e, 0x92, 0x62, 0x7e, 0x68, 0x51, 0xb2, 0x4c, 0x59, 0xe8, 0x4a, 0x33, + 0x87, 0xe7, 0x3b, 0x73, 0xce, 0x37, 0xe7, 0x67, 0x04, 0x55, 0xdf, 0xe1, 0xe4, 0xad, 0x33, 0xb2, + 0x23, 0x46, 0x39, 0x45, 0x97, 0x06, 0xb4, 0x3b, 0xb2, 0xbb, 0xc3, 0xa0, 0xef, 0xbe, 0x0e, 0xb8, + 0xfd, 0xe6, 0x43, 0xdb, 0x63, 0x34, 0xe4, 0x24, 0x74, 0xcd, 0x1b, 0x7e, 0xc0, 0x5f, 0x0d, 0xbb, + 0x76, 0x8f, 0x0e, 0x5a, 0x3e, 0xf5, 0x69, 0x4b, 0x22, 0xba, 0x43, 0x4f, 0xee, 0xe4, 0x46, 0xae, + 0x94, 0x25, 0x73, 0x7b, 0x5a, 0xdd, 0xa7, 0xd4, 0xef, 0x13, 0x27, 0x0a, 0x62, 0xbd, 0x6c, 0xb1, + 0xa8, 0xd7, 0x8a, 0xb9, 0xc3, 0x87, 0xb1, 0xc6, 0x6c, 0xa5, 0x30, 0xc2, 0x91, 0x56, 0xe2, 0x48, + 0x2b, 0xa6, 0xfd, 0x37, 0x84, 0xb5, 0xa2, 0x6e, 0x8b, 0x46, 0x89, 0x76, 0xeb, 0x4c, 0x6d, 0x27, + 0x0a, 0x5a, 0x7c, 0x14, 0x91, 0xb8, 0xf5, 0x96, 0xb2, 0xd7, 0x84, 0x69, 0xc0, 0xcd, 0x33, 0x01, + 0x43, 0x1e, 0xf4, 0x05, 0xaa, 0xe7, 0x44, 0xb1, 0x38, 0x44, 0xfc, 0x6a, 0x50, 0x3a, 0x6c, 0x4e, + 0xc3, 0x20, 0xe6, 0x41, 0xe0, 0x07, 0x2d, 0x2f, 0x96, 0x18, 0x75, 0x8a, 0x08, 0x42, 0xa9, 0x5b, + 0x3f, 0xe6, 0xa0, 0x88, 0x49, 0x3c, 0xec, 0x73, 0xb4, 0x09, 0x55, 0x46, 0xbc, 0x3d, 0x12, 0x31, + 0xd2, 0x73, 0x38, 0x71, 0xeb, 0x46, 0xc3, 0x68, 0x96, 0xf6, 0x97, 0xf0, 0xa4, 0x18, 0x7d, 0x09, + 0x6b, 0x8c, 0x78, 0x71, 0x4a, 0x71, 0xb9, 0x61, 0x34, 0xcb, 0xdb, 0xd7, 0xed, 0x33, 0x2f, 0xc3, + 0xc6, 0xc4, 0x3b, 0x72, 0xa2, 0x31, 0x64, 0x7f, 0x09, 0x4f, 0x19, 0x41, 0xdb, 0x90, 0x63, 0xc4, + 0xab, 0xe7, 0xa4, 0xad, 0x8d, 0x6c, 0x5b, 0xfb, 0x4b, 0x58, 0x28, 0xa3, 0x1d, 0xc8, 0x0b, 0x2b, + 0xf5, 0xbc, 0x04, 0xfd, 0x6f, 0xae, 0x03, 0xfb, 0x4b, 0x58, 0x02, 0xd0, 0x67, 0xb0, 0x3a, 0x20, + 0xdc, 0x71, 0x1d, 0xee, 0xd4, 0xa1, 0x91, 0x6b, 0x96, 0xb7, 0x5b, 0x99, 0x60, 0x41, 0x90, 0x7d, + 0xa4, 0x11, 0x8f, 0x42, 0xce, 0x46, 0xf8, 0xc4, 0x80, 0x79, 0x17, 0xaa, 0x13, 0x9f, 0x50, 0x0d, + 0x72, 0xaf, 0xc9, 0x48, 0xf1, 0x87, 0xc5, 0x12, 0xfd, 0x07, 0x0a, 0x6f, 0x9c, 0xfe, 0x90, 0x48, + 0xaa, 0x2a, 0x58, 0x6d, 0x76, 0x97, 0xef, 0x18, 0xed, 0x55, 0x28, 0x32, 0x69, 0xde, 0xfa, 0xd9, + 0x80, 0xda, 0x34, 0x4f, 0xe8, 0x40, 0x47, 0x68, 0x48, 0x27, 0x6f, 0x2f, 0x40, 0xb1, 0x10, 0xc4, + 0xca, 0x55, 0x69, 0xc2, 0xdc, 0x81, 0xd2, 0x89, 0x68, 0x9e, 0x8b, 0xa5, 0x94, 0x8b, 0xd6, 0x0e, + 0xe4, 0x30, 0xf1, 0xd0, 0x1a, 0x2c, 0x07, 0x3a, 0x29, 0xf0, 0x72, 0xe0, 0xa2, 0x06, 0xe4, 0x5c, + 0xe2, 0xe9, 0xcb, 0x5f, 0xb3, 0xa3, 0xae, 0xbd, 0x47, 0xbc, 0x20, 0x0c, 0x78, 0x40, 0x43, 0x2c, + 0x3e, 0x59, 0xbf, 0x18, 0x22, 0xb9, 0x84, 0x5b, 0xe8, 0xfe, 0x44, 0x1c, 0xf3, 0x53, 0xe5, 0x94, + 0xf7, 0xcf, 0xb3, 0xbd, 0xbf, 0x95, 0xf6, 0x7e, 0x6e, 0xfe, 0xa4, 0xa3, 0xe3, 0x50, 0xc5, 0x84, + 0x0f, 0x59, 0x88, 0xc9, 0x37, 0x43, 0x12, 0x73, 0xf4, 0x51, 0x72, 0x23, 0xd2, 0xfe, 0xbc, 0xb4, + 0x12, 0x8a, 0x58, 0x03, 0x50, 0x13, 0x0a, 0x84, 0x31, 0xca, 0xb4, 0x17, 0xc8, 0x56, 0x9d, 0xc3, + 0x66, 0x51, 0xcf, 0x7e, 0x26, 0x3b, 0x07, 0x56, 0x0a, 0x56, 0x0d, 0xd6, 0x92, 0x53, 0xe3, 0x88, + 0x86, 0x31, 0xb1, 0xd6, 0xa1, 0x7a, 0x10, 0x46, 0x43, 0x1e, 0x6b, 0x3f, 0xac, 0xdf, 0x0d, 0x58, + 0x4b, 0x24, 0x4a, 0x07, 0xbd, 0x84, 0xf2, 0x98, 0xe3, 0x84, 0xcc, 0xdd, 0x0c, 0xff, 0x26, 0xf1, + 0xa9, 0x0b, 0xd2, 0xdc, 0xa6, 0xcd, 0x99, 0x4f, 0xa0, 0x36, 0xad, 0x30, 0x83, 0xe9, 0x2b, 0x93, + 0x4c, 0x4f, 0x5f, 0x7c, 0x8a, 0xd9, 0x9f, 0x0c, 0xb8, 0x84, 0x89, 0x6c, 0x85, 0x07, 0x03, 0xc7, + 0x27, 0x0f, 0x69, 0xe8, 0x05, 0x7e, 0x42, 0x73, 0x4d, 0x66, 0x55, 0x62, 0x59, 0x24, 0x58, 0x13, + 0x56, 0x3b, 0x7d, 0x87, 0x7b, 0x94, 0x0d, 0xb4, 0xf1, 0x8a, 0x30, 0x9e, 0xc8, 0xf0, 0xc9, 0x57, + 0xd4, 0x80, 0xb2, 0x36, 0x7c, 0x44, 0x5d, 0x22, 0x7b, 0x46, 0x09, 0xa7, 0x45, 0xa8, 0x0e, 0x2b, + 0x87, 0xd4, 0x7f, 0xe2, 0x0c, 0x88, 0x6c, 0x0e, 0x25, 0x9c, 0x6c, 0xad, 0xef, 0x0d, 0x30, 0x67, + 0x79, 0xa5, 0x29, 0xfe, 0x14, 0x8a, 0x7b, 0x81, 0x4f, 0x62, 0x75, 0xfb, 0xa5, 0xf6, 0xf6, 0xbb, + 0xf7, 0x97, 0x97, 0xfe, 0x7a, 0x7f, 0xf9, 0x5a, 0xaa, 0xaf, 0xd2, 0x88, 0x84, 0x3d, 0x1a, 0x72, + 0x27, 0x08, 0x09, 0x13, 0xe3, 0xe1, 0x86, 0x2b, 0x21, 0xb6, 0x42, 0x62, 0x6d, 0x01, 0xfd, 0x17, + 0x8a, 0xca, 0xba, 0x2e, 0x7b, 0xbd, 0xb3, 0xfe, 0x2c, 0x40, 0xe5, 0x99, 0x70, 0x20, 0xe1, 0xc2, + 0x06, 0x18, 0x53, 0xa8, 0xd3, 0x6e, 0x9a, 0xd8, 0x94, 0x06, 0x32, 0x61, 0xf5, 0xb1, 0xbe, 0x62, + 0x5d, 0xae, 0x27, 0x7b, 0xf4, 0x02, 0xca, 0xc9, 0xfa, 0x69, 0xc4, 0xeb, 0x39, 0x99, 0x23, 0x77, + 0x32, 0x72, 0x24, 0xed, 0x89, 0x9d, 0x82, 0xea, 0x0c, 0x49, 0x49, 0xd0, 0xc7, 0x70, 0xe9, 0x60, + 0x10, 0x51, 0xc6, 0x1f, 0x3a, 0xbd, 0x57, 0x04, 0x4f, 0x4e, 0x81, 0x7c, 0x23, 0xd7, 0x2c, 0xe1, + 0xb3, 0x15, 0xd0, 0x16, 0x5c, 0x70, 0xfa, 0x7d, 0xfa, 0x56, 0x17, 0x8d, 0x4c, 0xff, 0x7a, 0xa1, + 0x61, 0x34, 0x57, 0xf1, 0xe9, 0x0f, 0xe8, 0x03, 0xb8, 0x98, 0x12, 0x3e, 0x60, 0xcc, 0x19, 0x89, + 0x7c, 0x29, 0x4a, 0xfd, 0x59, 0x9f, 0x44, 0x07, 0x7b, 0x1c, 0x84, 0x4e, 0xbf, 0x0e, 0x52, 0x47, + 0x6d, 0x90, 0x05, 0x95, 0x47, 0xdf, 0x0a, 0x97, 0x08, 0x7b, 0xc0, 0x39, 0xab, 0x97, 0xe5, 0x55, + 0x4c, 0xc8, 0x50, 0x07, 0x2a, 0xd2, 0x61, 0xe5, 0x7b, 0x5c, 0xaf, 0x48, 0xd2, 0xb6, 0x32, 0x48, + 0x93, 0xea, 0x4f, 0xa3, 0x54, 0x29, 0x4d, 0x58, 0x40, 0x3d, 0x58, 0x4b, 0x88, 0x53, 0x35, 0x58, + 0xaf, 0x4a, 0x9b, 0x77, 0x17, 0xbd, 0x08, 0x85, 0x56, 0x47, 0x4c, 0x99, 0x34, 0xef, 0x41, 0x6d, + 0xfa, 0xbe, 0x16, 0x69, 0xec, 0xe6, 0xe7, 0x70, 0x71, 0xc6, 0x31, 0xff, 0xaa, 0xe6, 0x7f, 0x33, + 0xe0, 0xc2, 0x29, 0x6e, 0x10, 0x82, 0xfc, 0x17, 0xa3, 0x88, 0x68, 0x93, 0x72, 0x8d, 0x8e, 0xa0, + 0x20, 0xb8, 0x8f, 0xeb, 0xcb, 0x92, 0x98, 0x9d, 0x45, 0xc8, 0xb6, 0x25, 0x52, 0x91, 0xa2, 0xac, + 0x98, 0x77, 0x00, 0xc6, 0xc2, 0x85, 0xc6, 0xdb, 0x4b, 0xa8, 0x6a, 0xe6, 0x75, 0x0b, 0xa8, 0xa9, + 0x97, 0x88, 0x06, 0x8b, 0x77, 0xc6, 0x78, 0x24, 0xe4, 0x16, 0x1c, 0x09, 0xd6, 0x77, 0xb0, 0x8e, + 0x89, 0xe3, 0x3e, 0x0e, 0xfa, 0xe4, 0xec, 0xce, 0x27, 0xea, 0x39, 0xe8, 0x93, 0x8e, 0xc3, 0x5f, + 0x9d, 0xd4, 0xb3, 0xde, 0xa3, 0x5d, 0x28, 0x60, 0x27, 0xf4, 0x89, 0x3e, 0xfa, 0x4a, 0xc6, 0xd1, + 0xf2, 0x10, 0xa1, 0x8b, 0x15, 0xc4, 0xba, 0x0b, 0xa5, 0x13, 0x99, 0xe8, 0x46, 0x4f, 0x3d, 0x2f, + 0x26, 0xaa, 0xb3, 0xe5, 0xb0, 0xde, 0x09, 0xf9, 0x21, 0x09, 0x7d, 0x7d, 0x74, 0x0e, 0xeb, 0x9d, + 0xb5, 0x29, 0x9e, 0x23, 0x89, 0xe7, 0x9a, 0x1a, 0x04, 0xf9, 0x3d, 0xf1, 0x66, 0x32, 0x64, 0x11, + 0xc9, 0xb5, 0xe5, 0x8a, 0x51, 0xe6, 0xb8, 0x7b, 0x01, 0x3b, 0x3b, 0xc0, 0x3a, 0xac, 0xec, 0x05, + 0x2c, 0x15, 0x5f, 0xb2, 0x45, 0x9b, 0x62, 0xc8, 0xf5, 0xfa, 0x43, 0x57, 0x44, 0xcb, 0x09, 0x0b, + 0x75, 0x37, 0x9f, 0x92, 0x5a, 0xf7, 0x15, 0x8f, 0xf2, 0x14, 0xed, 0xcc, 0x16, 0xac, 0x90, 0x90, + 0xb3, 0x80, 0x24, 0x93, 0x10, 0xd9, 0xea, 0x99, 0x6b, 0xcb, 0x67, 0xae, 0x9c, 0xb8, 0x38, 0x51, + 0xb1, 0x76, 0x60, 0x5d, 0x08, 0xb2, 0x2f, 0x02, 0x41, 0x3e, 0xe5, 0xa4, 0x5c, 0x5b, 0xbb, 0x50, + 0x1b, 0x03, 0xf5, 0xd1, 0x9b, 0x90, 0x17, 0x8f, 0x68, 0xdd, 0xaa, 0x67, 0x9d, 0x2b, 0xbf, 0x5b, + 0x55, 0x28, 0x77, 0x82, 0x30, 0x99, 0x79, 0xd6, 0xb1, 0x01, 0x95, 0x0e, 0x0d, 0xc7, 0xd3, 0xa6, + 0x03, 0xeb, 0x49, 0x05, 0x3e, 0xe8, 0x1c, 0x3c, 0x74, 0xa2, 0x24, 0x94, 0xc6, 0xe9, 0x6b, 0xd6, + 0xef, 0x7d, 0x5b, 0x29, 0xb6, 0xf3, 0x62, 0x30, 0xe1, 0x69, 0x38, 0xfa, 0x04, 0x56, 0x0e, 0x0f, + 0xdb, 0xd2, 0xd2, 0xf2, 0x42, 0x96, 0x12, 0x18, 0xba, 0x07, 0x2b, 0xcf, 0xe5, 0xdf, 0x90, 0x58, + 0x0f, 0x8f, 0x19, 0x29, 0xa7, 0x02, 0x55, 0x6a, 0x98, 0xf4, 0x28, 0x73, 0x71, 0x02, 0xda, 0xfe, + 0xb5, 0x08, 0xa5, 0xc3, 0xc3, 0x76, 0x9b, 0x05, 0xae, 0x4f, 0xd0, 0x0f, 0x06, 0xa0, 0xd3, 0xe3, + 0x16, 0xdd, 0xca, 0xae, 0xa0, 0xd9, 0x6f, 0x06, 0xf3, 0xf6, 0x82, 0x28, 0xcd, 0xf2, 0x0b, 0x28, + 0xc8, 0x0a, 0x47, 0xff, 0x3f, 0x67, 0xf7, 0x35, 0x9b, 0xf3, 0x15, 0xb5, 0xed, 0x1e, 0xac, 0x26, + 0x55, 0x82, 0xae, 0x65, 0xba, 0x37, 0xd1, 0x04, 0xcc, 0xeb, 0xe7, 0xd2, 0xd5, 0x87, 0x7c, 0x0d, + 0x2b, 0x3a, 0xf9, 0xd1, 0xd5, 0x39, 0xb8, 0x71, 0x19, 0x9a, 0xd7, 0xce, 0xa3, 0x3a, 0x0e, 0x23, + 0x49, 0xf2, 0xcc, 0x30, 0xa6, 0x4a, 0x28, 0x33, 0x8c, 0x53, 0x55, 0xf3, 0x1c, 0xf2, 0xa2, 0x1a, + 0xd0, 0x66, 0x06, 0x28, 0x55, 0x2e, 0x66, 0xd6, 0x75, 0x4d, 0x94, 0xd1, 0x57, 0xe2, 0x7f, 0x86, + 0x7c, 0x35, 0x34, 0x33, 0x63, 0x4e, 0x3d, 0xf3, 0xcd, 0xab, 0xe7, 0xd0, 0x1c, 0x9b, 0x57, 0xf3, + 0x31, 0xd3, 0xfc, 0xc4, 0xeb, 0x3d, 0xd3, 0xfc, 0xe4, 0xab, 0xbc, 0x5d, 0x79, 0x77, 0xbc, 0x61, + 0xfc, 0x71, 0xbc, 0x61, 0xfc, 0x7d, 0xbc, 0x61, 0x74, 0x8b, 0xf2, 0x8f, 0xf9, 0xcd, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xa9, 0x05, 0x0f, 0x9d, 0xea, 0x10, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -1202,6 +1474,8 @@ type LLBBridgeClient interface { StatFile(ctx context.Context, in *StatFileRequest, opts ...grpc.CallOption) (*StatFileResponse, error) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) Return(ctx context.Context, in *ReturnRequest, opts ...grpc.CallOption) (*ReturnResponse, error) + // apicaps:CapFrontendInputs + Inputs(ctx context.Context, in *InputsRequest, opts ...grpc.CallOption) (*InputsResponse, error) } type lLBBridgeClient struct { @@ -1275,6 +1549,15 @@ func (c *lLBBridgeClient) Return(ctx context.Context, in *ReturnRequest, opts .. return out, nil } +func (c *lLBBridgeClient) Inputs(ctx context.Context, in *InputsRequest, opts ...grpc.CallOption) (*InputsResponse, error) { + out := new(InputsResponse) + err := c.cc.Invoke(ctx, "/moby.buildkit.v1.frontend.LLBBridge/Inputs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // LLBBridgeServer is the server API for LLBBridge service. type LLBBridgeServer interface { // apicaps:CapResolveImage @@ -1289,6 +1572,37 @@ type LLBBridgeServer interface { StatFile(context.Context, *StatFileRequest) (*StatFileResponse, error) Ping(context.Context, *PingRequest) (*PongResponse, error) Return(context.Context, *ReturnRequest) (*ReturnResponse, error) + // apicaps:CapFrontendInputs + Inputs(context.Context, *InputsRequest) (*InputsResponse, error) +} + +// UnimplementedLLBBridgeServer can be embedded to have forward compatible implementations. +type UnimplementedLLBBridgeServer struct { +} + +func (*UnimplementedLLBBridgeServer) ResolveImageConfig(ctx context.Context, req *ResolveImageConfigRequest) (*ResolveImageConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolveImageConfig not implemented") +} +func (*UnimplementedLLBBridgeServer) Solve(ctx context.Context, req *SolveRequest) (*SolveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Solve not implemented") +} +func (*UnimplementedLLBBridgeServer) ReadFile(ctx context.Context, req *ReadFileRequest) (*ReadFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReadFile not implemented") +} +func (*UnimplementedLLBBridgeServer) ReadDir(ctx context.Context, req *ReadDirRequest) (*ReadDirResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReadDir not implemented") +} +func (*UnimplementedLLBBridgeServer) StatFile(ctx context.Context, req *StatFileRequest) (*StatFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatFile not implemented") +} +func (*UnimplementedLLBBridgeServer) Ping(ctx context.Context, req *PingRequest) (*PongResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (*UnimplementedLLBBridgeServer) Return(ctx context.Context, req *ReturnRequest) (*ReturnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Return not implemented") +} +func (*UnimplementedLLBBridgeServer) Inputs(ctx context.Context, req *InputsRequest) (*InputsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Inputs not implemented") } func RegisterLLBBridgeServer(s *grpc.Server, srv LLBBridgeServer) { @@ -1421,6 +1735,24 @@ func _LLBBridge_Return_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _LLBBridge_Inputs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InputsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LLBBridgeServer).Inputs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/moby.buildkit.v1.frontend.LLBBridge/Inputs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LLBBridgeServer).Inputs(ctx, req.(*InputsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _LLBBridge_serviceDesc = grpc.ServiceDesc{ ServiceName: "moby.buildkit.v1.frontend.LLBBridge", HandlerType: (*LLBBridgeServer)(nil), @@ -1453,6 +1785,10 @@ var _LLBBridge_serviceDesc = grpc.ServiceDesc{ MethodName: "Return", Handler: _LLBBridge_Return_Handler, }, + { + MethodName: "Inputs", + Handler: _LLBBridge_Inputs_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "gateway.proto", @@ -1461,7 +1797,7 @@ var _LLBBridge_serviceDesc = grpc.ServiceDesc{ func (m *Result) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1469,72 +1805,225 @@ func (m *Result) Marshal() (dAtA []byte, err error) { } func (m *Result) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Result != nil { - nn1, err := m.Result.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Metadata) > 0 { - for k, _ := range m.Metadata { - dAtA[i] = 0x52 - i++ + for k := range m.Metadata { v := m.Metadata[k] - byteSize := 0 + baseI := i if len(v) > 0 { - byteSize = 1 + len(v) + sovGateway(uint64(len(v))) - } - mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + byteSize - i = encodeVarintGateway(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if len(v) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintGateway(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + if m.Result != nil { + { + size := m.Result.Size() + i -= size + if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { + return 0, err } } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } -func (m *Result_Ref) MarshalTo(dAtA []byte) (int, error) { - i := 0 +func (m *Result_RefDeprecated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_RefDeprecated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.RefDeprecated) + copy(dAtA[i:], m.RefDeprecated) + i = encodeVarintGateway(dAtA, i, uint64(len(m.RefDeprecated))) + i-- dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) - return i, nil + return len(dAtA) - i, nil +} +func (m *Result_RefsDeprecated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_RefsDeprecated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RefsDeprecated != nil { + { + size, err := m.RefsDeprecated.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Ref) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Ref) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ref != nil { + { + size, err := m.Ref.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil } func (m *Result_Refs) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.Refs != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Refs.Size())) - n2, err := m.Refs.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - return i, nil + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } + +func (m *Result_Refs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Refs != nil { + { + size, err := m.Refs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *RefMapDeprecated) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RefMapDeprecated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RefMapDeprecated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Refs) > 0 { + for k := range m.Refs { + v := m.Refs[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGateway(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Ref) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Ref) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ref) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Def != nil { + { + size, err := m.Def.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *RefMap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1542,37 +2031,52 @@ func (m *RefMap) Marshal() (dAtA []byte, err error) { } func (m *RefMap) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RefMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Refs) > 0 { - for k, _ := range m.Refs { - dAtA[i] = 0xa - i++ + for k := range m.Refs { v := m.Refs[k] - mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + 1 + len(v) + sovGateway(uint64(len(v))) - i = encodeVarintGateway(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) i = encodeVarintGateway(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ReturnRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1580,40 +2084,50 @@ func (m *ReturnRequest) Marshal() (dAtA []byte, err error) { } func (m *ReturnRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReturnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Result != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Result.Size())) - n3, err := m.Result.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Error != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Error.Size())) - n4, err := m.Error.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ReturnResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1621,20 +2135,106 @@ func (m *ReturnResponse) Marshal() (dAtA []byte, err error) { } func (m *ReturnResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReturnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil +} + +func (m *InputsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InputsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InputsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *InputsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InputsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InputsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Definitions) > 0 { + for k := range m.Definitions { + v := m.Definitions[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ResolveImageConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1642,48 +2242,59 @@ func (m *ResolveImageConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *ResolveImageConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveImageConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) - } - if m.Platform != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Platform.Size())) - n5, err := m.Platform.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if len(m.ResolveMode) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.ResolveMode))) - i += copy(dAtA[i:], m.ResolveMode) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.LogName) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.LogName) + copy(dAtA[i:], m.LogName) i = encodeVarintGateway(dAtA, i, uint64(len(m.LogName))) - i += copy(dAtA[i:], m.LogName) + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ResolveMode) > 0 { + i -= len(m.ResolveMode) + copy(dAtA[i:], m.ResolveMode) + i = encodeVarintGateway(dAtA, i, uint64(len(m.ResolveMode))) + i-- + dAtA[i] = 0x1a } - return i, nil + if m.Platform != nil { + { + size, err := m.Platform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ResolveImageConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1691,32 +2302,40 @@ func (m *ResolveImageConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *ResolveImageConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveImageConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Digest) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Digest))) - i += copy(dAtA[i:], m.Digest) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Config) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Config) + copy(dAtA[i:], m.Config) i = encodeVarintGateway(dAtA, i, uint64(len(m.Config))) - i += copy(dAtA[i:], m.Config) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Digest) > 0 { + i -= len(m.Digest) + copy(dAtA[i:], m.Digest) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Digest))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SolveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1724,106 +2343,150 @@ func (m *SolveRequest) Marshal() (dAtA []byte, err error) { } func (m *SolveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Definition != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Definition.Size())) - n6, err := m.Definition.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Frontend) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Frontend))) - i += copy(dAtA[i:], m.Frontend) - } - if len(m.FrontendOpt) > 0 { - for k, _ := range m.FrontendOpt { - dAtA[i] = 0x1a - i++ - v := m.FrontendOpt[k] - mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + 1 + len(v) + sovGateway(uint64(len(v))) - i = encodeVarintGateway(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.ImportCacheRefsDeprecated) > 0 { - for _, s := range m.ImportCacheRefsDeprecated { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.FrontendInputs) > 0 { + for k := range m.FrontendInputs { + v := m.FrontendInputs[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a } } - if m.AllowResultReturn { - dAtA[i] = 0x28 - i++ - if m.AllowResultReturn { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.CacheImports) > 0 { + for iNdEx := len(m.CacheImports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CacheImports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 } - i++ + } + if len(m.ExporterAttr) > 0 { + i -= len(m.ExporterAttr) + copy(dAtA[i:], m.ExporterAttr) + i = encodeVarintGateway(dAtA, i, uint64(len(m.ExporterAttr))) + i-- + dAtA[i] = 0x5a } if m.Final { - dAtA[i] = 0x50 - i++ + i-- if m.Final { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x50 } - if len(m.ExporterAttr) > 0 { - dAtA[i] = 0x5a - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.ExporterAttr))) - i += copy(dAtA[i:], m.ExporterAttr) + if m.AllowResultArrayRef { + i-- + if m.AllowResultArrayRef { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 } - if len(m.CacheImports) > 0 { - for _, msg := range m.CacheImports { - dAtA[i] = 0x62 - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.AllowResultReturn { + i-- + if m.AllowResultReturn { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.ImportCacheRefsDeprecated) > 0 { + for iNdEx := len(m.ImportCacheRefsDeprecated) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ImportCacheRefsDeprecated[iNdEx]) + copy(dAtA[i:], m.ImportCacheRefsDeprecated[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.ImportCacheRefsDeprecated[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.FrontendOpt) > 0 { + for k := range m.FrontendOpt { + v := m.FrontendOpt[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGateway(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Frontend) > 0 { + i -= len(m.Frontend) + copy(dAtA[i:], m.Frontend) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Frontend))) + i-- + dAtA[i] = 0x12 + } + if m.Definition != nil { + { + size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *CacheOptionsEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1831,43 +2494,52 @@ func (m *CacheOptionsEntry) Marshal() (dAtA []byte, err error) { } func (m *CacheOptionsEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CacheOptionsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Type) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Attrs) > 0 { - for k, _ := range m.Attrs { - dAtA[i] = 0x12 - i++ + for k := range m.Attrs { v := m.Attrs[k] - mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + 1 + len(v) + sovGateway(uint64(len(v))) - i = encodeVarintGateway(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintGateway(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SolveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1875,36 +2547,45 @@ func (m *SolveResponse) Marshal() (dAtA []byte, err error) { } func (m *SolveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Result != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Result.Size())) - n7, err := m.Result.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ReadFileRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1912,42 +2593,52 @@ func (m *ReadFileRequest) Marshal() (dAtA []byte, err error) { } func (m *ReadFileRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadFileRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) - } - if len(m.FilePath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.FilePath))) - i += copy(dAtA[i:], m.FilePath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Range != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Range.Size())) - n8, err := m.Range.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.FilePath) > 0 { + i -= len(m.FilePath) + copy(dAtA[i:], m.FilePath) + i = encodeVarintGateway(dAtA, i, uint64(len(m.FilePath))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *FileRange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1955,30 +2646,36 @@ func (m *FileRange) Marshal() (dAtA []byte, err error) { } func (m *FileRange) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Offset != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Offset)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Length != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintGateway(dAtA, i, uint64(m.Length)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Offset != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ReadFileResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1986,26 +2683,33 @@ func (m *ReadFileResponse) Marshal() (dAtA []byte, err error) { } func (m *ReadFileResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadFileResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ReadDirRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2013,38 +2717,47 @@ func (m *ReadDirRequest) Marshal() (dAtA []byte, err error) { } func (m *ReadDirRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadDirRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) - } - if len(m.DirPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.DirPath))) - i += copy(dAtA[i:], m.DirPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.IncludePattern) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.IncludePattern) + copy(dAtA[i:], m.IncludePattern) i = encodeVarintGateway(dAtA, i, uint64(len(m.IncludePattern))) - i += copy(dAtA[i:], m.IncludePattern) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DirPath) > 0 { + i -= len(m.DirPath) + copy(dAtA[i:], m.DirPath) + i = encodeVarintGateway(dAtA, i, uint64(len(m.DirPath))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ReadDirResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2052,32 +2765,40 @@ func (m *ReadDirResponse) Marshal() (dAtA []byte, err error) { } func (m *ReadDirResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadDirResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Entries) > 0 { - for _, msg := range m.Entries { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StatFileRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2085,32 +2806,40 @@ func (m *StatFileRequest) Marshal() (dAtA []byte, err error) { } func (m *StatFileRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatFileRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Ref) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Path) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Path) + copy(dAtA[i:], m.Path) i = encodeVarintGateway(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StatFileResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2118,30 +2847,38 @@ func (m *StatFileResponse) Marshal() (dAtA []byte, err error) { } func (m *StatFileResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatFileResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Stat != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Stat.Size())) - n9, err := m.Stat.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + if m.Stat != nil { + { + size, err := m.Stat.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2149,20 +2886,26 @@ func (m *PingRequest) Marshal() (dAtA []byte, err error) { } func (m *PingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PongResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2170,60 +2913,74 @@ func (m *PongResponse) Marshal() (dAtA []byte, err error) { } func (m *PongResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PongResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.FrontendAPICaps) > 0 { - for _, msg := range m.FrontendAPICaps { - dAtA[i] = 0xa - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Workers) > 0 { + for iNdEx := len(m.Workers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Workers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } if len(m.LLBCaps) > 0 { - for _, msg := range m.LLBCaps { + for iNdEx := len(m.LLBCaps) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LLBCaps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Workers) > 0 { - for _, msg := range m.Workers { - dAtA[i] = 0x1a - i++ - i = encodeVarintGateway(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.FrontendAPICaps) > 0 { + for iNdEx := len(m.FrontendAPICaps) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FrontendAPICaps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintGateway(dAtA []byte, offset int, v uint64) int { + offset -= sovGateway(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Result) Size() (n int) { if m == nil { @@ -2252,14 +3009,38 @@ func (m *Result) Size() (n int) { return n } +func (m *Result_RefDeprecated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RefDeprecated) + n += 1 + l + sovGateway(uint64(l)) + return n +} +func (m *Result_RefsDeprecated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RefsDeprecated != nil { + l = m.RefsDeprecated.Size() + n += 1 + l + sovGateway(uint64(l)) + } + return n +} func (m *Result_Ref) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Ref) - n += 1 + l + sovGateway(uint64(l)) + if m.Ref != nil { + l = m.Ref.Size() + n += 1 + l + sovGateway(uint64(l)) + } return n } func (m *Result_Refs) Size() (n int) { @@ -2274,7 +3055,7 @@ func (m *Result_Refs) Size() (n int) { } return n } -func (m *RefMap) Size() (n int) { +func (m *RefMapDeprecated) Size() (n int) { if m == nil { return 0 } @@ -2294,6 +3075,51 @@ func (m *RefMap) Size() (n int) { return n } +func (m *Ref) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + if m.Def != nil { + l = m.Def.Size() + n += 1 + l + sovGateway(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RefMap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Refs) > 0 { + for k, v := range m.Refs { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGateway(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGateway(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGateway(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *ReturnRequest) Size() (n int) { if m == nil { return 0 @@ -2326,6 +3152,43 @@ func (m *ReturnResponse) Size() (n int) { return n } +func (m *InputsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *InputsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Definitions) > 0 { + for k, v := range m.Definitions { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGateway(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGateway(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGateway(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *ResolveImageConfigRequest) Size() (n int) { if m == nil { return 0 @@ -2405,6 +3268,9 @@ func (m *SolveRequest) Size() (n int) { if m.AllowResultReturn { n += 2 } + if m.AllowResultArrayRef { + n += 2 + } if m.Final { n += 2 } @@ -2418,6 +3284,19 @@ func (m *SolveRequest) Size() (n int) { n += 1 + l + sovGateway(uint64(l)) } } + if len(m.FrontendInputs) > 0 { + for k, v := range m.FrontendInputs { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGateway(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGateway(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGateway(uint64(mapEntrySize)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2647,14 +3526,7 @@ func (m *PongResponse) Size() (n int) { } func sovGateway(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozGateway(x uint64) (n int) { return sovGateway(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2674,7 +3546,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2690,7 +3562,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RefDeprecated", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2702,7 +3574,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2712,12 +3584,85 @@ func (m *Result) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &Result_Ref{string(dAtA[iNdEx:postIndex])} + m.Result = &Result_RefDeprecated{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RefsDeprecated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &RefMapDeprecated{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Result_RefsDeprecated{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Ref{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Result_Ref{v} + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Refs", wireType) } @@ -2731,7 +3676,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2740,6 +3685,9 @@ func (m *Result) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2763,7 +3711,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2772,6 +3720,9 @@ func (m *Result) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2792,7 +3743,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2809,7 +3760,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2819,6 +3770,9 @@ func (m *Result) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -2835,7 +3789,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapbyteLen |= (uint64(b) & 0x7F) << shift + mapbyteLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2845,6 +3799,9 @@ func (m *Result) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return ErrInvalidLengthGateway + } if postbytesIndex > l { return io.ErrUnexpectedEOF } @@ -2877,6 +3834,9 @@ func (m *Result) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2890,7 +3850,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } return nil } -func (m *RefMap) Unmarshal(dAtA []byte) error { +func (m *RefMapDeprecated) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2905,7 +3865,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2913,10 +3873,10 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RefMap: wiretype end group for non-group") + return fmt.Errorf("proto: RefMapDeprecated: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RefMap: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RefMapDeprecated: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2933,7 +3893,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2942,6 +3902,9 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2962,7 +3925,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2979,7 +3942,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2989,6 +3952,9 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -3005,7 +3971,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3015,6 +3981,9 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -3046,6 +4015,314 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Ref) Unmarshal(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 ErrIntOverflowGateway + } + 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: Ref: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ref: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + 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 ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Def", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Def == nil { + m.Def = &pb.Definition{} + } + if err := m.Def.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RefMap) Unmarshal(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 ErrIntOverflowGateway + } + 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: RefMap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RefMap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Refs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Refs == nil { + m.Refs = make(map[string]*Ref) + } + var mapkey string + var mapvalue *Ref + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + 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 ErrIntOverflowGateway + } + 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 ErrInvalidLengthGateway + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } + 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 ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGateway + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGateway + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Ref{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Refs[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3074,7 +4351,7 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3102,7 +4379,7 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3111,6 +4388,9 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3135,7 +4415,7 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3144,6 +4424,9 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3163,6 +4446,9 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3191,7 +4477,7 @@ func (m *ReturnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3214,6 +4500,246 @@ func (m *ReturnResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InputsRequest) Unmarshal(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 ErrIntOverflowGateway + } + 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: InputsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InputsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InputsResponse) Unmarshal(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 ErrIntOverflowGateway + } + 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: InputsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InputsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Definitions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Definitions == nil { + m.Definitions = make(map[string]*pb.Definition) + } + var mapkey string + var mapvalue *pb.Definition + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + 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 ErrIntOverflowGateway + } + 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 ErrInvalidLengthGateway + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } + 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 ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGateway + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGateway + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &pb.Definition{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Definitions[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3242,7 +4768,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3270,7 +4796,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3280,6 +4806,9 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3299,7 +4828,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3308,6 +4837,9 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3332,7 +4864,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3342,6 +4874,9 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3361,7 +4896,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3371,6 +4906,9 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3385,6 +4923,9 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3413,7 +4954,7 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3441,7 +4982,7 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3451,6 +4992,9 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3470,7 +5014,7 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3479,6 +5023,9 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3496,6 +5043,9 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3524,7 +5074,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3552,7 +5102,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3561,6 +5111,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3585,7 +5138,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3595,6 +5148,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3614,7 +5170,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3623,6 +5179,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3643,7 +5202,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3660,7 +5219,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3670,6 +5229,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -3686,7 +5248,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3696,6 +5258,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -3732,7 +5297,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3742,6 +5307,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3761,12 +5329,32 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } m.AllowResultReturn = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowResultArrayRef", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowResultArrayRef = bool(v != 0) case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Final", wireType) @@ -3781,7 +5369,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3801,7 +5389,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3810,6 +5398,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3832,7 +5423,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3841,6 +5432,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3849,6 +5443,135 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontendInputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrontendInputs == nil { + m.FrontendInputs = make(map[string]*pb.Definition) + } + var mapkey string + var mapvalue *pb.Definition + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + 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 ErrIntOverflowGateway + } + 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 ErrInvalidLengthGateway + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } + 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 ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGateway + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGateway + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &pb.Definition{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.FrontendInputs[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGateway(dAtA[iNdEx:]) @@ -3858,6 +5581,9 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -3886,7 +5612,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3914,7 +5640,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3924,6 +5650,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3943,7 +5672,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -3952,6 +5681,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -3972,7 +5704,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3989,7 +5721,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3999,6 +5731,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -4015,7 +5750,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4025,6 +5760,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGateway + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -4056,6 +5794,9 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4084,7 +5825,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4112,7 +5853,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4122,6 +5863,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4141,7 +5885,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4150,6 +5894,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4169,6 +5916,9 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4197,7 +5947,7 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4225,7 +5975,7 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4235,6 +5985,9 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4254,7 +6007,7 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4264,6 +6017,9 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4283,7 +6039,7 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4292,6 +6048,9 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4311,6 +6070,9 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4339,7 +6101,7 @@ func (m *FileRange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4367,7 +6129,7 @@ func (m *FileRange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Offset |= (int64(b) & 0x7F) << shift + m.Offset |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -4386,7 +6148,7 @@ func (m *FileRange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Length |= (int64(b) & 0x7F) << shift + m.Length |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -4400,6 +6162,9 @@ func (m *FileRange) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4428,7 +6193,7 @@ func (m *ReadFileResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4456,7 +6221,7 @@ func (m *ReadFileResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4465,6 +6230,9 @@ func (m *ReadFileResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4482,6 +6250,9 @@ func (m *ReadFileResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4510,7 +6281,7 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4538,7 +6309,7 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4548,6 +6319,9 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4567,7 +6341,7 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4577,6 +6351,9 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4596,7 +6373,7 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4606,6 +6383,9 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4620,6 +6400,9 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4648,7 +6431,7 @@ func (m *ReadDirResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4676,7 +6459,7 @@ func (m *ReadDirResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4685,6 +6468,9 @@ func (m *ReadDirResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4702,6 +6488,9 @@ func (m *ReadDirResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4730,7 +6519,7 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4758,7 +6547,7 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4768,6 +6557,9 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4787,7 +6579,7 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4797,6 +6589,9 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4811,6 +6606,9 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4839,7 +6637,7 @@ func (m *StatFileResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4867,7 +6665,7 @@ func (m *StatFileResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4876,6 +6674,9 @@ func (m *StatFileResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4895,6 +6696,9 @@ func (m *StatFileResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4923,7 +6727,7 @@ func (m *PingRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4946,6 +6750,9 @@ func (m *PingRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4974,7 +6781,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5002,7 +6809,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5011,6 +6818,9 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5033,7 +6843,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5042,6 +6852,9 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5064,7 +6877,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5073,6 +6886,9 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthGateway } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5090,6 +6906,9 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthGateway } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5106,6 +6925,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { func skipGateway(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -5137,10 +6957,8 @@ func skipGateway(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -5157,136 +6975,34 @@ func skipGateway(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthGateway } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGateway - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGateway(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGateway + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthGateway + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthGateway = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGateway = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthGateway = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGateway = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGateway = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("gateway.proto", fileDescriptor_gateway_eff078cadb286ceb) } - -var fileDescriptor_gateway_eff078cadb286ceb = []byte{ - // 1224 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6e, 0xdb, 0xc6, - 0x13, 0x0f, 0x23, 0xc9, 0xb6, 0xc6, 0x72, 0xa2, 0x2c, 0xfe, 0xf8, 0x83, 0xe1, 0x21, 0x51, 0x89, - 0xc2, 0x55, 0x12, 0x87, 0x44, 0x9d, 0x16, 0x4e, 0x93, 0x22, 0x69, 0x14, 0x27, 0x88, 0x5b, 0xbb, - 0x11, 0x36, 0x05, 0x02, 0x04, 0x2d, 0xd0, 0x95, 0xb8, 0x62, 0x16, 0xa1, 0xb8, 0xec, 0x72, 0x15, - 0xd7, 0xe8, 0xa5, 0xed, 0x2b, 0xf4, 0x45, 0xfa, 0x18, 0xb9, 0xb5, 0xe7, 0x1e, 0x82, 0xc2, 0xb7, - 0x5e, 0xfa, 0x0c, 0xc5, 0x7e, 0x50, 0xa2, 0x3f, 0x44, 0x5b, 0x27, 0xee, 0x2c, 0xe7, 0x37, 0xf3, - 0x9b, 0xd9, 0x99, 0xd9, 0x85, 0xb5, 0x98, 0x48, 0xba, 0x4f, 0x0e, 0x82, 0x4c, 0x70, 0xc9, 0xd1, - 0xd5, 0x31, 0x1f, 0x1c, 0x04, 0x83, 0x09, 0x4b, 0xa2, 0x37, 0x4c, 0x06, 0x6f, 0x3f, 0x0e, 0x46, - 0x82, 0xa7, 0x92, 0xa6, 0x91, 0x77, 0x3b, 0x66, 0xf2, 0xf5, 0x64, 0x10, 0x0c, 0xf9, 0x38, 0x8c, - 0x79, 0xcc, 0x43, 0x8d, 0x18, 0x4c, 0x46, 0x5a, 0xd2, 0x82, 0x5e, 0x19, 0x4b, 0xde, 0xe6, 0x71, - 0xf5, 0x98, 0xf3, 0x38, 0xa1, 0x24, 0x63, 0xb9, 0x5d, 0x86, 0x22, 0x1b, 0x86, 0xb9, 0x24, 0x72, - 0x92, 0x5b, 0xcc, 0x46, 0x09, 0xa3, 0x88, 0x84, 0x05, 0x91, 0x30, 0xe7, 0xc9, 0x5b, 0x2a, 0xc2, - 0x6c, 0x10, 0xf2, 0xac, 0xd0, 0x0e, 0xe7, 0x6a, 0x93, 0x8c, 0x85, 0xf2, 0x20, 0xa3, 0x79, 0xb8, - 0xcf, 0xc5, 0x1b, 0x2a, 0x2c, 0xe0, 0xce, 0x5c, 0xc0, 0x44, 0xb2, 0x44, 0xa1, 0x86, 0x24, 0xcb, - 0x95, 0x13, 0xf5, 0xb5, 0xa0, 0x72, 0xd8, 0x92, 0xa7, 0x2c, 0x97, 0x8c, 0xc5, 0x2c, 0x1c, 0xe5, - 0x1a, 0x63, 0xbc, 0xa8, 0x20, 0x8c, 0xba, 0xff, 0x8f, 0x03, 0x4b, 0x98, 0xe6, 0x93, 0x44, 0x22, - 0x04, 0x35, 0x41, 0x47, 0xae, 0xd3, 0x71, 0xba, 0xcd, 0x67, 0x17, 0xb0, 0x12, 0xd0, 0x16, 0xd4, - 0x05, 0x1d, 0xe5, 0xee, 0xc5, 0x8e, 0xd3, 0x5d, 0xdd, 0xfc, 0x20, 0x98, 0x9b, 0xee, 0x00, 0xd3, - 0xd1, 0x1e, 0xc9, 0x9e, 0x5d, 0xc0, 0x1a, 0x80, 0xbe, 0x82, 0x95, 0x31, 0x95, 0x24, 0x22, 0x92, - 0xb8, 0xd0, 0xa9, 0x75, 0x57, 0x37, 0xc3, 0x4a, 0xb0, 0x62, 0x10, 0xec, 0x59, 0xc4, 0x93, 0x54, - 0x8a, 0x03, 0x3c, 0x35, 0xe0, 0xdd, 0x87, 0xb5, 0x23, 0xbf, 0x50, 0x1b, 0x6a, 0x6f, 0xe8, 0x81, - 0xa1, 0x8a, 0xd5, 0x12, 0xfd, 0x0f, 0x1a, 0x6f, 0x49, 0x32, 0xa1, 0x9a, 0x69, 0x0b, 0x1b, 0xe1, - 0xde, 0xc5, 0xbb, 0x4e, 0x6f, 0x05, 0x96, 0x84, 0x36, 0xef, 0xff, 0xaa, 0x63, 0x55, 0x34, 0xd1, - 0x43, 0x1b, 0x97, 0xa3, 0xa9, 0xdd, 0x3a, 0x33, 0x2e, 0xf5, 0xc9, 0x0d, 0x2d, 0x0d, 0xf4, 0xb6, - 0xa0, 0x39, 0xdd, 0x3a, 0x8b, 0x4e, 0xb3, 0x44, 0xc7, 0x97, 0xb0, 0x86, 0xa9, 0x9c, 0x88, 0x14, - 0xd3, 0x1f, 0x26, 0x34, 0x97, 0xe8, 0xb3, 0x82, 0x9f, 0xc6, 0x9f, 0x95, 0x64, 0xa5, 0x88, 0x2d, - 0x00, 0x75, 0xa1, 0x41, 0x85, 0xe0, 0xc2, 0x1e, 0x0f, 0x0a, 0x4c, 0xa1, 0x06, 0x22, 0x1b, 0x06, - 0x2f, 0x74, 0xa1, 0x62, 0xa3, 0xe0, 0xb7, 0xe1, 0x52, 0xe1, 0x35, 0xcf, 0x78, 0x9a, 0x53, 0xff, - 0x37, 0x07, 0xae, 0x62, 0xaa, 0xeb, 0x74, 0x67, 0x4c, 0x62, 0xfa, 0x98, 0xa7, 0x23, 0x16, 0x17, - 0xa4, 0xda, 0x50, 0xc3, 0x45, 0x2d, 0x60, 0xb5, 0x44, 0x5d, 0x58, 0xe9, 0x27, 0x44, 0x8e, 0xb8, - 0x18, 0x5b, 0x77, 0xad, 0x20, 0x1b, 0x04, 0xc5, 0x1e, 0x9e, 0xfe, 0x45, 0x1d, 0x58, 0xb5, 0x86, - 0xf7, 0x78, 0x44, 0xdd, 0x9a, 0xb6, 0x51, 0xde, 0x42, 0x2e, 0x2c, 0xef, 0xf2, 0xf8, 0x6b, 0x32, - 0xa6, 0x6e, 0x5d, 0xff, 0x2d, 0x44, 0xff, 0x67, 0x07, 0xbc, 0xd3, 0x58, 0x19, 0xd2, 0xe8, 0x4b, - 0x58, 0xda, 0x66, 0x31, 0xcd, 0x4d, 0xae, 0x9a, 0xbd, 0xcd, 0x77, 0xef, 0xaf, 0x5f, 0xf8, 0xeb, - 0xfd, 0xf5, 0x9b, 0xa5, 0xa2, 0xe7, 0x19, 0x4d, 0x87, 0x3c, 0x95, 0x84, 0xa5, 0x54, 0xa8, 0xde, - 0xbd, 0x1d, 0x69, 0x48, 0x60, 0x90, 0xd8, 0x5a, 0x40, 0xff, 0x87, 0x25, 0x63, 0xdd, 0x96, 0x8c, - 0x95, 0xfc, 0x7f, 0x6b, 0xd0, 0x7a, 0xa1, 0x08, 0x14, 0xb9, 0x08, 0x00, 0xb6, 0xe9, 0x88, 0xa5, - 0x4c, 0x32, 0x9e, 0xda, 0x43, 0xba, 0xa4, 0x62, 0x9f, 0xed, 0xe2, 0x92, 0x06, 0xf2, 0x60, 0xe5, - 0xa9, 0x3d, 0x30, 0x7b, 0xfc, 0x53, 0x19, 0xbd, 0x82, 0xd5, 0x62, 0xfd, 0x3c, 0x93, 0x6e, 0x4d, - 0x97, 0xdf, 0xdd, 0x8a, 0x13, 0x2f, 0x33, 0x09, 0x4a, 0x50, 0x53, 0x8b, 0x65, 0x63, 0xe8, 0x73, - 0xb8, 0xba, 0x33, 0xce, 0xb8, 0x90, 0x8f, 0xc9, 0xf0, 0x35, 0x55, 0xd5, 0xb9, 0x4d, 0x33, 0x41, - 0x87, 0x44, 0xd2, 0xc8, 0xad, 0x77, 0x6a, 0xdd, 0x26, 0x9e, 0xaf, 0x80, 0x36, 0xe0, 0x0a, 0x49, - 0x12, 0xbe, 0x6f, 0x4b, 0x4c, 0x17, 0x8b, 0xdb, 0xe8, 0x38, 0xdd, 0x15, 0x7c, 0xf2, 0x87, 0xaa, - 0xef, 0xa7, 0x2c, 0x25, 0x89, 0x0b, 0x5a, 0xc3, 0x08, 0xc8, 0x87, 0xd6, 0x93, 0x1f, 0x95, 0x03, - 0x2a, 0x1e, 0x49, 0x29, 0xdc, 0x55, 0x9d, 0xd8, 0x23, 0x7b, 0xa8, 0x0f, 0x2d, 0xed, 0xde, 0x30, - 0xc9, 0xdd, 0x96, 0x4e, 0xc1, 0x46, 0x45, 0x0a, 0xb4, 0xfa, 0xf3, 0x4c, 0xe5, 0xd6, 0xb6, 0xe0, - 0x11, 0x0b, 0xde, 0x03, 0x68, 0x1f, 0x4f, 0xcc, 0x42, 0x1d, 0xf9, 0xbb, 0x03, 0x57, 0x4e, 0xf8, - 0x40, 0x08, 0xea, 0xdf, 0x1c, 0x64, 0xd4, 0x9a, 0xd0, 0x6b, 0xb4, 0x07, 0x0d, 0x15, 0x83, 0x1a, - 0x87, 0x8a, 0xf4, 0xd6, 0x22, 0xa4, 0x03, 0x8d, 0x34, 0xfc, 0x8d, 0x15, 0xef, 0x2e, 0xc0, 0x6c, - 0x73, 0x21, 0xca, 0xdf, 0xc2, 0x9a, 0x2d, 0x0c, 0xdb, 0x18, 0xed, 0xd2, 0xec, 0x36, 0x93, 0x7b, - 0x36, 0x56, 0x6a, 0x0b, 0x8e, 0x15, 0xff, 0x27, 0xb8, 0x8c, 0x29, 0x89, 0x9e, 0xb2, 0x84, 0xce, - 0x9f, 0x07, 0xaa, 0xca, 0x59, 0x42, 0xfb, 0x44, 0xbe, 0x9e, 0x56, 0xb9, 0x95, 0xd1, 0x3d, 0x68, - 0x60, 0x92, 0xc6, 0xd4, 0xba, 0xfe, 0xb0, 0xc2, 0xb5, 0x76, 0xa2, 0x74, 0xb1, 0x81, 0xf8, 0xf7, - 0xa1, 0x39, 0xdd, 0x53, 0x3d, 0xfa, 0x7c, 0x34, 0xca, 0xa9, 0xe9, 0xf7, 0x1a, 0xb6, 0x92, 0xda, - 0xdf, 0xa5, 0x69, 0x6c, 0x5d, 0xd7, 0xb0, 0x95, 0xfc, 0x75, 0x68, 0xcf, 0x98, 0xdb, 0xd4, 0x20, - 0xa8, 0x6f, 0xab, 0x5b, 0xc8, 0xd1, 0xc5, 0xa8, 0xd7, 0x7e, 0xa4, 0xc6, 0x21, 0x89, 0xb6, 0x99, - 0x98, 0x1f, 0xa0, 0x0b, 0xcb, 0xdb, 0x4c, 0x94, 0xe2, 0x2b, 0x44, 0xb4, 0x0e, 0x97, 0x76, 0xd2, - 0x61, 0x32, 0x89, 0x54, 0xb4, 0x92, 0x8a, 0xd4, 0xce, 0xb8, 0x63, 0xbb, 0xfe, 0x43, 0x93, 0x47, - 0xed, 0xc5, 0x92, 0xd9, 0x80, 0x65, 0x9a, 0x4a, 0xc1, 0x68, 0x71, 0xf5, 0xa0, 0xc0, 0xdc, 0xcc, - 0x81, 0xbe, 0x99, 0xf5, 0xd4, 0xc6, 0x85, 0x8a, 0xbf, 0x05, 0x97, 0xd5, 0x46, 0xf5, 0x41, 0x20, - 0xa8, 0x97, 0x48, 0xea, 0xb5, 0x7f, 0x0f, 0xda, 0x33, 0xa0, 0x75, 0xbd, 0x0e, 0x75, 0x75, 0xef, - 0xdb, 0x01, 0x76, 0x9a, 0x5f, 0xfd, 0xdf, 0x5f, 0x83, 0xd5, 0x3e, 0x4b, 0x8b, 0x9b, 0xc0, 0x3f, - 0x74, 0xa0, 0xd5, 0xe7, 0xe9, 0x6c, 0x06, 0xf7, 0xe1, 0x72, 0xd1, 0x6e, 0x8f, 0xfa, 0x3b, 0x8f, - 0x49, 0x56, 0x84, 0xd2, 0x39, 0x79, 0xcc, 0xf6, 0x89, 0x12, 0x18, 0xc5, 0x5e, 0x5d, 0x8d, 0x6b, - 0x7c, 0x1c, 0x8e, 0xbe, 0x80, 0xe5, 0xdd, 0xdd, 0x9e, 0xb6, 0x74, 0x71, 0x21, 0x4b, 0x05, 0x0c, - 0x3d, 0x80, 0xe5, 0x97, 0xfa, 0xe5, 0x94, 0xdb, 0x91, 0x7a, 0x4a, 0xc9, 0x99, 0x40, 0x8d, 0x1a, - 0xa6, 0x43, 0x2e, 0x22, 0x5c, 0x80, 0x36, 0xff, 0x68, 0x40, 0x73, 0x77, 0xb7, 0xd7, 0x13, 0x2c, - 0x8a, 0x29, 0xfa, 0xc5, 0x01, 0x74, 0xf2, 0x12, 0x42, 0x9f, 0x54, 0x77, 0xd0, 0xe9, 0x37, 0xa9, - 0xf7, 0xe9, 0x82, 0x28, 0x9b, 0xe5, 0x57, 0xd0, 0xd0, 0x1d, 0x8e, 0x3e, 0x3a, 0xe7, 0xe5, 0xe0, - 0x75, 0xcf, 0x56, 0xb4, 0xb6, 0x87, 0xb0, 0x52, 0x74, 0x09, 0xba, 0x59, 0x49, 0xef, 0xc8, 0x10, - 0xf0, 0x6e, 0x9d, 0x4b, 0xd7, 0x3a, 0xf9, 0x1e, 0x96, 0x6d, 0xf1, 0xa3, 0x1b, 0x67, 0xe0, 0x66, - 0x6d, 0xe8, 0xdd, 0x3c, 0x8f, 0xea, 0x2c, 0x8c, 0xa2, 0xc8, 0x2b, 0xc3, 0x38, 0xd6, 0x42, 0x95, - 0x61, 0x9c, 0xe8, 0x9a, 0x97, 0x50, 0x57, 0xdd, 0x80, 0xd6, 0x2b, 0x40, 0xa5, 0x76, 0xf1, 0xaa, - 0x8e, 0xeb, 0x48, 0x1b, 0x7d, 0xa7, 0xde, 0xa2, 0xfa, 0x2e, 0xed, 0x56, 0xc6, 0x5c, 0x7a, 0x2a, - 0x7a, 0x37, 0xce, 0xa1, 0x69, 0xcc, 0xf7, 0x5a, 0xef, 0x0e, 0xaf, 0x39, 0x7f, 0x1e, 0x5e, 0x73, - 0xfe, 0x3e, 0xbc, 0xe6, 0x0c, 0x96, 0xf4, 0x63, 0xff, 0xce, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x7c, 0xf6, 0x53, 0x84, 0x3e, 0x0d, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.proto b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.proto index aed5634e41..4413147736 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.proto +++ b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.proto @@ -26,20 +26,35 @@ service LLBBridge { rpc StatFile(StatFileRequest) returns (StatFileResponse); rpc Ping(PingRequest) returns (PongResponse); rpc Return(ReturnRequest) returns (ReturnResponse); + // apicaps:CapFrontendInputs + rpc Inputs(InputsRequest) returns (InputsResponse); } message Result { oneof result { - string ref = 1; - RefMap refs = 2; + // Deprecated non-array refs. + string refDeprecated = 1; + RefMapDeprecated refsDeprecated = 2; + + Ref ref = 3; + RefMap refs = 4; } map metadata = 10; } -message RefMap { +message RefMapDeprecated { map refs = 1; } +message Ref { + string id = 1; + pb.Definition def = 2; +} + +message RefMap { + map refs = 1; +} + message ReturnRequest { Result result = 1; google.rpc.Status error = 2; @@ -48,6 +63,13 @@ message ReturnRequest { message ReturnResponse { } +message InputsRequest { +} + +message InputsResponse { + map Definitions = 1; +} + message ResolveImageConfigRequest { string Ref = 1; pb.Platform Platform = 2; @@ -70,6 +92,7 @@ message SolveRequest { // for each of the ImportCacheRefs entry to CacheImports for compatibility. (planned to be removed) repeated string ImportCacheRefsDeprecated = 4; bool allowResultReturn = 5; + bool allowResultArrayRef = 6; // apicaps.CapSolveInlineReturn deprecated bool Final = 10; @@ -77,6 +100,9 @@ message SolveRequest { // CacheImports was added in BuildKit v0.4.0. // apicaps:CapImportCaches repeated CacheOptionsEntry CacheImports = 12; + + // apicaps:CapFrontendInputs + map FrontendInputs = 13; } // CacheOptionsEntry corresponds to the control.CacheOptionsEntry diff --git a/vendor/github.com/moby/buildkit/go.mod b/vendor/github.com/moby/buildkit/go.mod index 637b15b902..d01fdcda88 100644 --- a/vendor/github.com/moby/buildkit/go.mod +++ b/vendor/github.com/moby/buildkit/go.mod @@ -1,79 +1,83 @@ module github.com/moby/buildkit -go 1.11 +go 1.13 require ( + github.com/AkihiroSuda/containerd-fuse-overlayfs v0.0.0-20200220082720-bb896865146c github.com/BurntSushi/toml v0.3.1 - github.com/Microsoft/go-winio v0.4.14 + github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 + github.com/Microsoft/hcsshim v0.8.7 // indirect github.com/apache/thrift v0.0.0-20161221203622-b2a4d4ae21c7 // indirect github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58 // indirect - github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601 // indirect - github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 - github.com/containerd/containerd v1.4.0-0.20191014053712-acdcf13d5eaf - github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 - github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c // indirect - github.com/containerd/go-cni v0.0.0-20190813230227-49fbd9b210f3 - github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda - github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8 // indirect - github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd // indirect - github.com/containernetworking/cni v0.7.1 // indirect - github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a - github.com/docker/cli v0.0.0-20190321234815-f40f9c240ab0 - github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible - github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c + github.com/containerd/cgroups v0.0.0-20200217135630-d732e370d46d // indirect + github.com/containerd/console v0.0.0-20191219165238-8375c3424e4d + github.com/containerd/containerd v1.4.0-0 + github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 + github.com/containerd/fifo v0.0.0-20191213151349-ff969a566b00 // indirect + github.com/containerd/go-cni v0.0.0-20200107172653-c154a49e2c75 + github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328 + github.com/containerd/ttrpc v0.0.0-20200121165050-0be804eadb15 // indirect + github.com/containerd/typeurl v0.0.0-20200205145503-b45ef1f1f737 // indirect + github.com/coreos/go-systemd/v22 v22.0.0 + github.com/docker/cli v0.0.0-20200227165822-2298e6a3fe24 + github.com/docker/distribution v0.0.0-20200223014041-6b972e50feee + github.com/docker/docker v0.0.0 github.com/docker/docker-credential-helpers v0.6.0 // indirect github.com/docker/go-connections v0.3.0 - github.com/docker/go-events v0.0.0-20170721190031-9461782956ad // indirect - github.com/docker/libnetwork v0.8.0-dev.2.0.20190604151032-3c26b4e7495e - github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f // indirect + github.com/docker/libnetwork v0.8.0-dev.2.0.20200226230617-d8334ccdb9be github.com/gofrs/flock v0.7.0 - github.com/gogo/googleapis v1.1.0 - github.com/gogo/protobuf v1.2.0 - github.com/golang/protobuf v1.2.0 - github.com/google/go-cmp v0.3.0 + github.com/gogo/googleapis v1.3.2 + github.com/gogo/protobuf v1.3.1 + github.com/golang/protobuf v1.3.3 + github.com/google/go-cmp v0.3.1 github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 + github.com/google/uuid v1.1.1 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-immutable-radix v1.0.0 - github.com/hashicorp/golang-lru v0.0.0-20160207214719-a0d98a5f2880 + github.com/hashicorp/golang-lru v0.5.1 github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c // indirect github.com/imdario/mergo v0.3.7 // indirect - github.com/ishidawataru/sctp v0.0.0-20180213033435-07191f837fed // indirect + github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07 // indirect github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea - github.com/kr/pretty v0.1.0 // indirect github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/image-spec v1.0.1 - github.com/opencontainers/runc v1.0.0-rc8.0.20190621203724-f4982d86f7fd - github.com/opencontainers/runtime-spec v0.0.0-20180909173843-eba862dc2470 + github.com/opencontainers/runc v1.0.0-rc9.0.20200221051241-688cf6d43cc4 + github.com/opencontainers/runtime-spec v1.0.1 + github.com/opencontainers/selinux v1.3.2 // indirect github.com/opentracing-contrib/go-stdlib v0.0.0-20171029140428-b1a47cfbdd75 github.com/opentracing/opentracing-go v0.0.0-20171003133519-1361b9cd60be - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/pkg/profile v1.2.1 - github.com/prometheus/procfs v0.0.3 // indirect github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 - github.com/sirupsen/logrus v1.4.1 - github.com/stretchr/testify v1.3.0 + github.com/sirupsen/logrus v1.4.2 + github.com/stretchr/testify v1.4.0 github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect - github.com/tonistiigi/fsutil v0.0.0-20190819224149-3d2716dd0a4d + github.com/tonistiigi/fsutil v0.0.0-20200326231323-c2c7d7b0e144 github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea github.com/uber/jaeger-client-go v0.0.0-20180103221425-e02c85f9069e github.com/uber/jaeger-lib v1.2.1 // indirect - github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5 + github.com/urfave/cli v1.22.2 github.com/vishvananda/netlink v1.0.0 // indirect github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect go.etcd.io/bbolt v1.3.3 - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/net v0.0.0-20190522155817-f3200d17e092 - golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e - golang.org/x/time v0.0.0-20161028155119-f51c12702a4d - google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 - google.golang.org/grpc v1.23.0 + golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d + golang.org/x/net v0.0.0-20200226121028-0de0cce0169b + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 + google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 + google.golang.org/grpc v1.27.1 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gotest.tools v2.2.0+incompatible + gotest.tools/v3 v3.0.2 // indirect ) replace github.com/hashicorp/go-immutable-radix => github.com/tonistiigi/go-immutable-radix v0.0.0-20170803185627-826af9ccf0fe replace github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305 + +replace github.com/containerd/containerd => github.com/containerd/containerd v1.3.1-0.20200227195959-4d242818bf55 + +replace github.com/docker/docker => github.com/docker/docker v1.4.2-0.20200227233006-38f52c9fec82 diff --git a/vendor/github.com/moby/buildkit/session/auth/auth.pb.go b/vendor/github.com/moby/buildkit/session/auth/auth.pb.go index 59e4ac2d79..04afb3d695 100644 --- a/vendor/github.com/moby/buildkit/session/auth/auth.pb.go +++ b/vendor/github.com/moby/buildkit/session/auth/auth.pb.go @@ -3,20 +3,20 @@ package auth -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import strings "strings" -import reflect "reflect" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -26,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type CredentialsRequest struct { Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` @@ -35,7 +35,7 @@ type CredentialsRequest struct { func (m *CredentialsRequest) Reset() { *m = CredentialsRequest{} } func (*CredentialsRequest) ProtoMessage() {} func (*CredentialsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_0215b2f0213c0d57, []int{0} + return fileDescriptor_8bbd6f3875b0e874, []int{0} } func (m *CredentialsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -45,15 +45,15 @@ func (m *CredentialsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CredentialsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CredentialsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CredentialsRequest.Merge(dst, src) +func (m *CredentialsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CredentialsRequest.Merge(m, src) } func (m *CredentialsRequest) XXX_Size() int { return m.Size() @@ -79,7 +79,7 @@ type CredentialsResponse struct { func (m *CredentialsResponse) Reset() { *m = CredentialsResponse{} } func (*CredentialsResponse) ProtoMessage() {} func (*CredentialsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_0215b2f0213c0d57, []int{1} + return fileDescriptor_8bbd6f3875b0e874, []int{1} } func (m *CredentialsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -89,15 +89,15 @@ func (m *CredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CredentialsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CredentialsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CredentialsResponse.Merge(dst, src) +func (m *CredentialsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CredentialsResponse.Merge(m, src) } func (m *CredentialsResponse) XXX_Size() int { return m.Size() @@ -126,6 +126,28 @@ func init() { proto.RegisterType((*CredentialsRequest)(nil), "moby.filesync.v1.CredentialsRequest") proto.RegisterType((*CredentialsResponse)(nil), "moby.filesync.v1.CredentialsResponse") } + +func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } + +var fileDescriptor_8bbd6f3875b0e874 = []byte{ + // 233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9, + 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, 0x4b, 0xcb, 0xcc, + 0x49, 0x2d, 0xae, 0xcc, 0x4b, 0xd6, 0x2b, 0x33, 0x54, 0xd2, 0xe0, 0x12, 0x72, 0x2e, 0x4a, 0x4d, + 0x49, 0xcd, 0x2b, 0xc9, 0x4c, 0xcc, 0x29, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, + 0xe2, 0x62, 0xf1, 0xc8, 0x2f, 0x2e, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x95, + 0x3c, 0xb9, 0x84, 0x51, 0x54, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x49, 0x71, 0x71, 0x84, + 0x16, 0xa7, 0x16, 0xe5, 0x25, 0xe6, 0xa6, 0x42, 0x95, 0xc3, 0xf9, 0x42, 0x62, 0x5c, 0x6c, 0xc1, + 0xa9, 0xc9, 0x45, 0xa9, 0x25, 0x12, 0x4c, 0x60, 0x19, 0x28, 0xcf, 0x28, 0x89, 0x8b, 0xc5, 0xb1, + 0xb4, 0x24, 0x43, 0x28, 0x8a, 0x8b, 0x1b, 0xc9, 0x48, 0x21, 0x15, 0x3d, 0x74, 0xe7, 0xe9, 0x61, + 0xba, 0x4d, 0x4a, 0x95, 0x80, 0x2a, 0x88, 0xbb, 0x9c, 0xac, 0x2e, 0x3c, 0x94, 0x63, 0xb8, 0xf1, + 0x50, 0x8e, 0xe1, 0xc3, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, + 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, + 0x7c, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, + 0x31, 0x44, 0xb1, 0x80, 0x02, 0x2b, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x64, 0x61, 0x71, 0x59, 0x3b, 0x01, 0x00, 0x00, +} + func (this *CredentialsRequest) Equal(that interface{}) bool { if that == nil { return this == nil @@ -244,6 +266,14 @@ type AuthServer interface { Credentials(context.Context, *CredentialsRequest) (*CredentialsResponse, error) } +// UnimplementedAuthServer can be embedded to have forward compatible implementations. +type UnimplementedAuthServer struct { +} + +func (*UnimplementedAuthServer) Credentials(ctx context.Context, req *CredentialsRequest) (*CredentialsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") +} + func RegisterAuthServer(s *grpc.Server, srv AuthServer) { s.RegisterService(&_Auth_serviceDesc, srv) } @@ -282,7 +312,7 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ func (m *CredentialsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -290,23 +320,29 @@ func (m *CredentialsRequest) Marshal() (dAtA []byte, err error) { } func (m *CredentialsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CredentialsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Host) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Host) + copy(dAtA[i:], m.Host) i = encodeVarintAuth(dAtA, i, uint64(len(m.Host))) - i += copy(dAtA[i:], m.Host) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CredentialsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -314,33 +350,42 @@ func (m *CredentialsResponse) Marshal() (dAtA []byte, err error) { } func (m *CredentialsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CredentialsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Username) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Username))) - i += copy(dAtA[i:], m.Username) - } if len(m.Secret) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Secret) + copy(dAtA[i:], m.Secret) i = encodeVarintAuth(dAtA, i, uint64(len(m.Secret))) - i += copy(dAtA[i:], m.Secret) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { + offset -= sovAuth(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *CredentialsRequest) Size() (n int) { if m == nil { @@ -373,14 +418,7 @@ func (m *CredentialsResponse) Size() (n int) { } func sovAuth(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozAuth(x uint64) (n int) { return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -429,7 +467,7 @@ func (m *CredentialsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -457,7 +495,7 @@ func (m *CredentialsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -467,6 +505,9 @@ func (m *CredentialsRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -481,6 +522,9 @@ func (m *CredentialsRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthAuth } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthAuth + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -508,7 +552,7 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -536,7 +580,7 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -546,6 +590,9 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -565,7 +612,7 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -575,6 +622,9 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -589,6 +639,9 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthAuth } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthAuth + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -604,6 +657,7 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { func skipAuth(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -635,10 +689,8 @@ func skipAuth(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -655,74 +707,34 @@ func skipAuth(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthAuth } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipAuth(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuth + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuth + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("auth.proto", fileDescriptor_auth_0215b2f0213c0d57) } - -var fileDescriptor_auth_0215b2f0213c0d57 = []byte{ - // 233 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9, - 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, 0x4b, 0xcb, 0xcc, - 0x49, 0x2d, 0xae, 0xcc, 0x4b, 0xd6, 0x2b, 0x33, 0x54, 0xd2, 0xe0, 0x12, 0x72, 0x2e, 0x4a, 0x4d, - 0x49, 0xcd, 0x2b, 0xc9, 0x4c, 0xcc, 0x29, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, - 0xe2, 0x62, 0xf1, 0xc8, 0x2f, 0x2e, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x95, - 0x3c, 0xb9, 0x84, 0x51, 0x54, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x49, 0x71, 0x71, 0x84, - 0x16, 0xa7, 0x16, 0xe5, 0x25, 0xe6, 0xa6, 0x42, 0x95, 0xc3, 0xf9, 0x42, 0x62, 0x5c, 0x6c, 0xc1, - 0xa9, 0xc9, 0x45, 0xa9, 0x25, 0x12, 0x4c, 0x60, 0x19, 0x28, 0xcf, 0x28, 0x89, 0x8b, 0xc5, 0xb1, - 0xb4, 0x24, 0x43, 0x28, 0x8a, 0x8b, 0x1b, 0xc9, 0x48, 0x21, 0x15, 0x3d, 0x74, 0xe7, 0xe9, 0x61, - 0xba, 0x4d, 0x4a, 0x95, 0x80, 0x2a, 0x88, 0xbb, 0x9c, 0xac, 0x2e, 0x3c, 0x94, 0x63, 0xb8, 0xf1, - 0x50, 0x8e, 0xe1, 0xc3, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, - 0x7c, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, - 0x31, 0x44, 0xb1, 0x80, 0x02, 0x2b, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x64, 0x61, 0x71, 0x59, 0x3b, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go b/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go index 86c93acc0b..993834a6e6 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go +++ b/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go @@ -3,22 +3,21 @@ package filesync -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import bytes "bytes" - -import strings "strings" -import reflect "reflect" - import ( - context "golang.org/x/net/context" + bytes "bytes" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -28,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // BytesMessage contains a chunk of byte data type BytesMessage struct { @@ -38,7 +37,7 @@ type BytesMessage struct { func (m *BytesMessage) Reset() { *m = BytesMessage{} } func (*BytesMessage) ProtoMessage() {} func (*BytesMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_filesync_26f8b7bce2e5ac0e, []int{0} + return fileDescriptor_d1042549f1f24495, []int{0} } func (m *BytesMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -48,15 +47,15 @@ func (m *BytesMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_BytesMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *BytesMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_BytesMessage.Merge(dst, src) +func (m *BytesMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_BytesMessage.Merge(m, src) } func (m *BytesMessage) XXX_Size() int { return m.Size() @@ -77,6 +76,27 @@ func (m *BytesMessage) GetData() []byte { func init() { proto.RegisterType((*BytesMessage)(nil), "moby.filesync.v1.BytesMessage") } + +func init() { proto.RegisterFile("filesync.proto", fileDescriptor_d1042549f1f24495) } + +var fileDescriptor_d1042549f1f24495 = []byte{ + // 217 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0xcb, 0xcc, 0x49, + 0x2d, 0xae, 0xcc, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcd, 0x4f, 0xaa, + 0xd4, 0x83, 0x0b, 0x96, 0x19, 0x2a, 0x29, 0x71, 0xf1, 0x38, 0x55, 0x96, 0xa4, 0x16, 0xfb, 0xa6, + 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0x09, 0x71, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x2a, + 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x46, 0xab, 0x19, 0xb9, 0x38, 0xdc, 0x32, 0x73, 0x52, 0x83, + 0x2b, 0xf3, 0x92, 0x85, 0xfc, 0xb8, 0x38, 0x5c, 0x32, 0xd3, 0xd2, 0x9c, 0xf3, 0x0b, 0x2a, 0x85, + 0xe4, 0xf4, 0xd0, 0xcd, 0xd3, 0x43, 0x36, 0x4c, 0x8a, 0x80, 0xbc, 0x06, 0xa3, 0x01, 0xa3, 0x90, + 0x3f, 0x17, 0x67, 0x48, 0x62, 0x51, 0x70, 0x49, 0x51, 0x6a, 0x62, 0x2e, 0x35, 0x0c, 0x34, 0x8a, + 0x82, 0x3a, 0x36, 0x35, 0x2f, 0x85, 0xda, 0x8e, 0x75, 0xb2, 0xbb, 0xf0, 0x50, 0x8e, 0xe1, 0xc6, + 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, + 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, + 0xf0, 0xe1, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, + 0xc7, 0x10, 0xc5, 0x01, 0x33, 0x33, 0x89, 0x0d, 0x1c, 0x0d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x5e, 0xce, 0x52, 0xb3, 0x98, 0x01, 0x00, 0x00, +} + func (this *BytesMessage) Equal(that interface{}) bool { if that == nil { return this == nil @@ -212,6 +232,17 @@ type FileSyncServer interface { TarStream(FileSync_TarStreamServer) error } +// UnimplementedFileSyncServer can be embedded to have forward compatible implementations. +type UnimplementedFileSyncServer struct { +} + +func (*UnimplementedFileSyncServer) DiffCopy(srv FileSync_DiffCopyServer) error { + return status.Errorf(codes.Unimplemented, "method DiffCopy not implemented") +} +func (*UnimplementedFileSyncServer) TarStream(srv FileSync_TarStreamServer) error { + return status.Errorf(codes.Unimplemented, "method TarStream not implemented") +} + func RegisterFileSyncServer(s *grpc.Server, srv FileSyncServer) { s.RegisterService(&_FileSync_serviceDesc, srv) } @@ -340,6 +371,14 @@ type FileSendServer interface { DiffCopy(FileSend_DiffCopyServer) error } +// UnimplementedFileSendServer can be embedded to have forward compatible implementations. +type UnimplementedFileSendServer struct { +} + +func (*UnimplementedFileSendServer) DiffCopy(srv FileSend_DiffCopyServer) error { + return status.Errorf(codes.Unimplemented, "method DiffCopy not implemented") +} + func RegisterFileSendServer(s *grpc.Server, srv FileSendServer) { s.RegisterService(&_FileSend_serviceDesc, srv) } @@ -388,7 +427,7 @@ var _FileSend_serviceDesc = grpc.ServiceDesc{ func (m *BytesMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -396,27 +435,35 @@ func (m *BytesMessage) Marshal() (dAtA []byte, err error) { } func (m *BytesMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BytesMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintFilesync(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintFilesync(dAtA []byte, offset int, v uint64) int { + offset -= sovFilesync(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *BytesMessage) Size() (n int) { if m == nil { @@ -432,14 +479,7 @@ func (m *BytesMessage) Size() (n int) { } func sovFilesync(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozFilesync(x uint64) (n int) { return sovFilesync(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -477,7 +517,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -505,7 +545,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -514,6 +554,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { return ErrInvalidLengthFilesync } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthFilesync + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -531,6 +574,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthFilesync } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthFilesync + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -546,6 +592,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { func skipFilesync(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -577,10 +624,8 @@ func skipFilesync(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -597,73 +642,34 @@ func skipFilesync(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthFilesync } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFilesync - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipFilesync(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFilesync + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthFilesync + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthFilesync = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFilesync = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthFilesync = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFilesync = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFilesync = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("filesync.proto", fileDescriptor_filesync_26f8b7bce2e5ac0e) } - -var fileDescriptor_filesync_26f8b7bce2e5ac0e = []byte{ - // 217 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0xcb, 0xcc, 0x49, - 0x2d, 0xae, 0xcc, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcd, 0x4f, 0xaa, - 0xd4, 0x83, 0x0b, 0x96, 0x19, 0x2a, 0x29, 0x71, 0xf1, 0x38, 0x55, 0x96, 0xa4, 0x16, 0xfb, 0xa6, - 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0x09, 0x71, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x2a, - 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x46, 0xab, 0x19, 0xb9, 0x38, 0xdc, 0x32, 0x73, 0x52, 0x83, - 0x2b, 0xf3, 0x92, 0x85, 0xfc, 0xb8, 0x38, 0x5c, 0x32, 0xd3, 0xd2, 0x9c, 0xf3, 0x0b, 0x2a, 0x85, - 0xe4, 0xf4, 0xd0, 0xcd, 0xd3, 0x43, 0x36, 0x4c, 0x8a, 0x80, 0xbc, 0x06, 0xa3, 0x01, 0xa3, 0x90, - 0x3f, 0x17, 0x67, 0x48, 0x62, 0x51, 0x70, 0x49, 0x51, 0x6a, 0x62, 0x2e, 0x35, 0x0c, 0x34, 0x8a, - 0x82, 0x3a, 0x36, 0x35, 0x2f, 0x85, 0xda, 0x8e, 0x75, 0xb2, 0xbb, 0xf0, 0x50, 0x8e, 0xe1, 0xc6, - 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, - 0xf0, 0xe1, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, - 0xc7, 0x10, 0xc5, 0x01, 0x33, 0x33, 0x89, 0x0d, 0x1c, 0x0d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x5e, 0xce, 0x52, 0xb3, 0x98, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go b/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go index 3ce0d1759b..eb49bebee6 100644 --- a/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go +++ b/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go @@ -3,23 +3,22 @@ package secrets -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import bytes "bytes" - -import strings "strings" -import reflect "reflect" -import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - import ( - context "golang.org/x/net/context" + bytes "bytes" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -29,7 +28,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetSecretRequest struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -39,7 +38,7 @@ type GetSecretRequest struct { func (m *GetSecretRequest) Reset() { *m = GetSecretRequest{} } func (*GetSecretRequest) ProtoMessage() {} func (*GetSecretRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_secrets_21bd4adec74a381e, []int{0} + return fileDescriptor_d4bc6c625e214507, []int{0} } func (m *GetSecretRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -49,15 +48,15 @@ func (m *GetSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_GetSecretRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *GetSecretRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSecretRequest.Merge(dst, src) +func (m *GetSecretRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSecretRequest.Merge(m, src) } func (m *GetSecretRequest) XXX_Size() int { return m.Size() @@ -89,7 +88,7 @@ type GetSecretResponse struct { func (m *GetSecretResponse) Reset() { *m = GetSecretResponse{} } func (*GetSecretResponse) ProtoMessage() {} func (*GetSecretResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_secrets_21bd4adec74a381e, []int{1} + return fileDescriptor_d4bc6c625e214507, []int{1} } func (m *GetSecretResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -99,15 +98,15 @@ func (m *GetSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetSecretResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *GetSecretResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSecretResponse.Merge(dst, src) +func (m *GetSecretResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSecretResponse.Merge(m, src) } func (m *GetSecretResponse) XXX_Size() int { return m.Size() @@ -130,6 +129,31 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.secrets.v1.GetSecretRequest.AnnotationsEntry") proto.RegisterType((*GetSecretResponse)(nil), "moby.buildkit.secrets.v1.GetSecretResponse") } + +func init() { proto.RegisterFile("secrets.proto", fileDescriptor_d4bc6c625e214507) } + +var fileDescriptor_d4bc6c625e214507 = []byte{ + // 288 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4e, 0x4d, 0x2e, + 0x4a, 0x2d, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, + 0x4b, 0x2a, 0xcd, 0xcc, 0x49, 0xc9, 0xce, 0x2c, 0xd1, 0x83, 0x49, 0x96, 0x19, 0x2a, 0x1d, 0x64, + 0xe4, 0x12, 0x70, 0x4f, 0x2d, 0x09, 0x06, 0x8b, 0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, + 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x31, 0x79, 0xba, 0x08, + 0xc5, 0x72, 0x71, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x4b, 0x30, + 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x59, 0xeb, 0xe1, 0x32, 0x54, 0x0f, 0xdd, 0x40, 0x3d, 0x47, 0x84, + 0x6e, 0xd7, 0xbc, 0x92, 0xa2, 0xca, 0x20, 0x64, 0xf3, 0xa4, 0xec, 0xb8, 0x04, 0xd0, 0x15, 0x08, + 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x42, 0xdd, 0x00, 0x62, 0x0a, 0x89, 0x70, 0xb1, 0x96, 0x25, + 0xe6, 0x94, 0xa6, 0x4a, 0x30, 0x81, 0xc5, 0x20, 0x1c, 0x2b, 0x26, 0x0b, 0x46, 0x25, 0x75, 0x2e, + 0x41, 0x24, 0x1b, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x52, 0x12, 0x4b, + 0x12, 0xc1, 0x26, 0xf0, 0x04, 0x81, 0xd9, 0x46, 0xf9, 0x5c, 0xec, 0x10, 0x55, 0xc5, 0x42, 0x29, + 0x5c, 0x9c, 0x70, 0x3d, 0x42, 0x5a, 0xc4, 0x7b, 0x45, 0x4a, 0x9b, 0x28, 0xb5, 0x10, 0x47, 0x38, + 0xd9, 0x5e, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, + 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, + 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, + 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x62, 0x87, 0x9a, 0x99, 0xc4, 0x06, 0x8e, + 0x3d, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x38, 0xec, 0x1f, 0xce, 0x01, 0x00, 0x00, +} + func (this *GetSecretRequest) Equal(that interface{}) bool { if that == nil { return this == nil @@ -265,6 +289,14 @@ type SecretsServer interface { GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) } +// UnimplementedSecretsServer can be embedded to have forward compatible implementations. +type UnimplementedSecretsServer struct { +} + +func (*UnimplementedSecretsServer) GetSecret(ctx context.Context, req *GetSecretRequest) (*GetSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") +} + func RegisterSecretsServer(s *grpc.Server, srv SecretsServer) { s.RegisterService(&_Secrets_serviceDesc, srv) } @@ -303,7 +335,7 @@ var _Secrets_serviceDesc = grpc.ServiceDesc{ func (m *GetSecretRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -311,40 +343,48 @@ func (m *GetSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *GetSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSecrets(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } if len(m.Annotations) > 0 { - for k, _ := range m.Annotations { - dAtA[i] = 0x12 - i++ + for k := range m.Annotations { v := m.Annotations[k] - mapSize := 1 + len(k) + sovSecrets(uint64(len(k))) + 1 + len(v) + sovSecrets(uint64(len(v))) - i = encodeVarintSecrets(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSecrets(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintSecrets(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSecrets(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSecrets(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintSecrets(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetSecretResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -352,27 +392,35 @@ func (m *GetSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *GetSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintSecrets(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintSecrets(dAtA []byte, offset int, v uint64) int { + offset -= sovSecrets(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *GetSecretRequest) Size() (n int) { if m == nil { @@ -409,14 +457,7 @@ func (m *GetSecretResponse) Size() (n int) { } func sovSecrets(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSecrets(x uint64) (n int) { return sovSecrets(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -475,7 +516,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -503,7 +544,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -513,6 +554,9 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSecrets } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSecrets + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -532,7 +576,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -541,6 +585,9 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSecrets } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSecrets + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -561,7 +608,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -578,7 +625,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -588,6 +635,9 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSecrets } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthSecrets + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -604,7 +654,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -614,6 +664,9 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSecrets } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthSecrets + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -645,6 +698,9 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSecrets } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSecrets + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -672,7 +728,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -700,7 +756,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -709,6 +765,9 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSecrets } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSecrets + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -726,6 +785,9 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSecrets } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSecrets + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -741,6 +803,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { func skipSecrets(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -772,10 +835,8 @@ func skipSecrets(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -792,77 +853,34 @@ func skipSecrets(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthSecrets } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSecrets - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSecrets(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSecrets + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSecrets + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSecrets = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSecrets = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSecrets = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSecrets = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSecrets = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("secrets.proto", fileDescriptor_secrets_21bd4adec74a381e) } - -var fileDescriptor_secrets_21bd4adec74a381e = []byte{ - // 288 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4e, 0x4d, 0x2e, - 0x4a, 0x2d, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, - 0x4b, 0x2a, 0xcd, 0xcc, 0x49, 0xc9, 0xce, 0x2c, 0xd1, 0x83, 0x49, 0x96, 0x19, 0x2a, 0x1d, 0x64, - 0xe4, 0x12, 0x70, 0x4f, 0x2d, 0x09, 0x06, 0x8b, 0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, - 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x31, 0x79, 0xba, 0x08, - 0xc5, 0x72, 0x71, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x4b, 0x30, - 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x59, 0xeb, 0xe1, 0x32, 0x54, 0x0f, 0xdd, 0x40, 0x3d, 0x47, 0x84, - 0x6e, 0xd7, 0xbc, 0x92, 0xa2, 0xca, 0x20, 0x64, 0xf3, 0xa4, 0xec, 0xb8, 0x04, 0xd0, 0x15, 0x08, - 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x42, 0xdd, 0x00, 0x62, 0x0a, 0x89, 0x70, 0xb1, 0x96, 0x25, - 0xe6, 0x94, 0xa6, 0x4a, 0x30, 0x81, 0xc5, 0x20, 0x1c, 0x2b, 0x26, 0x0b, 0x46, 0x25, 0x75, 0x2e, - 0x41, 0x24, 0x1b, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x52, 0x12, 0x4b, - 0x12, 0xc1, 0x26, 0xf0, 0x04, 0x81, 0xd9, 0x46, 0xf9, 0x5c, 0xec, 0x10, 0x55, 0xc5, 0x42, 0x29, - 0x5c, 0x9c, 0x70, 0x3d, 0x42, 0x5a, 0xc4, 0x7b, 0x45, 0x4a, 0x9b, 0x28, 0xb5, 0x10, 0x47, 0x38, - 0xd9, 0x5e, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, - 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, - 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, - 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x62, 0x87, 0x9a, 0x99, 0xc4, 0x06, 0x8e, - 0x3d, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x38, 0xec, 0x1f, 0xce, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/session/sshforward/ssh.go b/vendor/github.com/moby/buildkit/session/sshforward/ssh.go index 0001f59b5f..a7a4c2e228 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/ssh.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/ssh.go @@ -75,6 +75,10 @@ func MountSSHSocket(ctx context.Context, c session.Caller, opt SocketOpt) (sockP } }() + if err := os.Chmod(dir, 0711); err != nil { + return "", nil, errors.WithStack(err) + } + sockPath = filepath.Join(dir, "ssh_auth_sock") l, err := net.Listen("unix", sockPath) diff --git a/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go b/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go index 9ac12773d0..62adbe6dd8 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go @@ -3,22 +3,21 @@ package sshforward -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import bytes "bytes" - -import strings "strings" -import reflect "reflect" - import ( - context "golang.org/x/net/context" + bytes "bytes" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -28,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // BytesMessage contains a chunk of byte data type BytesMessage struct { @@ -38,7 +37,7 @@ type BytesMessage struct { func (m *BytesMessage) Reset() { *m = BytesMessage{} } func (*BytesMessage) ProtoMessage() {} func (*BytesMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ssh_13bd2c34c031d472, []int{0} + return fileDescriptor_ef0eae71e2e883eb, []int{0} } func (m *BytesMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -48,15 +47,15 @@ func (m *BytesMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_BytesMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *BytesMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_BytesMessage.Merge(dst, src) +func (m *BytesMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_BytesMessage.Merge(m, src) } func (m *BytesMessage) XXX_Size() int { return m.Size() @@ -81,7 +80,7 @@ type CheckAgentRequest struct { func (m *CheckAgentRequest) Reset() { *m = CheckAgentRequest{} } func (*CheckAgentRequest) ProtoMessage() {} func (*CheckAgentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ssh_13bd2c34c031d472, []int{1} + return fileDescriptor_ef0eae71e2e883eb, []int{1} } func (m *CheckAgentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -91,15 +90,15 @@ func (m *CheckAgentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_CheckAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CheckAgentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckAgentRequest.Merge(dst, src) +func (m *CheckAgentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckAgentRequest.Merge(m, src) } func (m *CheckAgentRequest) XXX_Size() int { return m.Size() @@ -123,7 +122,7 @@ type CheckAgentResponse struct { func (m *CheckAgentResponse) Reset() { *m = CheckAgentResponse{} } func (*CheckAgentResponse) ProtoMessage() {} func (*CheckAgentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ssh_13bd2c34c031d472, []int{2} + return fileDescriptor_ef0eae71e2e883eb, []int{2} } func (m *CheckAgentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,15 +132,15 @@ func (m *CheckAgentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CheckAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *CheckAgentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckAgentResponse.Merge(dst, src) +func (m *CheckAgentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckAgentResponse.Merge(m, src) } func (m *CheckAgentResponse) XXX_Size() int { return m.Size() @@ -157,6 +156,29 @@ func init() { proto.RegisterType((*CheckAgentRequest)(nil), "moby.sshforward.v1.CheckAgentRequest") proto.RegisterType((*CheckAgentResponse)(nil), "moby.sshforward.v1.CheckAgentResponse") } + +func init() { proto.RegisterFile("ssh.proto", fileDescriptor_ef0eae71e2e883eb) } + +var fileDescriptor_ef0eae71e2e883eb = []byte{ + // 252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0x2e, 0xce, 0xd0, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xca, 0xcd, 0x4f, 0xaa, 0xd4, 0x2b, 0x2e, 0xce, 0x48, + 0xcb, 0x2f, 0x2a, 0x4f, 0x2c, 0x4a, 0xd1, 0x2b, 0x33, 0x54, 0x52, 0xe2, 0xe2, 0x71, 0xaa, 0x2c, + 0x49, 0x2d, 0xf6, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x15, 0x12, 0xe2, 0x62, 0x49, 0x49, 0x2c, + 0x49, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0xb3, 0x95, 0x94, 0xb9, 0x04, 0x9d, 0x33, + 0x52, 0x93, 0xb3, 0x1d, 0xd3, 0x53, 0xf3, 0x4a, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, + 0xf8, 0xb8, 0x98, 0x3c, 0x5d, 0xc0, 0xca, 0x38, 0x83, 0x98, 0x3c, 0x5d, 0x94, 0x44, 0xb8, 0x84, + 0x90, 0x15, 0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0xed, 0x62, 0xe4, 0x62, 0x0e, 0x0e, 0xf6, + 0x10, 0x8a, 0xe6, 0xe2, 0x42, 0xc8, 0x0a, 0xa9, 0xea, 0x61, 0xba, 0x44, 0x0f, 0xc3, 0x0a, 0x29, + 0x35, 0x42, 0xca, 0x20, 0x96, 0x08, 0x85, 0x71, 0xf1, 0xb8, 0x41, 0x14, 0x40, 0x8c, 0x57, 0xc0, + 0xa6, 0x0f, 0xd9, 0x97, 0x52, 0x04, 0x55, 0x68, 0x30, 0x1a, 0x30, 0x3a, 0x39, 0x5c, 0x78, 0x28, + 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, + 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, + 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, + 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xe2, 0x42, 0x98, 0x9a, 0xc4, 0x06, 0x0e, 0x78, 0x63, 0x40, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x6c, 0xe6, 0x6d, 0xb7, 0x85, 0x01, 0x00, 0x00, +} + func (this *BytesMessage) Equal(that interface{}) bool { if that == nil { return this == nil @@ -334,6 +356,17 @@ type SSHServer interface { ForwardAgent(SSH_ForwardAgentServer) error } +// UnimplementedSSHServer can be embedded to have forward compatible implementations. +type UnimplementedSSHServer struct { +} + +func (*UnimplementedSSHServer) CheckAgent(ctx context.Context, req *CheckAgentRequest) (*CheckAgentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckAgent not implemented") +} +func (*UnimplementedSSHServer) ForwardAgent(srv SSH_ForwardAgentServer) error { + return status.Errorf(codes.Unimplemented, "method ForwardAgent not implemented") +} + func RegisterSSHServer(s *grpc.Server, srv SSHServer) { s.RegisterService(&_SSH_serviceDesc, srv) } @@ -405,7 +438,7 @@ var _SSH_serviceDesc = grpc.ServiceDesc{ func (m *BytesMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -413,23 +446,29 @@ func (m *BytesMessage) Marshal() (dAtA []byte, err error) { } func (m *BytesMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BytesMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintSsh(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CheckAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -437,23 +476,29 @@ func (m *CheckAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *CheckAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintSsh(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CheckAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -461,21 +506,28 @@ func (m *CheckAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *CheckAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintSsh(dAtA []byte, offset int, v uint64) int { + offset -= sovSsh(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *BytesMessage) Size() (n int) { if m == nil { @@ -513,14 +565,7 @@ func (m *CheckAgentResponse) Size() (n int) { } func sovSsh(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSsh(x uint64) (n int) { return sovSsh(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -577,7 +622,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -605,7 +650,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -614,6 +659,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSsh } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSsh + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -631,6 +679,9 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSsh } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSsh + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -658,7 +709,7 @@ func (m *CheckAgentRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -686,7 +737,7 @@ func (m *CheckAgentRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -696,6 +747,9 @@ func (m *CheckAgentRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSsh } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSsh + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -710,6 +764,9 @@ func (m *CheckAgentRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSsh } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSsh + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -737,7 +794,7 @@ func (m *CheckAgentResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -760,6 +817,9 @@ func (m *CheckAgentResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSsh } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSsh + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -775,6 +835,7 @@ func (m *CheckAgentResponse) Unmarshal(dAtA []byte) error { func skipSsh(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -806,10 +867,8 @@ func skipSsh(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -826,75 +885,34 @@ func skipSsh(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthSsh } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSsh - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSsh(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSsh + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSsh + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSsh = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSsh = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSsh = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSsh = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSsh = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("ssh.proto", fileDescriptor_ssh_13bd2c34c031d472) } - -var fileDescriptor_ssh_13bd2c34c031d472 = []byte{ - // 252 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0x2e, 0xce, 0xd0, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xca, 0xcd, 0x4f, 0xaa, 0xd4, 0x2b, 0x2e, 0xce, 0x48, - 0xcb, 0x2f, 0x2a, 0x4f, 0x2c, 0x4a, 0xd1, 0x2b, 0x33, 0x54, 0x52, 0xe2, 0xe2, 0x71, 0xaa, 0x2c, - 0x49, 0x2d, 0xf6, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x15, 0x12, 0xe2, 0x62, 0x49, 0x49, 0x2c, - 0x49, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0xb3, 0x95, 0x94, 0xb9, 0x04, 0x9d, 0x33, - 0x52, 0x93, 0xb3, 0x1d, 0xd3, 0x53, 0xf3, 0x4a, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, - 0xf8, 0xb8, 0x98, 0x3c, 0x5d, 0xc0, 0xca, 0x38, 0x83, 0x98, 0x3c, 0x5d, 0x94, 0x44, 0xb8, 0x84, - 0x90, 0x15, 0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0xed, 0x62, 0xe4, 0x62, 0x0e, 0x0e, 0xf6, - 0x10, 0x8a, 0xe6, 0xe2, 0x42, 0xc8, 0x0a, 0xa9, 0xea, 0x61, 0xba, 0x44, 0x0f, 0xc3, 0x0a, 0x29, - 0x35, 0x42, 0xca, 0x20, 0x96, 0x08, 0x85, 0x71, 0xf1, 0xb8, 0x41, 0x14, 0x40, 0x8c, 0x57, 0xc0, - 0xa6, 0x0f, 0xd9, 0x97, 0x52, 0x04, 0x55, 0x68, 0x30, 0x1a, 0x30, 0x3a, 0x39, 0x5c, 0x78, 0x28, - 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, - 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, - 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, - 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xe2, 0x42, 0x98, 0x9a, 0xc4, 0x06, 0x0e, 0x78, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x6c, 0xe6, 0x6d, 0xb7, 0x85, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go index 7aa3e3dfc2..4f569799f7 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go @@ -178,7 +178,7 @@ type sock struct { } type readOnlyAgent struct { - agent.Agent + agent.ExtendedAgent } func (a *readOnlyAgent) Add(_ agent.AddedKey) error { @@ -196,3 +196,7 @@ func (a *readOnlyAgent) RemoveAll() error { func (a *readOnlyAgent) Lock(_ []byte) error { return errors.Errorf("locking agent not allowed by buildkit") } + +func (a *readOnlyAgent) Extension(_ string, _ []byte) ([]byte, error) { + return nil, errors.Errorf("extensions not allowed by buildkit") +} diff --git a/vendor/github.com/moby/buildkit/solver/pb/caps.go b/vendor/github.com/moby/buildkit/solver/pb/caps.go index 7649ce7d9d..93c77b3e9a 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/caps.go +++ b/vendor/github.com/moby/buildkit/solver/pb/caps.go @@ -45,7 +45,10 @@ const ( CapExecMountSSH apicaps.CapID = "exec.mount.ssh" CapExecCgroupsMounted apicaps.CapID = "exec.cgroup" - CapFileBase apicaps.CapID = "file.base" + CapExecMetaSecurityDeviceWhitelistV1 apicaps.CapID = "exec.meta.security.devices.v1" + + CapFileBase apicaps.CapID = "file.base" + CapFileRmWildcard apicaps.CapID = "file.rm.wildcard" CapConstraints apicaps.CapID = "constraints" CapPlatform apicaps.CapID = "platform" @@ -188,6 +191,12 @@ func init() { Status: apicaps.CapStatusExperimental, }) + Caps.Init(apicaps.Cap{ + ID: CapExecMetaSecurityDeviceWhitelistV1, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + Caps.Init(apicaps.Cap{ ID: CapExecMountBind, Enabled: true, @@ -252,6 +261,12 @@ func init() { }, }) + Caps.Init(apicaps.Cap{ + ID: CapFileRmWildcard, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + Caps.Init(apicaps.Cap{ ID: CapConstraints, Enabled: true, @@ -281,5 +296,4 @@ func init() { Enabled: true, Status: apicaps.CapStatusExperimental, }) - } diff --git a/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go b/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go index dbb0f21f3b..bfab9e37bb 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go +++ b/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go @@ -1,24 +1,22 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: ops.proto +// Package pb provides the protobuf definition of LLB: low-level builder instruction. +// LLB is DAG-structured; Op represents a vertex, and Definition represents a graph. + package pb -/* - Package pb provides the protobuf definition of LLB: low-level builder instruction. - LLB is DAG-structured; Op represents a vertex, and Definition represents a graph. -*/ - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" - -import github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" -import github_com_moby_buildkit_util_apicaps "github.com/moby/buildkit/util/apicaps" - -import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - -import io "io" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + github_com_moby_buildkit_util_apicaps "github.com/moby/buildkit/util/apicaps" + github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" + io "io" + math "math" + math_bits "math/bits" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -29,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type NetMode int32 @@ -44,6 +42,7 @@ var NetMode_name = map[int32]string{ 1: "HOST", 2: "NONE", } + var NetMode_value = map[string]int32{ "UNSET": 0, "HOST": 1, @@ -53,8 +52,9 @@ var NetMode_value = map[string]int32{ func (x NetMode) String() string { return proto.EnumName(NetMode_name, int32(x)) } + func (NetMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{0} + return fileDescriptor_8de16154b2733812, []int{0} } type SecurityMode int32 @@ -68,6 +68,7 @@ var SecurityMode_name = map[int32]string{ 0: "SANDBOX", 1: "INSECURE", } + var SecurityMode_value = map[string]int32{ "SANDBOX": 0, "INSECURE": 1, @@ -76,8 +77,9 @@ var SecurityMode_value = map[string]int32{ func (x SecurityMode) String() string { return proto.EnumName(SecurityMode_name, int32(x)) } + func (SecurityMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{1} + return fileDescriptor_8de16154b2733812, []int{1} } // MountType defines a type of a mount from a supported set @@ -98,6 +100,7 @@ var MountType_name = map[int32]string{ 3: "CACHE", 4: "TMPFS", } + var MountType_value = map[string]int32{ "BIND": 0, "SECRET": 1, @@ -109,8 +112,9 @@ var MountType_value = map[string]int32{ func (x MountType) String() string { return proto.EnumName(MountType_name, int32(x)) } + func (MountType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{2} + return fileDescriptor_8de16154b2733812, []int{2} } // CacheSharingOpt defines different sharing modes for cache mount @@ -130,6 +134,7 @@ var CacheSharingOpt_name = map[int32]string{ 1: "PRIVATE", 2: "LOCKED", } + var CacheSharingOpt_value = map[string]int32{ "SHARED": 0, "PRIVATE": 1, @@ -139,8 +144,9 @@ var CacheSharingOpt_value = map[string]int32{ func (x CacheSharingOpt) String() string { return proto.EnumName(CacheSharingOpt_name, int32(x)) } + func (CacheSharingOpt) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{3} + return fileDescriptor_8de16154b2733812, []int{3} } // Op represents a vertex of the LLB DAG. @@ -161,21 +167,21 @@ func (m *Op) Reset() { *m = Op{} } func (m *Op) String() string { return proto.CompactTextString(m) } func (*Op) ProtoMessage() {} func (*Op) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{0} + return fileDescriptor_8de16154b2733812, []int{0} } func (m *Op) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Op) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Op) XXX_Merge(src proto.Message) { - xxx_messageInfo_Op.Merge(dst, src) +func (m *Op) XXX_Merge(src proto.Message) { + xxx_messageInfo_Op.Merge(m, src) } func (m *Op) XXX_Size() int { return m.Size() @@ -193,16 +199,16 @@ type isOp_Op interface { } type Op_Exec struct { - Exec *ExecOp `protobuf:"bytes,2,opt,name=exec,proto3,oneof"` + Exec *ExecOp `protobuf:"bytes,2,opt,name=exec,proto3,oneof" json:"exec,omitempty"` } type Op_Source struct { - Source *SourceOp `protobuf:"bytes,3,opt,name=source,proto3,oneof"` + Source *SourceOp `protobuf:"bytes,3,opt,name=source,proto3,oneof" json:"source,omitempty"` } type Op_File struct { - File *FileOp `protobuf:"bytes,4,opt,name=file,proto3,oneof"` + File *FileOp `protobuf:"bytes,4,opt,name=file,proto3,oneof" json:"file,omitempty"` } type Op_Build struct { - Build *BuildOp `protobuf:"bytes,5,opt,name=build,proto3,oneof"` + Build *BuildOp `protobuf:"bytes,5,opt,name=build,proto3,oneof" json:"build,omitempty"` } func (*Op_Exec) isOp_Op() {} @@ -266,9 +272,9 @@ func (m *Op) GetConstraints() *WorkerConstraints { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Op) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Op_OneofMarshaler, _Op_OneofUnmarshaler, _Op_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Op) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Op_Exec)(nil), (*Op_Source)(nil), (*Op_File)(nil), @@ -276,108 +282,6 @@ func (*Op) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, fun } } -func _Op_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Op) - // op - switch x := m.Op.(type) { - case *Op_Exec: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Exec); err != nil { - return err - } - case *Op_Source: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Source); err != nil { - return err - } - case *Op_File: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.File); err != nil { - return err - } - case *Op_Build: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Build); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Op.Op has unexpected type %T", x) - } - return nil -} - -func _Op_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Op) - switch tag { - case 2: // op.exec - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ExecOp) - err := b.DecodeMessage(msg) - m.Op = &Op_Exec{msg} - return true, err - case 3: // op.source - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SourceOp) - err := b.DecodeMessage(msg) - m.Op = &Op_Source{msg} - return true, err - case 4: // op.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileOp) - err := b.DecodeMessage(msg) - m.Op = &Op_File{msg} - return true, err - case 5: // op.build - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(BuildOp) - err := b.DecodeMessage(msg) - m.Op = &Op_Build{msg} - return true, err - default: - return false, nil - } -} - -func _Op_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Op) - // op - switch x := m.Op.(type) { - case *Op_Exec: - s := proto.Size(x.Exec) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Op_Source: - s := proto.Size(x.Source) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Op_File: - s := proto.Size(x.File) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Op_Build: - s := proto.Size(x.Build) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Platform is github.com/opencontainers/image-spec/specs-go/v1.Platform type Platform struct { Architecture string `protobuf:"bytes,1,opt,name=Architecture,proto3" json:"Architecture,omitempty"` @@ -391,21 +295,21 @@ func (m *Platform) Reset() { *m = Platform{} } func (m *Platform) String() string { return proto.CompactTextString(m) } func (*Platform) ProtoMessage() {} func (*Platform) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{1} + return fileDescriptor_8de16154b2733812, []int{1} } func (m *Platform) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Platform) XXX_Merge(src proto.Message) { - xxx_messageInfo_Platform.Merge(dst, src) +func (m *Platform) XXX_Merge(src proto.Message) { + xxx_messageInfo_Platform.Merge(m, src) } func (m *Platform) XXX_Size() int { return m.Size() @@ -463,21 +367,21 @@ func (m *Input) Reset() { *m = Input{} } func (m *Input) String() string { return proto.CompactTextString(m) } func (*Input) ProtoMessage() {} func (*Input) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{2} + return fileDescriptor_8de16154b2733812, []int{2} } func (m *Input) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Input) XXX_Merge(src proto.Message) { - xxx_messageInfo_Input.Merge(dst, src) +func (m *Input) XXX_Merge(src proto.Message) { + xxx_messageInfo_Input.Merge(m, src) } func (m *Input) XXX_Size() int { return m.Size() @@ -500,21 +404,21 @@ func (m *ExecOp) Reset() { *m = ExecOp{} } func (m *ExecOp) String() string { return proto.CompactTextString(m) } func (*ExecOp) ProtoMessage() {} func (*ExecOp) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{3} + return fileDescriptor_8de16154b2733812, []int{3} } func (m *ExecOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExecOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *ExecOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecOp.Merge(dst, src) +func (m *ExecOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExecOp.Merge(m, src) } func (m *ExecOp) XXX_Size() int { return m.Size() @@ -569,21 +473,21 @@ func (m *Meta) Reset() { *m = Meta{} } func (m *Meta) String() string { return proto.CompactTextString(m) } func (*Meta) ProtoMessage() {} func (*Meta) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{4} + return fileDescriptor_8de16154b2733812, []int{4} } func (m *Meta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Meta) XXX_Merge(src proto.Message) { - xxx_messageInfo_Meta.Merge(dst, src) +func (m *Meta) XXX_Merge(src proto.Message) { + xxx_messageInfo_Meta.Merge(m, src) } func (m *Meta) XXX_Size() int { return m.Size() @@ -653,21 +557,21 @@ func (m *Mount) Reset() { *m = Mount{} } func (m *Mount) String() string { return proto.CompactTextString(m) } func (*Mount) ProtoMessage() {} func (*Mount) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{5} + return fileDescriptor_8de16154b2733812, []int{5} } func (m *Mount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Mount) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mount.Merge(dst, src) +func (m *Mount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Mount.Merge(m, src) } func (m *Mount) XXX_Size() int { return m.Size() @@ -739,21 +643,21 @@ func (m *CacheOpt) Reset() { *m = CacheOpt{} } func (m *CacheOpt) String() string { return proto.CompactTextString(m) } func (*CacheOpt) ProtoMessage() {} func (*CacheOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{6} + return fileDescriptor_8de16154b2733812, []int{6} } func (m *CacheOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CacheOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *CacheOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheOpt.Merge(dst, src) +func (m *CacheOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheOpt.Merge(m, src) } func (m *CacheOpt) XXX_Size() int { return m.Size() @@ -797,21 +701,21 @@ func (m *SecretOpt) Reset() { *m = SecretOpt{} } func (m *SecretOpt) String() string { return proto.CompactTextString(m) } func (*SecretOpt) ProtoMessage() {} func (*SecretOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{7} + return fileDescriptor_8de16154b2733812, []int{7} } func (m *SecretOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SecretOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *SecretOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretOpt.Merge(dst, src) +func (m *SecretOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecretOpt.Merge(m, src) } func (m *SecretOpt) XXX_Size() int { return m.Size() @@ -876,21 +780,21 @@ func (m *SSHOpt) Reset() { *m = SSHOpt{} } func (m *SSHOpt) String() string { return proto.CompactTextString(m) } func (*SSHOpt) ProtoMessage() {} func (*SSHOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{8} + return fileDescriptor_8de16154b2733812, []int{8} } func (m *SSHOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SSHOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *SSHOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_SSHOpt.Merge(dst, src) +func (m *SSHOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_SSHOpt.Merge(m, src) } func (m *SSHOpt) XXX_Size() int { return m.Size() @@ -949,21 +853,21 @@ func (m *SourceOp) Reset() { *m = SourceOp{} } func (m *SourceOp) String() string { return proto.CompactTextString(m) } func (*SourceOp) ProtoMessage() {} func (*SourceOp) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{9} + return fileDescriptor_8de16154b2733812, []int{9} } func (m *SourceOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SourceOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *SourceOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceOp.Merge(dst, src) +func (m *SourceOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SourceOp.Merge(m, src) } func (m *SourceOp) XXX_Size() int { return m.Size() @@ -1001,21 +905,21 @@ func (m *BuildOp) Reset() { *m = BuildOp{} } func (m *BuildOp) String() string { return proto.CompactTextString(m) } func (*BuildOp) ProtoMessage() {} func (*BuildOp) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{10} + return fileDescriptor_8de16154b2733812, []int{10} } func (m *BuildOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *BuildOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *BuildOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_BuildOp.Merge(dst, src) +func (m *BuildOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuildOp.Merge(m, src) } func (m *BuildOp) XXX_Size() int { return m.Size() @@ -1056,21 +960,21 @@ func (m *BuildInput) Reset() { *m = BuildInput{} } func (m *BuildInput) String() string { return proto.CompactTextString(m) } func (*BuildInput) ProtoMessage() {} func (*BuildInput) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{11} + return fileDescriptor_8de16154b2733812, []int{11} } func (m *BuildInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *BuildInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *BuildInput) XXX_Merge(src proto.Message) { - xxx_messageInfo_BuildInput.Merge(dst, src) +func (m *BuildInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuildInput.Merge(m, src) } func (m *BuildInput) XXX_Size() int { return m.Size() @@ -1097,21 +1001,21 @@ func (m *OpMetadata) Reset() { *m = OpMetadata{} } func (m *OpMetadata) String() string { return proto.CompactTextString(m) } func (*OpMetadata) ProtoMessage() {} func (*OpMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{12} + return fileDescriptor_8de16154b2733812, []int{12} } func (m *OpMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *OpMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *OpMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_OpMetadata.Merge(dst, src) +func (m *OpMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_OpMetadata.Merge(m, src) } func (m *OpMetadata) XXX_Size() int { return m.Size() @@ -1158,21 +1062,21 @@ func (m *ExportCache) Reset() { *m = ExportCache{} } func (m *ExportCache) String() string { return proto.CompactTextString(m) } func (*ExportCache) ProtoMessage() {} func (*ExportCache) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{13} + return fileDescriptor_8de16154b2733812, []int{13} } func (m *ExportCache) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExportCache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *ExportCache) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExportCache.Merge(dst, src) +func (m *ExportCache) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportCache.Merge(m, src) } func (m *ExportCache) XXX_Size() int { return m.Size() @@ -1201,21 +1105,21 @@ func (m *ProxyEnv) Reset() { *m = ProxyEnv{} } func (m *ProxyEnv) String() string { return proto.CompactTextString(m) } func (*ProxyEnv) ProtoMessage() {} func (*ProxyEnv) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{14} + return fileDescriptor_8de16154b2733812, []int{14} } func (m *ProxyEnv) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ProxyEnv) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *ProxyEnv) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProxyEnv.Merge(dst, src) +func (m *ProxyEnv) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProxyEnv.Merge(m, src) } func (m *ProxyEnv) XXX_Size() int { return m.Size() @@ -1263,21 +1167,21 @@ func (m *WorkerConstraints) Reset() { *m = WorkerConstraints{} } func (m *WorkerConstraints) String() string { return proto.CompactTextString(m) } func (*WorkerConstraints) ProtoMessage() {} func (*WorkerConstraints) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{15} + return fileDescriptor_8de16154b2733812, []int{15} } func (m *WorkerConstraints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *WorkerConstraints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *WorkerConstraints) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkerConstraints.Merge(dst, src) +func (m *WorkerConstraints) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkerConstraints.Merge(m, src) } func (m *WorkerConstraints) XXX_Size() int { return m.Size() @@ -1308,21 +1212,21 @@ func (m *Definition) Reset() { *m = Definition{} } func (m *Definition) String() string { return proto.CompactTextString(m) } func (*Definition) ProtoMessage() {} func (*Definition) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{16} + return fileDescriptor_8de16154b2733812, []int{16} } func (m *Definition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Definition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *Definition) XXX_Merge(src proto.Message) { - xxx_messageInfo_Definition.Merge(dst, src) +func (m *Definition) XXX_Merge(src proto.Message) { + xxx_messageInfo_Definition.Merge(m, src) } func (m *Definition) XXX_Size() int { return m.Size() @@ -1356,21 +1260,21 @@ func (m *HostIP) Reset() { *m = HostIP{} } func (m *HostIP) String() string { return proto.CompactTextString(m) } func (*HostIP) ProtoMessage() {} func (*HostIP) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{17} + return fileDescriptor_8de16154b2733812, []int{17} } func (m *HostIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *HostIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *HostIP) XXX_Merge(src proto.Message) { - xxx_messageInfo_HostIP.Merge(dst, src) +func (m *HostIP) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostIP.Merge(m, src) } func (m *HostIP) XXX_Size() int { return m.Size() @@ -1403,21 +1307,21 @@ func (m *FileOp) Reset() { *m = FileOp{} } func (m *FileOp) String() string { return proto.CompactTextString(m) } func (*FileOp) ProtoMessage() {} func (*FileOp) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{18} + return fileDescriptor_8de16154b2733812, []int{18} } func (m *FileOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileOp.Merge(dst, src) +func (m *FileOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileOp.Merge(m, src) } func (m *FileOp) XXX_Size() int { return m.Size() @@ -1451,21 +1355,21 @@ func (m *FileAction) Reset() { *m = FileAction{} } func (m *FileAction) String() string { return proto.CompactTextString(m) } func (*FileAction) ProtoMessage() {} func (*FileAction) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{19} + return fileDescriptor_8de16154b2733812, []int{19} } func (m *FileAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileAction.Merge(dst, src) +func (m *FileAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileAction.Merge(m, src) } func (m *FileAction) XXX_Size() int { return m.Size() @@ -1483,16 +1387,16 @@ type isFileAction_Action interface { } type FileAction_Copy struct { - Copy *FileActionCopy `protobuf:"bytes,4,opt,name=copy,proto3,oneof"` + Copy *FileActionCopy `protobuf:"bytes,4,opt,name=copy,proto3,oneof" json:"copy,omitempty"` } type FileAction_Mkfile struct { - Mkfile *FileActionMkFile `protobuf:"bytes,5,opt,name=mkfile,proto3,oneof"` + Mkfile *FileActionMkFile `protobuf:"bytes,5,opt,name=mkfile,proto3,oneof" json:"mkfile,omitempty"` } type FileAction_Mkdir struct { - Mkdir *FileActionMkDir `protobuf:"bytes,6,opt,name=mkdir,proto3,oneof"` + Mkdir *FileActionMkDir `protobuf:"bytes,6,opt,name=mkdir,proto3,oneof" json:"mkdir,omitempty"` } type FileAction_Rm struct { - Rm *FileActionRm `protobuf:"bytes,7,opt,name=rm,proto3,oneof"` + Rm *FileActionRm `protobuf:"bytes,7,opt,name=rm,proto3,oneof" json:"rm,omitempty"` } func (*FileAction_Copy) isFileAction_Action() {} @@ -1535,9 +1439,9 @@ func (m *FileAction) GetRm() *FileActionRm { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*FileAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _FileAction_OneofMarshaler, _FileAction_OneofUnmarshaler, _FileAction_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*FileAction) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*FileAction_Copy)(nil), (*FileAction_Mkfile)(nil), (*FileAction_Mkdir)(nil), @@ -1545,108 +1449,6 @@ func (*FileAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) er } } -func _FileAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*FileAction) - // action - switch x := m.Action.(type) { - case *FileAction_Copy: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Copy); err != nil { - return err - } - case *FileAction_Mkfile: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Mkfile); err != nil { - return err - } - case *FileAction_Mkdir: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Mkdir); err != nil { - return err - } - case *FileAction_Rm: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Rm); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("FileAction.Action has unexpected type %T", x) - } - return nil -} - -func _FileAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*FileAction) - switch tag { - case 4: // action.copy - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileActionCopy) - err := b.DecodeMessage(msg) - m.Action = &FileAction_Copy{msg} - return true, err - case 5: // action.mkfile - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileActionMkFile) - err := b.DecodeMessage(msg) - m.Action = &FileAction_Mkfile{msg} - return true, err - case 6: // action.mkdir - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileActionMkDir) - err := b.DecodeMessage(msg) - m.Action = &FileAction_Mkdir{msg} - return true, err - case 7: // action.rm - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileActionRm) - err := b.DecodeMessage(msg) - m.Action = &FileAction_Rm{msg} - return true, err - default: - return false, nil - } -} - -func _FileAction_OneofSizer(msg proto.Message) (n int) { - m := msg.(*FileAction) - // action - switch x := m.Action.(type) { - case *FileAction_Copy: - s := proto.Size(x.Copy) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *FileAction_Mkfile: - s := proto.Size(x.Mkfile) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *FileAction_Mkdir: - s := proto.Size(x.Mkdir) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *FileAction_Rm: - s := proto.Size(x.Rm) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type FileActionCopy struct { // src is the source path Src string `protobuf:"bytes,1,opt,name=src,proto3" json:"src,omitempty"` @@ -1676,21 +1478,21 @@ func (m *FileActionCopy) Reset() { *m = FileActionCopy{} } func (m *FileActionCopy) String() string { return proto.CompactTextString(m) } func (*FileActionCopy) ProtoMessage() {} func (*FileActionCopy) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{20} + return fileDescriptor_8de16154b2733812, []int{20} } func (m *FileActionCopy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileActionCopy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileActionCopy) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileActionCopy.Merge(dst, src) +func (m *FileActionCopy) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileActionCopy.Merge(m, src) } func (m *FileActionCopy) XXX_Size() int { return m.Size() @@ -1795,21 +1597,21 @@ func (m *FileActionMkFile) Reset() { *m = FileActionMkFile{} } func (m *FileActionMkFile) String() string { return proto.CompactTextString(m) } func (*FileActionMkFile) ProtoMessage() {} func (*FileActionMkFile) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{21} + return fileDescriptor_8de16154b2733812, []int{21} } func (m *FileActionMkFile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileActionMkFile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileActionMkFile) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileActionMkFile.Merge(dst, src) +func (m *FileActionMkFile) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileActionMkFile.Merge(m, src) } func (m *FileActionMkFile) XXX_Size() int { return m.Size() @@ -1872,21 +1674,21 @@ func (m *FileActionMkDir) Reset() { *m = FileActionMkDir{} } func (m *FileActionMkDir) String() string { return proto.CompactTextString(m) } func (*FileActionMkDir) ProtoMessage() {} func (*FileActionMkDir) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{22} + return fileDescriptor_8de16154b2733812, []int{22} } func (m *FileActionMkDir) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileActionMkDir) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileActionMkDir) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileActionMkDir.Merge(dst, src) +func (m *FileActionMkDir) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileActionMkDir.Merge(m, src) } func (m *FileActionMkDir) XXX_Size() int { return m.Size() @@ -1945,21 +1747,21 @@ func (m *FileActionRm) Reset() { *m = FileActionRm{} } func (m *FileActionRm) String() string { return proto.CompactTextString(m) } func (*FileActionRm) ProtoMessage() {} func (*FileActionRm) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{23} + return fileDescriptor_8de16154b2733812, []int{23} } func (m *FileActionRm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FileActionRm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *FileActionRm) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileActionRm.Merge(dst, src) +func (m *FileActionRm) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileActionRm.Merge(m, src) } func (m *FileActionRm) XXX_Size() int { return m.Size() @@ -2000,21 +1802,21 @@ func (m *ChownOpt) Reset() { *m = ChownOpt{} } func (m *ChownOpt) String() string { return proto.CompactTextString(m) } func (*ChownOpt) ProtoMessage() {} func (*ChownOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{24} + return fileDescriptor_8de16154b2733812, []int{24} } func (m *ChownOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ChownOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *ChownOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChownOpt.Merge(dst, src) +func (m *ChownOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChownOpt.Merge(m, src) } func (m *ChownOpt) XXX_Size() int { return m.Size() @@ -2050,21 +1852,21 @@ func (m *UserOpt) Reset() { *m = UserOpt{} } func (m *UserOpt) String() string { return proto.CompactTextString(m) } func (*UserOpt) ProtoMessage() {} func (*UserOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{25} + return fileDescriptor_8de16154b2733812, []int{25} } func (m *UserOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UserOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *UserOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserOpt.Merge(dst, src) +func (m *UserOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserOpt.Merge(m, src) } func (m *UserOpt) XXX_Size() int { return m.Size() @@ -2082,10 +1884,10 @@ type isUserOpt_User interface { } type UserOpt_ByName struct { - ByName *NamedUserOpt `protobuf:"bytes,1,opt,name=byName,proto3,oneof"` + ByName *NamedUserOpt `protobuf:"bytes,1,opt,name=byName,proto3,oneof" json:"byName,omitempty"` } type UserOpt_ByID struct { - ByID uint32 `protobuf:"varint,2,opt,name=byID,proto3,oneof"` + ByID uint32 `protobuf:"varint,2,opt,name=byID,proto3,oneof" json:"byID,omitempty"` } func (*UserOpt_ByName) isUserOpt_User() {} @@ -2112,75 +1914,14 @@ func (m *UserOpt) GetByID() uint32 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*UserOpt) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _UserOpt_OneofMarshaler, _UserOpt_OneofUnmarshaler, _UserOpt_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*UserOpt) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*UserOpt_ByName)(nil), (*UserOpt_ByID)(nil), } } -func _UserOpt_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*UserOpt) - // user - switch x := m.User.(type) { - case *UserOpt_ByName: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ByName); err != nil { - return err - } - case *UserOpt_ByID: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.ByID)) - case nil: - default: - return fmt.Errorf("UserOpt.User has unexpected type %T", x) - } - return nil -} - -func _UserOpt_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*UserOpt) - switch tag { - case 1: // user.byName - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NamedUserOpt) - err := b.DecodeMessage(msg) - m.User = &UserOpt_ByName{msg} - return true, err - case 2: // user.byID - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.User = &UserOpt_ByID{uint32(x)} - return true, err - default: - return false, nil - } -} - -func _UserOpt_OneofSizer(msg proto.Message) (n int) { - m := msg.(*UserOpt) - // user - switch x := m.User.(type) { - case *UserOpt_ByName: - s := proto.Size(x.ByName) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *UserOpt_ByID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.ByID)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type NamedUserOpt struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Input InputIndex `protobuf:"varint,2,opt,name=input,proto3,customtype=InputIndex" json:"input"` @@ -2190,21 +1931,21 @@ func (m *NamedUserOpt) Reset() { *m = NamedUserOpt{} } func (m *NamedUserOpt) String() string { return proto.CompactTextString(m) } func (*NamedUserOpt) ProtoMessage() {} func (*NamedUserOpt) Descriptor() ([]byte, []int) { - return fileDescriptor_ops_0b9d2e829935306b, []int{26} + return fileDescriptor_8de16154b2733812, []int{26} } func (m *NamedUserOpt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NamedUserOpt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } -func (dst *NamedUserOpt) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedUserOpt.Merge(dst, src) +func (m *NamedUserOpt) XXX_Merge(src proto.Message) { + xxx_messageInfo_NamedUserOpt.Merge(m, src) } func (m *NamedUserOpt) XXX_Size() int { return m.Size() @@ -2223,6 +1964,10 @@ func (m *NamedUserOpt) GetName() string { } func init() { + proto.RegisterEnum("pb.NetMode", NetMode_name, NetMode_value) + proto.RegisterEnum("pb.SecurityMode", SecurityMode_name, SecurityMode_value) + proto.RegisterEnum("pb.MountType", MountType_name, MountType_value) + proto.RegisterEnum("pb.CacheSharingOpt", CacheSharingOpt_name, CacheSharingOpt_value) proto.RegisterType((*Op)(nil), "pb.Op") proto.RegisterType((*Platform)(nil), "pb.Platform") proto.RegisterType((*Input)(nil), "pb.Input") @@ -2256,15 +2001,142 @@ func init() { proto.RegisterType((*ChownOpt)(nil), "pb.ChownOpt") proto.RegisterType((*UserOpt)(nil), "pb.UserOpt") proto.RegisterType((*NamedUserOpt)(nil), "pb.NamedUserOpt") - proto.RegisterEnum("pb.NetMode", NetMode_name, NetMode_value) - proto.RegisterEnum("pb.SecurityMode", SecurityMode_name, SecurityMode_value) - proto.RegisterEnum("pb.MountType", MountType_name, MountType_value) - proto.RegisterEnum("pb.CacheSharingOpt", CacheSharingOpt_name, CacheSharingOpt_value) } + +func init() { proto.RegisterFile("ops.proto", fileDescriptor_8de16154b2733812) } + +var fileDescriptor_8de16154b2733812 = []byte{ + // 1978 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5f, 0x6f, 0x1b, 0xc7, + 0x11, 0xd7, 0x1d, 0xff, 0xde, 0x50, 0x92, 0xd9, 0x8d, 0x93, 0xb2, 0xaa, 0x2b, 0x29, 0x97, 0x34, + 0x90, 0x65, 0x5b, 0x02, 0x14, 0x20, 0x09, 0xf2, 0x50, 0x54, 0xfc, 0x63, 0x88, 0x49, 0x2c, 0x0a, + 0x4b, 0xdb, 0xe9, 0x9b, 0x71, 0xbc, 0x5b, 0x52, 0x07, 0xf2, 0x6e, 0x0f, 0x7b, 0x4b, 0x5b, 0x7c, + 0xe9, 0x83, 0x3f, 0x41, 0x80, 0x02, 0x7d, 0x6b, 0x81, 0xbe, 0x14, 0xe8, 0x87, 0xe8, 0x7b, 0x1e, + 0x83, 0xa2, 0x0f, 0x69, 0x1f, 0xd2, 0xc2, 0xfe, 0x22, 0xc5, 0xec, 0xee, 0xf1, 0x8e, 0xb4, 0x02, + 0xdb, 0x68, 0xd1, 0x27, 0xce, 0xcd, 0xfc, 0x76, 0x76, 0x76, 0x66, 0x76, 0x66, 0x96, 0xe0, 0xf0, + 0x24, 0x3d, 0x4a, 0x04, 0x97, 0x9c, 0xd8, 0xc9, 0x68, 0xe7, 0xde, 0x24, 0x94, 0x97, 0xf3, 0xd1, + 0x91, 0xcf, 0xa3, 0xe3, 0x09, 0x9f, 0xf0, 0x63, 0x25, 0x1a, 0xcd, 0xc7, 0xea, 0x4b, 0x7d, 0x28, + 0x4a, 0x2f, 0x71, 0xff, 0x64, 0x83, 0x3d, 0x48, 0xc8, 0xfb, 0x50, 0x0d, 0xe3, 0x64, 0x2e, 0xd3, + 0x96, 0xb5, 0x5f, 0x3a, 0x68, 0x9c, 0x38, 0x47, 0xc9, 0xe8, 0xa8, 0x8f, 0x1c, 0x6a, 0x04, 0x64, + 0x1f, 0xca, 0xec, 0x8a, 0xf9, 0x2d, 0x7b, 0xdf, 0x3a, 0x68, 0x9c, 0x00, 0x02, 0x7a, 0x57, 0xcc, + 0x1f, 0x24, 0x67, 0x1b, 0x54, 0x49, 0xc8, 0x47, 0x50, 0x4d, 0xf9, 0x5c, 0xf8, 0xac, 0x55, 0x52, + 0x98, 0x4d, 0xc4, 0x0c, 0x15, 0x47, 0xa1, 0x8c, 0x14, 0x35, 0x8d, 0xc3, 0x19, 0x6b, 0x95, 0x73, + 0x4d, 0xf7, 0xc3, 0x99, 0xc6, 0x28, 0x09, 0xf9, 0x00, 0x2a, 0xa3, 0x79, 0x38, 0x0b, 0x5a, 0x15, + 0x05, 0x69, 0x20, 0xa4, 0x8d, 0x0c, 0x85, 0xd1, 0x32, 0x72, 0x00, 0xf5, 0x64, 0xe6, 0xc9, 0x31, + 0x17, 0x51, 0x0b, 0xf2, 0x0d, 0x2f, 0x0c, 0x8f, 0x2e, 0xa5, 0xe4, 0x53, 0x68, 0xf8, 0x3c, 0x4e, + 0xa5, 0xf0, 0xc2, 0x58, 0xa6, 0xad, 0x86, 0x02, 0xbf, 0x8b, 0xe0, 0xaf, 0xb9, 0x98, 0x32, 0xd1, + 0xc9, 0x85, 0xb4, 0x88, 0x6c, 0x97, 0xc1, 0xe6, 0x89, 0xfb, 0x7b, 0x0b, 0xea, 0x99, 0x56, 0xe2, + 0xc2, 0xe6, 0xa9, 0xf0, 0x2f, 0x43, 0xc9, 0x7c, 0x39, 0x17, 0xac, 0x65, 0xed, 0x5b, 0x07, 0x0e, + 0x5d, 0xe1, 0x91, 0x6d, 0xb0, 0x07, 0x43, 0xe5, 0x28, 0x87, 0xda, 0x83, 0x21, 0x69, 0x41, 0xed, + 0xb1, 0x27, 0x42, 0x2f, 0x96, 0xca, 0x33, 0x0e, 0xcd, 0x3e, 0xc9, 0x2d, 0x70, 0x06, 0xc3, 0xc7, + 0x4c, 0xa4, 0x21, 0x8f, 0x95, 0x3f, 0x1c, 0x9a, 0x33, 0xc8, 0x2e, 0xc0, 0x60, 0x78, 0x9f, 0x79, + 0xa8, 0x34, 0x6d, 0x55, 0xf6, 0x4b, 0x07, 0x0e, 0x2d, 0x70, 0xdc, 0xdf, 0x42, 0x45, 0xc5, 0x88, + 0x7c, 0x01, 0xd5, 0x20, 0x9c, 0xb0, 0x54, 0x6a, 0x73, 0xda, 0x27, 0xdf, 0xfe, 0xb0, 0xb7, 0xf1, + 0xcf, 0x1f, 0xf6, 0x0e, 0x0b, 0xc9, 0xc0, 0x13, 0x16, 0xfb, 0x3c, 0x96, 0x5e, 0x18, 0x33, 0x91, + 0x1e, 0x4f, 0xf8, 0x3d, 0xbd, 0xe4, 0xa8, 0xab, 0x7e, 0xa8, 0xd1, 0x40, 0x6e, 0x43, 0x25, 0x8c, + 0x03, 0x76, 0xa5, 0xec, 0x2f, 0xb5, 0xdf, 0x31, 0xaa, 0x1a, 0x83, 0xb9, 0x4c, 0xe6, 0xb2, 0x8f, + 0x22, 0xaa, 0x11, 0xee, 0x1f, 0x2d, 0xa8, 0xea, 0x1c, 0x20, 0xb7, 0xa0, 0x1c, 0x31, 0xe9, 0xa9, + 0xfd, 0x1b, 0x27, 0x75, 0xf4, 0xed, 0x03, 0x26, 0x3d, 0xaa, 0xb8, 0x98, 0x5e, 0x11, 0x9f, 0xa3, + 0xef, 0xed, 0x3c, 0xbd, 0x1e, 0x20, 0x87, 0x1a, 0x01, 0xf9, 0x25, 0xd4, 0x62, 0x26, 0x9f, 0x71, + 0x31, 0x55, 0x3e, 0xda, 0xd6, 0x41, 0x3f, 0x67, 0xf2, 0x01, 0x0f, 0x18, 0xcd, 0x64, 0xe4, 0x2e, + 0xd4, 0x53, 0xe6, 0xcf, 0x45, 0x28, 0x17, 0xca, 0x5f, 0xdb, 0x27, 0x4d, 0x95, 0x65, 0x86, 0xa7, + 0xc0, 0x4b, 0x84, 0xfb, 0x17, 0x0b, 0xca, 0x68, 0x06, 0x21, 0x50, 0xf6, 0xc4, 0x44, 0x67, 0xb7, + 0x43, 0x15, 0x4d, 0x9a, 0x50, 0x62, 0xf1, 0x53, 0x65, 0x91, 0x43, 0x91, 0x44, 0x8e, 0xff, 0x2c, + 0x30, 0x31, 0x42, 0x12, 0xd7, 0xcd, 0x53, 0x26, 0x4c, 0x68, 0x14, 0x4d, 0x6e, 0x83, 0x93, 0x08, + 0x7e, 0xb5, 0x78, 0x82, 0xab, 0x2b, 0x85, 0xc4, 0x43, 0x66, 0x2f, 0x7e, 0x4a, 0xeb, 0x89, 0xa1, + 0xc8, 0x21, 0x00, 0xbb, 0x92, 0xc2, 0x3b, 0xe3, 0xa9, 0x4c, 0x5b, 0x55, 0x75, 0x76, 0x95, 0xef, + 0xc8, 0xe8, 0x5f, 0xd0, 0x82, 0xd4, 0xfd, 0x9b, 0x0d, 0x15, 0xe5, 0x12, 0x72, 0x80, 0x11, 0x48, + 0xe6, 0x3a, 0x98, 0xa5, 0x36, 0x31, 0x11, 0x00, 0x15, 0xeb, 0x65, 0x00, 0x30, 0xee, 0x3b, 0xe8, + 0x8d, 0x19, 0xf3, 0x25, 0x17, 0x26, 0xdd, 0x96, 0xdf, 0x68, 0x7a, 0x80, 0x19, 0xa1, 0x4f, 0xa3, + 0x68, 0x72, 0x07, 0xaa, 0x5c, 0x85, 0x51, 0x1d, 0xe8, 0x47, 0x82, 0x6b, 0x20, 0xa8, 0x5c, 0x30, + 0x2f, 0xe0, 0xf1, 0x6c, 0xa1, 0x8e, 0x59, 0xa7, 0xcb, 0x6f, 0x72, 0x07, 0x1c, 0x15, 0xb7, 0x87, + 0x8b, 0x84, 0xb5, 0xaa, 0x2a, 0x0e, 0x5b, 0xcb, 0x98, 0x22, 0x93, 0xe6, 0x72, 0xbc, 0xa8, 0xbe, + 0xe7, 0x5f, 0xb2, 0x41, 0x22, 0x5b, 0x37, 0x73, 0x7f, 0x75, 0x0c, 0x8f, 0x2e, 0xa5, 0xa8, 0x36, + 0x65, 0xbe, 0x60, 0x12, 0xa1, 0xef, 0x2a, 0xe8, 0x96, 0x09, 0xaf, 0x66, 0xd2, 0x5c, 0x4e, 0x5c, + 0xa8, 0x0e, 0x87, 0x67, 0x88, 0x7c, 0x2f, 0x2f, 0x24, 0x9a, 0x43, 0x8d, 0xc4, 0xed, 0x43, 0x3d, + 0xdb, 0x06, 0x6f, 0x65, 0xbf, 0x6b, 0xee, 0xab, 0xdd, 0xef, 0x92, 0x7b, 0x50, 0x4b, 0x2f, 0x3d, + 0x11, 0xc6, 0x13, 0xe5, 0xbb, 0xed, 0x93, 0x77, 0x96, 0x56, 0x0d, 0x35, 0x1f, 0x35, 0x65, 0x18, + 0x97, 0x83, 0xb3, 0x34, 0xe3, 0x15, 0x5d, 0x4d, 0x28, 0xcd, 0xc3, 0x40, 0xe9, 0xd9, 0xa2, 0x48, + 0x22, 0x67, 0x12, 0xea, 0x5c, 0xda, 0xa2, 0x48, 0x62, 0x40, 0x22, 0x1e, 0xe8, 0xb2, 0xb7, 0x45, + 0x15, 0x8d, 0x3e, 0xe6, 0x89, 0x0c, 0x79, 0xec, 0xcd, 0x32, 0x1f, 0x67, 0xdf, 0xee, 0x2c, 0x3b, + 0xdf, 0xff, 0x65, 0xb7, 0xdf, 0x59, 0x50, 0xcf, 0x6a, 0x35, 0x16, 0x9e, 0x30, 0x60, 0xb1, 0x0c, + 0xc7, 0x21, 0x13, 0x66, 0xe3, 0x02, 0x87, 0xdc, 0x83, 0x8a, 0x27, 0xa5, 0xc8, 0xae, 0xf3, 0x4f, + 0x8b, 0x85, 0xfe, 0xe8, 0x14, 0x25, 0xbd, 0x58, 0x8a, 0x05, 0xd5, 0xa8, 0x9d, 0xcf, 0x00, 0x72, + 0x26, 0xda, 0x3a, 0x65, 0x0b, 0xa3, 0x15, 0x49, 0x72, 0x13, 0x2a, 0x4f, 0xbd, 0xd9, 0x9c, 0x99, + 0x1c, 0xd6, 0x1f, 0x9f, 0xdb, 0x9f, 0x59, 0xee, 0x5f, 0x6d, 0xa8, 0x99, 0xc2, 0x4f, 0xee, 0x42, + 0x4d, 0x15, 0x7e, 0x63, 0xd1, 0xf5, 0x17, 0x23, 0x83, 0x90, 0xe3, 0x65, 0x47, 0x2b, 0xd8, 0x68, + 0x54, 0xe9, 0xce, 0x66, 0x6c, 0xcc, 0xfb, 0x5b, 0x29, 0x60, 0x63, 0xd3, 0xba, 0xb6, 0x11, 0xdd, + 0x65, 0xe3, 0x30, 0x0e, 0xd1, 0x3f, 0x14, 0x45, 0xe4, 0x6e, 0x76, 0xea, 0xb2, 0xd2, 0xf8, 0x5e, + 0x51, 0xe3, 0xab, 0x87, 0xee, 0x43, 0xa3, 0xb0, 0xcd, 0x35, 0xa7, 0xfe, 0xb0, 0x78, 0x6a, 0xb3, + 0xa5, 0x52, 0xa7, 0xfb, 0x6e, 0xee, 0x85, 0xff, 0xc2, 0x7f, 0x9f, 0x00, 0xe4, 0x2a, 0xdf, 0xbc, + 0xb0, 0xb8, 0xcf, 0x4b, 0x00, 0x83, 0x04, 0x4b, 0x67, 0xe0, 0xa9, 0xfa, 0xbd, 0x19, 0x4e, 0x62, + 0x2e, 0xd8, 0x13, 0x75, 0x55, 0xd5, 0xfa, 0x3a, 0x6d, 0x68, 0x9e, 0xba, 0x31, 0xe4, 0x14, 0x1a, + 0x01, 0x4b, 0x7d, 0x11, 0xaa, 0x84, 0x32, 0x4e, 0xdf, 0xc3, 0x33, 0xe5, 0x7a, 0x8e, 0xba, 0x39, + 0x42, 0xfb, 0xaa, 0xb8, 0x86, 0x9c, 0xc0, 0x26, 0xbb, 0x4a, 0xb8, 0x90, 0x66, 0x17, 0x3d, 0x1f, + 0xdc, 0xd0, 0x93, 0x06, 0xf2, 0xd5, 0x4e, 0xb4, 0xc1, 0xf2, 0x0f, 0xe2, 0x41, 0xd9, 0xf7, 0x12, + 0xdd, 0x1c, 0x1b, 0x27, 0xad, 0xb5, 0xfd, 0x3a, 0x5e, 0xa2, 0x9d, 0xd6, 0xfe, 0x18, 0xcf, 0xfa, + 0xfc, 0x5f, 0x7b, 0x77, 0x0a, 0x1d, 0x31, 0xe2, 0xa3, 0xc5, 0xb1, 0xca, 0x97, 0x69, 0x28, 0x8f, + 0xe7, 0x32, 0x9c, 0x1d, 0x7b, 0x49, 0x88, 0xea, 0x70, 0x61, 0xbf, 0x4b, 0x95, 0xea, 0x9d, 0x5f, + 0x41, 0x73, 0xdd, 0xee, 0xb7, 0x89, 0xc1, 0xce, 0xa7, 0xe0, 0x2c, 0xed, 0x78, 0xdd, 0xc2, 0x7a, + 0x31, 0x78, 0x1f, 0x40, 0xa3, 0x70, 0x6e, 0x04, 0x3e, 0x56, 0x40, 0xed, 0x7d, 0xfd, 0xe1, 0x3e, + 0xc7, 0xe1, 0x24, 0xeb, 0x37, 0xbf, 0x00, 0xb8, 0x94, 0x32, 0x79, 0xa2, 0x1a, 0x90, 0xd9, 0xc4, + 0x41, 0x8e, 0x42, 0x90, 0x3d, 0x68, 0xe0, 0x47, 0x6a, 0xe4, 0xda, 0x52, 0xb5, 0x22, 0xd5, 0x80, + 0x9f, 0x83, 0x33, 0x5e, 0x2e, 0xd7, 0x8d, 0xa3, 0x3e, 0xce, 0x56, 0xff, 0x0c, 0xea, 0x31, 0x37, + 0x32, 0xdd, 0x0f, 0x6b, 0x31, 0x57, 0x22, 0xf7, 0x0e, 0xfc, 0xe4, 0x95, 0x49, 0x8a, 0xbc, 0x07, + 0xd5, 0x71, 0x38, 0x93, 0xea, 0xba, 0x62, 0x8b, 0x35, 0x5f, 0xee, 0x3f, 0x2c, 0x80, 0xfc, 0x6a, + 0xa1, 0x47, 0xf0, 0xde, 0x21, 0x66, 0x53, 0xdf, 0xb3, 0x19, 0xd4, 0x23, 0x13, 0x41, 0x93, 0x47, + 0xb7, 0x56, 0xaf, 0xe3, 0x51, 0x16, 0x60, 0x1d, 0xdb, 0x13, 0x13, 0xdb, 0xb7, 0x99, 0x76, 0x96, + 0x3b, 0xec, 0x7c, 0x09, 0x5b, 0x2b, 0xea, 0xde, 0xf0, 0xa6, 0xe6, 0x59, 0x56, 0x0c, 0xd9, 0x5d, + 0xa8, 0xea, 0xd6, 0x8e, 0xf5, 0x17, 0x29, 0xa3, 0x46, 0xd1, 0xaa, 0x8e, 0x5f, 0x64, 0x73, 0x61, + 0xff, 0xc2, 0x3d, 0x81, 0xaa, 0x1e, 0x7c, 0xc9, 0x01, 0xd4, 0x3c, 0x1f, 0x8f, 0x96, 0x95, 0xab, + 0xed, 0x6c, 0x2a, 0x3e, 0x55, 0x6c, 0x9a, 0x89, 0xdd, 0xbf, 0xdb, 0x00, 0x39, 0xff, 0x2d, 0x66, + 0x85, 0xcf, 0x61, 0x3b, 0x65, 0x3e, 0x8f, 0x03, 0x4f, 0x2c, 0x94, 0xd4, 0x0c, 0x78, 0xd7, 0x2d, + 0x59, 0x43, 0x16, 0xe6, 0x86, 0xd2, 0xeb, 0xe7, 0x86, 0x03, 0x28, 0xfb, 0x3c, 0x59, 0x98, 0xeb, + 0x4b, 0x56, 0x0f, 0xd2, 0xe1, 0xc9, 0x02, 0xc7, 0x7c, 0x44, 0x90, 0x23, 0xa8, 0x46, 0x53, 0xf5, + 0x14, 0xd0, 0x63, 0xd4, 0xcd, 0x55, 0xec, 0x83, 0x29, 0xd2, 0xf8, 0x70, 0xd0, 0x28, 0x72, 0x07, + 0x2a, 0xd1, 0x34, 0x08, 0x85, 0x9a, 0x38, 0x1a, 0xba, 0x5f, 0x17, 0xe1, 0xdd, 0x50, 0xe0, 0xf3, + 0x40, 0x61, 0x88, 0x0b, 0xb6, 0x88, 0x5a, 0x35, 0x85, 0x6c, 0xae, 0x79, 0x33, 0x3a, 0xdb, 0xa0, + 0xb6, 0x88, 0xda, 0x75, 0xa8, 0x6a, 0xbf, 0xba, 0x7f, 0x2e, 0xc1, 0xf6, 0xaa, 0x95, 0x98, 0x07, + 0xa9, 0xf0, 0xb3, 0x3c, 0x48, 0x85, 0xbf, 0x1c, 0xa9, 0xec, 0xc2, 0x48, 0xe5, 0x42, 0x85, 0x3f, + 0x8b, 0x99, 0x28, 0xbe, 0x79, 0x3a, 0x97, 0xfc, 0x59, 0x8c, 0xc3, 0x83, 0x16, 0xad, 0xf4, 0xe2, + 0x8a, 0xe9, 0xc5, 0x1f, 0xc2, 0xd6, 0x98, 0xcf, 0x66, 0xfc, 0xd9, 0x70, 0x11, 0xcd, 0xc2, 0x78, + 0x6a, 0x1a, 0xf2, 0x2a, 0x93, 0x1c, 0xc0, 0x8d, 0x20, 0x14, 0x68, 0x4e, 0x87, 0xc7, 0x92, 0xc5, + 0x6a, 0x8a, 0x44, 0xdc, 0x3a, 0x9b, 0x7c, 0x01, 0xfb, 0x9e, 0x94, 0x2c, 0x4a, 0xe4, 0xa3, 0x38, + 0xf1, 0xfc, 0x69, 0x97, 0xfb, 0xea, 0x3e, 0x46, 0x89, 0x27, 0xc3, 0x51, 0x38, 0xc3, 0x81, 0xb9, + 0xa6, 0x96, 0xbe, 0x16, 0x47, 0x3e, 0x82, 0x6d, 0x5f, 0x30, 0x4f, 0xb2, 0x2e, 0x4b, 0xe5, 0x85, + 0x27, 0x2f, 0x5b, 0x75, 0xb5, 0x72, 0x8d, 0x8b, 0x67, 0xf0, 0xd0, 0xda, 0xaf, 0xc3, 0x59, 0xe0, + 0x7b, 0x22, 0x68, 0x39, 0xfa, 0x0c, 0x2b, 0x4c, 0x72, 0x04, 0x44, 0x31, 0x7a, 0x51, 0x22, 0x17, + 0x4b, 0x28, 0x28, 0xe8, 0x35, 0x12, 0x7c, 0x13, 0xc9, 0x30, 0x62, 0xa9, 0xf4, 0xa2, 0x44, 0xbd, + 0xd5, 0x4a, 0x34, 0x67, 0xb8, 0xdf, 0x58, 0xd0, 0x5c, 0x4f, 0x11, 0x74, 0x70, 0x82, 0x66, 0x9a, + 0xcb, 0x86, 0xf4, 0xd2, 0xe9, 0x76, 0xc1, 0xe9, 0x18, 0x40, 0xac, 0x2a, 0x18, 0xab, 0x4d, 0xaa, + 0xe8, 0x3c, 0x80, 0xe5, 0x1f, 0x0f, 0xe0, 0x8a, 0x49, 0x95, 0x75, 0x93, 0xfe, 0x60, 0xc1, 0x8d, + 0xb5, 0x34, 0x7c, 0x63, 0x8b, 0xf6, 0xa1, 0x11, 0x79, 0x53, 0x76, 0xe1, 0x09, 0x15, 0xdc, 0x92, + 0x6e, 0xac, 0x05, 0xd6, 0xff, 0xc0, 0xbe, 0x18, 0x36, 0x8b, 0xb9, 0x7f, 0xad, 0x6d, 0x59, 0x28, + 0xcf, 0xb9, 0xbc, 0xcf, 0xe7, 0x71, 0x60, 0xba, 0xd1, 0x2a, 0xf3, 0xd5, 0x80, 0x97, 0xae, 0x09, + 0xb8, 0x7b, 0x0e, 0xf5, 0xcc, 0x40, 0xb2, 0x67, 0x1e, 0x50, 0x56, 0xfe, 0x90, 0x7f, 0x94, 0x32, + 0x81, 0xb6, 0xeb, 0xd7, 0xd4, 0xfb, 0x50, 0x99, 0x08, 0x3e, 0x4f, 0x4c, 0x6d, 0x5d, 0x41, 0x68, + 0x89, 0x3b, 0x84, 0x9a, 0xe1, 0x90, 0x43, 0xa8, 0x8e, 0x16, 0xe7, 0x5e, 0xc4, 0x8c, 0x42, 0x75, + 0xb1, 0xf1, 0x3b, 0x30, 0x08, 0xac, 0x16, 0x1a, 0x41, 0x6e, 0x42, 0x79, 0xb4, 0xe8, 0x77, 0xf5, + 0x98, 0x8c, 0x35, 0x07, 0xbf, 0xda, 0x55, 0x6d, 0x90, 0xfb, 0x15, 0x6c, 0x16, 0xd7, 0xa1, 0x53, + 0xe2, 0x4c, 0xaf, 0x43, 0x15, 0x9d, 0x17, 0x57, 0xfb, 0x35, 0xc5, 0xf5, 0xf0, 0x00, 0x6a, 0xe6, + 0xa9, 0x4a, 0x1c, 0xa8, 0x3c, 0x3a, 0x1f, 0xf6, 0x1e, 0x36, 0x37, 0x48, 0x1d, 0xca, 0x67, 0x83, + 0xe1, 0xc3, 0xa6, 0x85, 0xd4, 0xf9, 0xe0, 0xbc, 0xd7, 0xb4, 0x0f, 0x6f, 0xc3, 0x66, 0xf1, 0xb1, + 0x4a, 0x1a, 0x50, 0x1b, 0x9e, 0x9e, 0x77, 0xdb, 0x83, 0xdf, 0x34, 0x37, 0xc8, 0x26, 0xd4, 0xfb, + 0xe7, 0xc3, 0x5e, 0xe7, 0x11, 0xed, 0x35, 0xad, 0xc3, 0x5f, 0x83, 0xb3, 0x7c, 0x4f, 0xa1, 0x86, + 0x76, 0xff, 0xbc, 0xdb, 0xdc, 0x20, 0x00, 0xd5, 0x61, 0xaf, 0x43, 0x7b, 0xa8, 0xb7, 0x06, 0xa5, + 0xe1, 0xf0, 0xac, 0x69, 0xe3, 0xae, 0x9d, 0xd3, 0xce, 0x59, 0xaf, 0x59, 0x42, 0xf2, 0xe1, 0x83, + 0x8b, 0xfb, 0xc3, 0x66, 0xf9, 0xf0, 0x13, 0xb8, 0xb1, 0xf6, 0x9e, 0x51, 0xab, 0xcf, 0x4e, 0x69, + 0x0f, 0x35, 0x35, 0xa0, 0x76, 0x41, 0xfb, 0x8f, 0x4f, 0x1f, 0xf6, 0x9a, 0x16, 0x0a, 0xbe, 0x1a, + 0x74, 0xbe, 0xec, 0x75, 0x9b, 0x76, 0xfb, 0xd6, 0xb7, 0x2f, 0x76, 0xad, 0xef, 0x5e, 0xec, 0x5a, + 0xdf, 0xbf, 0xd8, 0xb5, 0xfe, 0xfd, 0x62, 0xd7, 0xfa, 0xe6, 0xe5, 0xee, 0xc6, 0x77, 0x2f, 0x77, + 0x37, 0xbe, 0x7f, 0xb9, 0xbb, 0x31, 0xaa, 0xaa, 0xbf, 0x8e, 0x3e, 0xfe, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x87, 0x95, 0x80, 0x20, 0x7a, 0x12, 0x00, 0x00, +} + func (m *Op) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2272,112 +2144,153 @@ func (m *Op) Marshal() (dAtA []byte, err error) { } func (m *Op) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Inputs) > 0 { - for _, msg := range m.Inputs { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Constraints != nil { + { + size, err := m.Constraints.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - } - if m.Op != nil { - nn1, err := m.Op.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + i-- + dAtA[i] = 0x5a } if m.Platform != nil { + { + size, err := m.Platform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x52 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Platform.Size())) - n2, err := m.Platform.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 } - if m.Constraints != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Constraints.Size())) - n3, err := m.Constraints.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Op != nil { + { + size := m.Op.Size() + i -= size + if _, err := m.Op.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n3 } - return i, nil + if len(m.Inputs) > 0 { + for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *Op_Exec) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op_Exec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Exec != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Exec.Size())) - n4, err := m.Exec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Exec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Op_Source) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op_Source) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Source != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Source.Size())) - n5, err := m.Source.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *Op_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.File != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.File.Size())) - n6, err := m.File.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *Op_Build) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op_Build) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Build != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Build.Size())) - n7, err := m.Build.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Build.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *Platform) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2385,56 +2298,59 @@ func (m *Platform) Marshal() (dAtA []byte, err error) { } func (m *Platform) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Architecture) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Architecture))) - i += copy(dAtA[i:], m.Architecture) - } - if len(m.OS) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.OS))) - i += copy(dAtA[i:], m.OS) - } - if len(m.Variant) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Variant))) - i += copy(dAtA[i:], m.Variant) - } - if len(m.OSVersion) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.OSVersion))) - i += copy(dAtA[i:], m.OSVersion) - } if len(m.OSFeatures) > 0 { - for _, s := range m.OSFeatures { + for iNdEx := len(m.OSFeatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OSFeatures[iNdEx]) + copy(dAtA[i:], m.OSFeatures[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.OSFeatures[iNdEx]))) + i-- dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - return i, nil + if len(m.OSVersion) > 0 { + i -= len(m.OSVersion) + copy(dAtA[i:], m.OSVersion) + i = encodeVarintOps(dAtA, i, uint64(len(m.OSVersion))) + i-- + dAtA[i] = 0x22 + } + if len(m.Variant) > 0 { + i -= len(m.Variant) + copy(dAtA[i:], m.Variant) + i = encodeVarintOps(dAtA, i, uint64(len(m.Variant))) + i-- + dAtA[i] = 0x1a + } + if len(m.OS) > 0 { + i -= len(m.OS) + copy(dAtA[i:], m.OS) + i = encodeVarintOps(dAtA, i, uint64(len(m.OS))) + i-- + dAtA[i] = 0x12 + } + if len(m.Architecture) > 0 { + i -= len(m.Architecture) + copy(dAtA[i:], m.Architecture) + i = encodeVarintOps(dAtA, i, uint64(len(m.Architecture))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Input) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2442,28 +2358,34 @@ func (m *Input) Marshal() (dAtA []byte, err error) { } func (m *Input) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Input) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Digest) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Digest))) - i += copy(dAtA[i:], m.Digest) - } if m.Index != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintOps(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Digest) > 0 { + i -= len(m.Digest) + copy(dAtA[i:], m.Digest) + i = encodeVarintOps(dAtA, i, uint64(len(m.Digest))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ExecOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2471,49 +2393,58 @@ func (m *ExecOp) Marshal() (dAtA []byte, err error) { } func (m *ExecOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Meta != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Meta.Size())) - n8, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 + if m.Security != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Security)) + i-- + dAtA[i] = 0x20 + } + if m.Network != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Network)) + i-- + dAtA[i] = 0x18 } if len(m.Mounts) > 0 { - for _, msg := range m.Mounts { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Meta != nil { + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Network != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Network)) - } - if m.Security != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Security)) - } - return i, nil + return len(dAtA) - i, nil } func (m *Meta) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2521,81 +2452,80 @@ func (m *Meta) Marshal() (dAtA []byte, err error) { } func (m *Meta) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.ExtraHosts) > 0 { + for iNdEx := len(m.ExtraHosts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtraHosts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x32 } } - if len(m.Env) > 0 { - for _, s := range m.Env { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Cwd) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Cwd))) - i += copy(dAtA[i:], m.Cwd) - } - if len(m.User) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } if m.ProxyEnv != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.ProxyEnv.Size())) - n9, err := m.ProxyEnv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if len(m.ExtraHosts) > 0 { - for _, msg := range m.ExtraHosts { - dAtA[i] = 0x32 - i++ - i = encodeVarintOps(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + { + size, err := m.ProxyEnv.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintOps(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x22 + } + if len(m.Cwd) > 0 { + i -= len(m.Cwd) + copy(dAtA[i:], m.Cwd) + i = encodeVarintOps(dAtA, i, uint64(len(m.Cwd))) + i-- + dAtA[i] = 0x1a + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Env[iNdEx]) + copy(dAtA[i:], m.Env[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2603,90 +2533,103 @@ func (m *Mount) Marshal() (dAtA []byte, err error) { } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Input != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Input)) + if m.SSHOpt != nil { + { + size, err := m.SSHOpt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 } - if len(m.Selector) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Selector))) - i += copy(dAtA[i:], m.Selector) + if m.SecretOpt != nil { + { + size, err := m.SecretOpt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa } - if len(m.Dest) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Dest))) - i += copy(dAtA[i:], m.Dest) + if m.CacheOpt != nil { + { + size, err := m.CacheOpt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 } - if m.Output != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Output)) + if m.MountType != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.MountType)) + i-- + dAtA[i] = 0x30 } if m.Readonly { - dAtA[i] = 0x28 - i++ + i-- if m.Readonly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.MountType != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.MountType)) + if m.Output != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Output)) + i-- + dAtA[i] = 0x20 } - if m.CacheOpt != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.CacheOpt.Size())) - n10, err := m.CacheOpt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 + if len(m.Dest) > 0 { + i -= len(m.Dest) + copy(dAtA[i:], m.Dest) + i = encodeVarintOps(dAtA, i, uint64(len(m.Dest))) + i-- + dAtA[i] = 0x1a } - if m.SecretOpt != nil { - dAtA[i] = 0xaa - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.SecretOpt.Size())) - n11, err := m.SecretOpt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 + if len(m.Selector) > 0 { + i -= len(m.Selector) + copy(dAtA[i:], m.Selector) + i = encodeVarintOps(dAtA, i, uint64(len(m.Selector))) + i-- + dAtA[i] = 0x12 } - if m.SSHOpt != nil { - dAtA[i] = 0xb2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.SSHOpt.Size())) - n12, err := m.SSHOpt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if m.Input != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Input)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *CacheOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2694,28 +2637,34 @@ func (m *CacheOpt) Marshal() (dAtA []byte, err error) { } func (m *CacheOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CacheOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } if m.Sharing != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintOps(dAtA, i, uint64(m.Sharing)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SecretOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2723,48 +2672,54 @@ func (m *SecretOpt) Marshal() (dAtA []byte, err error) { } func (m *SecretOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.Uid != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Uid)) - } - if m.Gid != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Gid)) - } - if m.Mode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mode)) - } if m.Optional { - dAtA[i] = 0x28 - i++ + i-- if m.Optional { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - return i, nil + if m.Mode != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x20 + } + if m.Gid != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Gid)) + i-- + dAtA[i] = 0x18 + } + if m.Uid != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Uid)) + i-- + dAtA[i] = 0x10 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SSHOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2772,48 +2727,54 @@ func (m *SSHOpt) Marshal() (dAtA []byte, err error) { } func (m *SSHOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SSHOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.Uid != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Uid)) - } - if m.Gid != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Gid)) - } - if m.Mode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mode)) - } if m.Optional { - dAtA[i] = 0x28 - i++ + i-- if m.Optional { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - return i, nil + if m.Mode != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x20 + } + if m.Gid != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Gid)) + i-- + dAtA[i] = 0x18 + } + if m.Uid != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Uid)) + i-- + dAtA[i] = 0x10 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintOps(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SourceOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2821,45 +2782,53 @@ func (m *SourceOp) Marshal() (dAtA []byte, err error) { } func (m *SourceOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SourceOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Identifier) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Identifier))) - i += copy(dAtA[i:], m.Identifier) - } if len(m.Attrs) > 0 { keysForAttrs := make([]string, 0, len(m.Attrs)) - for k, _ := range m.Attrs { + for k := range m.Attrs { keysForAttrs = append(keysForAttrs, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForAttrs) - for _, k := range keysForAttrs { - dAtA[i] = 0x12 - i++ - v := m.Attrs[string(k)] - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + 1 + len(v) + sovOps(uint64(len(v))) - i = encodeVarintOps(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + for iNdEx := len(keysForAttrs) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attrs[string(keysForAttrs[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintOps(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(keysForAttrs[iNdEx]) + copy(dAtA[i:], keysForAttrs[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForAttrs[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintOps(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *BuildOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2867,87 +2836,94 @@ func (m *BuildOp) Marshal() (dAtA []byte, err error) { } func (m *BuildOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuildOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Builder != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Builder)) - } - if len(m.Inputs) > 0 { - keysForInputs := make([]string, 0, len(m.Inputs)) - for k, _ := range m.Inputs { - keysForInputs = append(keysForInputs, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForInputs) - for _, k := range keysForInputs { - dAtA[i] = 0x12 - i++ - v := m.Inputs[string(k)] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovOps(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + msgSize - i = encodeVarintOps(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(v.Size())) - n13, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - } - } - if m.Def != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Def.Size())) - n14, err := m.Def.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } if len(m.Attrs) > 0 { keysForAttrs := make([]string, 0, len(m.Attrs)) - for k, _ := range m.Attrs { + for k := range m.Attrs { keysForAttrs = append(keysForAttrs, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForAttrs) - for _, k := range keysForAttrs { - dAtA[i] = 0x22 - i++ - v := m.Attrs[string(k)] - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + 1 + len(v) + sovOps(uint64(len(v))) - i = encodeVarintOps(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + for iNdEx := len(keysForAttrs) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attrs[string(keysForAttrs[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintOps(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(keysForAttrs[iNdEx]) + copy(dAtA[i:], keysForAttrs[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForAttrs[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - return i, nil + if m.Def != nil { + { + size, err := m.Def.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Inputs) > 0 { + keysForInputs := make([]string, 0, len(m.Inputs)) + for k := range m.Inputs { + keysForInputs = append(keysForInputs, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInputs) + for iNdEx := len(keysForInputs) - 1; iNdEx >= 0; iNdEx-- { + v := m.Inputs[string(keysForInputs[iNdEx])] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(keysForInputs[iNdEx]) + copy(dAtA[i:], keysForInputs[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForInputs[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Builder != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Builder)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *BuildInput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2955,22 +2931,27 @@ func (m *BuildInput) Marshal() (dAtA []byte, err error) { } func (m *BuildInput) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuildInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Input != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintOps(dAtA, i, uint64(m.Input)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *OpMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2978,85 +2959,95 @@ func (m *OpMetadata) Marshal() (dAtA []byte, err error) { } func (m *OpMetadata) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OpMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IgnoreCache { - dAtA[i] = 0x8 - i++ - if m.IgnoreCache { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if len(m.Description) > 0 { - keysForDescription := make([]string, 0, len(m.Description)) - for k, _ := range m.Description { - keysForDescription = append(keysForDescription, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDescription) - for _, k := range keysForDescription { - dAtA[i] = 0x12 - i++ - v := m.Description[string(k)] - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + 1 + len(v) + sovOps(uint64(len(v))) - i = encodeVarintOps(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if m.ExportCache != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.ExportCache.Size())) - n15, err := m.ExportCache.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } if len(m.Caps) > 0 { keysForCaps := make([]string, 0, len(m.Caps)) - for k, _ := range m.Caps { + for k := range m.Caps { keysForCaps = append(keysForCaps, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForCaps) - for _, k := range keysForCaps { - dAtA[i] = 0x2a - i++ - v := m.Caps[github_com_moby_buildkit_util_apicaps.CapID(k)] - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + 1 + 1 - i = encodeVarintOps(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x10 - i++ + for iNdEx := len(keysForCaps) - 1; iNdEx >= 0; iNdEx-- { + v := m.Caps[github_com_moby_buildkit_util_apicaps.CapID(keysForCaps[iNdEx])] + baseI := i + i-- if v { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 + i -= len(keysForCaps[iNdEx]) + copy(dAtA[i:], keysForCaps[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForCaps[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - return i, nil + if m.ExportCache != nil { + { + size, err := m.ExportCache.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Description) > 0 { + keysForDescription := make([]string, 0, len(m.Description)) + for k := range m.Description { + keysForDescription = append(keysForDescription, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDescription) + for iNdEx := len(keysForDescription) - 1; iNdEx >= 0; iNdEx-- { + v := m.Description[string(keysForDescription[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintOps(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForDescription[iNdEx]) + copy(dAtA[i:], keysForDescription[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForDescription[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.IgnoreCache { + i-- + if m.IgnoreCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *ExportCache) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3064,27 +3055,32 @@ func (m *ExportCache) Marshal() (dAtA []byte, err error) { } func (m *ExportCache) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportCache) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Value { - dAtA[i] = 0x8 - i++ + i-- if m.Value { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProxyEnv) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3092,41 +3088,50 @@ func (m *ProxyEnv) Marshal() (dAtA []byte, err error) { } func (m *ProxyEnv) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProxyEnv) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HttpProxy) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.HttpProxy))) - i += copy(dAtA[i:], m.HttpProxy) - } - if len(m.HttpsProxy) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.HttpsProxy))) - i += copy(dAtA[i:], m.HttpsProxy) + if len(m.NoProxy) > 0 { + i -= len(m.NoProxy) + copy(dAtA[i:], m.NoProxy) + i = encodeVarintOps(dAtA, i, uint64(len(m.NoProxy))) + i-- + dAtA[i] = 0x22 } if len(m.FtpProxy) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.FtpProxy) + copy(dAtA[i:], m.FtpProxy) i = encodeVarintOps(dAtA, i, uint64(len(m.FtpProxy))) - i += copy(dAtA[i:], m.FtpProxy) + i-- + dAtA[i] = 0x1a } - if len(m.NoProxy) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.NoProxy))) - i += copy(dAtA[i:], m.NoProxy) + if len(m.HttpsProxy) > 0 { + i -= len(m.HttpsProxy) + copy(dAtA[i:], m.HttpsProxy) + i = encodeVarintOps(dAtA, i, uint64(len(m.HttpsProxy))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.HttpProxy) > 0 { + i -= len(m.HttpProxy) + copy(dAtA[i:], m.HttpProxy) + i = encodeVarintOps(dAtA, i, uint64(len(m.HttpProxy))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *WorkerConstraints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3134,32 +3139,31 @@ func (m *WorkerConstraints) Marshal() (dAtA []byte, err error) { } func (m *WorkerConstraints) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkerConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Filter) > 0 { - for _, s := range m.Filter { + for iNdEx := len(m.Filter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Filter[iNdEx]) + copy(dAtA[i:], m.Filter[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.Filter[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - return i, nil + return len(dAtA) - i, nil } func (m *Definition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3167,56 +3171,60 @@ func (m *Definition) Marshal() (dAtA []byte, err error) { } func (m *Definition) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Definition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Def) > 0 { - for _, b := range m.Def { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(b))) - i += copy(dAtA[i:], b) - } - } if len(m.Metadata) > 0 { keysForMetadata := make([]string, 0, len(m.Metadata)) - for k, _ := range m.Metadata { + for k := range m.Metadata { keysForMetadata = append(keysForMetadata, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) - for _, k := range keysForMetadata { - dAtA[i] = 0x12 - i++ - v := m.Metadata[github_com_opencontainers_go_digest.Digest(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovOps(uint64(msgSize)) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[github_com_opencontainers_go_digest.Digest(keysForMetadata[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - mapSize := 1 + len(k) + sovOps(uint64(len(k))) + msgSize - i = encodeVarintOps(dAtA, i, uint64(mapSize)) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + i = encodeVarintOps(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64((&v).Size())) - n16, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 } } - return i, nil + if len(m.Def) > 0 { + for iNdEx := len(m.Def) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Def[iNdEx]) + copy(dAtA[i:], m.Def[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.Def[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *HostIP) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3224,29 +3232,36 @@ func (m *HostIP) Marshal() (dAtA []byte, err error) { } func (m *HostIP) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Host) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Host))) - i += copy(dAtA[i:], m.Host) - } if len(m.IP) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.IP) + copy(dAtA[i:], m.IP) i = encodeVarintOps(dAtA, i, uint64(len(m.IP))) - i += copy(dAtA[i:], m.IP) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintOps(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *FileOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3254,29 +3269,36 @@ func (m *FileOp) Marshal() (dAtA []byte, err error) { } func (m *FileOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Actions) > 0 { - for _, msg := range m.Actions { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + return len(dAtA) - i, nil } func (m *FileAction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3284,95 +3306,130 @@ func (m *FileAction) Marshal() (dAtA []byte, err error) { } func (m *FileAction) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Input != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Input)) - } - if m.SecondaryInput != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.SecondaryInput)) + if m.Action != nil { + { + size := m.Action.Size() + i -= size + if _, err := m.Action.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if m.Output != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintOps(dAtA, i, uint64(m.Output)) + i-- + dAtA[i] = 0x18 } - if m.Action != nil { - nn17, err := m.Action.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn17 + if m.SecondaryInput != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.SecondaryInput)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Input != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Input)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *FileAction_Copy) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileAction_Copy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Copy != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Copy.Size())) - n18, err := m.Copy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Copy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *FileAction_Mkfile) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileAction_Mkfile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Mkfile != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mkfile.Size())) - n19, err := m.Mkfile.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Mkfile.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *FileAction_Mkdir) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileAction_Mkdir) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Mkdir != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mkdir.Size())) - n20, err := m.Mkdir.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Mkdir.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *FileAction_Rm) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileAction_Rm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Rm != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Rm.Size())) - n21, err := m.Rm.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Rm.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *FileActionCopy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3380,109 +3437,118 @@ func (m *FileActionCopy) Marshal() (dAtA []byte, err error) { } func (m *FileActionCopy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileActionCopy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Src) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Src))) - i += copy(dAtA[i:], m.Src) - } - if len(m.Dest) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Dest))) - i += copy(dAtA[i:], m.Dest) - } - if m.Owner != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Owner.Size())) - n22, err := m.Owner.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.Mode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mode)) - } - if m.FollowSymlink { - dAtA[i] = 0x28 - i++ - if m.FollowSymlink { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.DirCopyContents { - dAtA[i] = 0x30 - i++ - if m.DirCopyContents { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.AttemptUnpackDockerCompatibility { - dAtA[i] = 0x38 - i++ - if m.AttemptUnpackDockerCompatibility { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.CreateDestPath { - dAtA[i] = 0x40 - i++ - if m.CreateDestPath { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.AllowWildcard { - dAtA[i] = 0x48 - i++ - if m.AllowWildcard { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if m.Timestamp != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x58 } if m.AllowEmptyWildcard { - dAtA[i] = 0x50 - i++ + i-- if m.AllowEmptyWildcard { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x50 } - if m.Timestamp != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + if m.AllowWildcard { + i-- + if m.AllowWildcard { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 } - return i, nil + if m.CreateDestPath { + i-- + if m.CreateDestPath { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.AttemptUnpackDockerCompatibility { + i-- + if m.AttemptUnpackDockerCompatibility { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.DirCopyContents { + i-- + if m.DirCopyContents { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.FollowSymlink { + i-- + if m.FollowSymlink { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Mode != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x20 + } + if m.Owner != nil { + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Dest) > 0 { + i -= len(m.Dest) + copy(dAtA[i:], m.Dest) + i = encodeVarintOps(dAtA, i, uint64(len(m.Dest))) + i-- + dAtA[i] = 0x12 + } + if len(m.Src) > 0 { + i -= len(m.Src) + copy(dAtA[i:], m.Src) + i = encodeVarintOps(dAtA, i, uint64(len(m.Src))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *FileActionMkFile) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3490,49 +3556,58 @@ func (m *FileActionMkFile) Marshal() (dAtA []byte, err error) { } func (m *FileActionMkFile) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileActionMkFile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Path) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) - } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mode)) - } - if len(m.Data) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + if m.Timestamp != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x28 } if m.Owner != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Owner.Size())) - n23, err := m.Owner.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n23 + i-- + dAtA[i] = 0x22 } - if m.Timestamp != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintOps(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a } - return i, nil + if m.Mode != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *FileActionMkDir) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3540,53 +3615,61 @@ func (m *FileActionMkDir) Marshal() (dAtA []byte, err error) { } func (m *FileActionMkDir) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileActionMkDir) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Path) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) + if m.Timestamp != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x28 } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + if m.Owner != nil { + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.MakeParents { - dAtA[i] = 0x18 - i++ + i-- if m.MakeParents { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.Owner != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Owner.Size())) - n24, err := m.Owner.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 + if m.Mode != 0 { + i = encodeVarintOps(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if m.Timestamp != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FileActionRm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3594,43 +3677,49 @@ func (m *FileActionRm) Marshal() (dAtA []byte, err error) { } func (m *FileActionRm) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileActionRm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Path) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) - } - if m.AllowNotFound { - dAtA[i] = 0x10 - i++ - if m.AllowNotFound { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.AllowWildcard { - dAtA[i] = 0x18 - i++ + i-- if m.AllowWildcard { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if m.AllowNotFound { + i-- + if m.AllowNotFound { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintOps(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ChownOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3638,37 +3727,46 @@ func (m *ChownOpt) Marshal() (dAtA []byte, err error) { } func (m *ChownOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChownOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.User != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(m.User.Size())) - n25, err := m.User.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 - } if m.Group != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOps(dAtA, i, uint64(m.Group.Size())) - n26, err := m.Group.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.User != nil { + { + size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UserOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3676,45 +3774,64 @@ func (m *UserOpt) Marshal() (dAtA []byte, err error) { } func (m *UserOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.User != nil { - nn27, err := m.User.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.User.Size() + i -= size + if _, err := m.User.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn27 } - return i, nil + return len(dAtA) - i, nil } func (m *UserOpt_ByName) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserOpt_ByName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ByName != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(m.ByName.Size())) - n28, err := m.ByName.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ByName.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOps(dAtA, i, uint64(size)) } - i += n28 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UserOpt_ByID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserOpt_ByID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOps(dAtA, i, uint64(m.ByID)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *NamedUserOpt) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3722,32 +3839,40 @@ func (m *NamedUserOpt) Marshal() (dAtA []byte, err error) { } func (m *NamedUserOpt) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NamedUserOpt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOps(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if m.Input != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintOps(dAtA, i, uint64(m.Input)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOps(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintOps(dAtA []byte, offset int, v uint64) int { + offset -= sovOps(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Op) Size() (n int) { if m == nil { @@ -4504,14 +4629,7 @@ func (m *NamedUserOpt) Size() (n int) { } func sovOps(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozOps(x uint64) (n int) { return sovOps(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4531,7 +4649,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4559,7 +4677,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4568,6 +4686,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4590,7 +4711,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4599,6 +4720,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4622,7 +4746,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4631,6 +4755,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4654,7 +4781,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4663,6 +4790,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4686,7 +4816,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4695,6 +4825,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4718,7 +4851,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4727,6 +4860,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4751,7 +4887,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -4760,6 +4896,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4779,6 +4918,9 @@ func (m *Op) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -4806,7 +4948,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4834,7 +4976,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4844,6 +4986,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4863,7 +5008,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4873,6 +5018,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4892,7 +5040,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4902,6 +5050,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4921,7 +5072,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4931,6 +5082,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4950,7 +5104,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -4960,6 +5114,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -4974,6 +5131,9 @@ func (m *Platform) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5001,7 +5161,7 @@ func (m *Input) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5029,7 +5189,7 @@ func (m *Input) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5039,6 +5199,9 @@ func (m *Input) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5058,7 +5221,7 @@ func (m *Input) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Index |= (OutputIndex(b) & 0x7F) << shift + m.Index |= OutputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -5072,6 +5235,9 @@ func (m *Input) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5099,7 +5265,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5127,7 +5293,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5136,6 +5302,9 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5160,7 +5329,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5169,6 +5338,9 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5191,7 +5363,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Network |= (NetMode(b) & 0x7F) << shift + m.Network |= NetMode(b&0x7F) << shift if b < 0x80 { break } @@ -5210,7 +5382,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Security |= (SecurityMode(b) & 0x7F) << shift + m.Security |= SecurityMode(b&0x7F) << shift if b < 0x80 { break } @@ -5224,6 +5396,9 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5251,7 +5426,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5279,7 +5454,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5289,6 +5464,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5308,7 +5486,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5318,6 +5496,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5337,7 +5518,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5347,6 +5528,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5366,7 +5550,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5376,6 +5560,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5395,7 +5582,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5404,6 +5591,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5428,7 +5618,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5437,6 +5627,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5454,6 +5647,9 @@ func (m *Meta) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5481,7 +5677,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5509,7 +5705,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Input |= (InputIndex(b) & 0x7F) << shift + m.Input |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -5528,7 +5724,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5538,6 +5734,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5557,7 +5756,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5567,6 +5766,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5586,7 +5788,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Output |= (OutputIndex(b) & 0x7F) << shift + m.Output |= OutputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -5605,7 +5807,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5625,7 +5827,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MountType |= (MountType(b) & 0x7F) << shift + m.MountType |= MountType(b&0x7F) << shift if b < 0x80 { break } @@ -5644,7 +5846,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5653,6 +5855,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5677,7 +5882,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5686,6 +5891,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5710,7 +5918,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5719,6 +5927,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5738,6 +5949,9 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5765,7 +5979,7 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5793,7 +6007,7 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5803,6 +6017,9 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5822,7 +6039,7 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Sharing |= (CacheSharingOpt(b) & 0x7F) << shift + m.Sharing |= CacheSharingOpt(b&0x7F) << shift if b < 0x80 { break } @@ -5836,6 +6053,9 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -5863,7 +6083,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5891,7 +6111,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -5901,6 +6121,9 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -5920,7 +6143,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Uid |= (uint32(b) & 0x7F) << shift + m.Uid |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -5939,7 +6162,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Gid |= (uint32(b) & 0x7F) << shift + m.Gid |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -5958,7 +6181,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mode |= (uint32(b) & 0x7F) << shift + m.Mode |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -5977,7 +6200,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -5992,6 +6215,9 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -6019,7 +6245,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6047,7 +6273,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6057,6 +6283,9 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6076,7 +6305,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Uid |= (uint32(b) & 0x7F) << shift + m.Uid |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -6095,7 +6324,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Gid |= (uint32(b) & 0x7F) << shift + m.Gid |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -6114,7 +6343,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mode |= (uint32(b) & 0x7F) << shift + m.Mode |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -6133,7 +6362,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6148,6 +6377,9 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -6175,7 +6407,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6203,7 +6435,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6213,6 +6445,9 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6232,7 +6467,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6241,6 +6476,9 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6261,7 +6499,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6278,7 +6516,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6288,6 +6526,9 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -6304,7 +6545,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6314,6 +6555,9 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -6345,6 +6589,9 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -6372,7 +6619,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6400,7 +6647,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Builder |= (InputIndex(b) & 0x7F) << shift + m.Builder |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -6419,7 +6666,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6428,6 +6675,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6448,7 +6698,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6465,7 +6715,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6475,6 +6725,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -6491,7 +6744,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift + mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6500,7 +6753,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { + if postmsgIndex < 0 { return ErrInvalidLengthOps } if postmsgIndex > l { @@ -6542,7 +6795,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6551,6 +6804,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6575,7 +6831,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6584,6 +6840,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6604,7 +6863,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6621,7 +6880,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6631,6 +6890,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -6647,7 +6909,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6657,6 +6919,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -6688,6 +6953,9 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -6715,7 +6983,7 @@ func (m *BuildInput) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6743,7 +7011,7 @@ func (m *BuildInput) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Input |= (InputIndex(b) & 0x7F) << shift + m.Input |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -6757,6 +7025,9 @@ func (m *BuildInput) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -6784,7 +7055,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6812,7 +7083,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6832,7 +7103,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6841,6 +7112,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6861,7 +7135,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6878,7 +7152,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6888,6 +7162,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -6904,7 +7181,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -6914,6 +7191,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } @@ -6950,7 +7230,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6959,6 +7239,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -6983,7 +7266,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -6992,6 +7275,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7012,7 +7298,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7029,7 +7315,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7039,6 +7325,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -7055,7 +7344,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapvaluetemp |= (int(b) & 0x7F) << shift + mapvaluetemp |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7087,6 +7376,9 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7114,7 +7406,7 @@ func (m *ExportCache) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7142,7 +7434,7 @@ func (m *ExportCache) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7157,6 +7449,9 @@ func (m *ExportCache) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7184,7 +7479,7 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7212,7 +7507,7 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7222,6 +7517,9 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7241,7 +7539,7 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7251,6 +7549,9 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7270,7 +7571,7 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7280,6 +7581,9 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7299,7 +7603,7 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7309,6 +7613,9 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7323,6 +7630,9 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7350,7 +7660,7 @@ func (m *WorkerConstraints) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7378,7 +7688,7 @@ func (m *WorkerConstraints) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7388,6 +7698,9 @@ func (m *WorkerConstraints) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7402,6 +7715,9 @@ func (m *WorkerConstraints) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7429,7 +7745,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7457,7 +7773,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7466,6 +7782,9 @@ func (m *Definition) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7486,7 +7805,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7495,6 +7814,9 @@ func (m *Definition) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7515,7 +7837,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7532,7 +7854,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift + stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7542,6 +7864,9 @@ func (m *Definition) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthOps + } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } @@ -7558,7 +7883,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift + mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7567,7 +7892,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { + if postmsgIndex < 0 { return ErrInvalidLengthOps } if postmsgIndex > l { @@ -7604,6 +7929,9 @@ func (m *Definition) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7631,7 +7959,7 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7659,7 +7987,7 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7669,6 +7997,9 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7688,7 +8019,7 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7698,6 +8029,9 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7712,6 +8046,9 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7739,7 +8076,7 @@ func (m *FileOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7767,7 +8104,7 @@ func (m *FileOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7776,6 +8113,9 @@ func (m *FileOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7793,6 +8133,9 @@ func (m *FileOp) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -7820,7 +8163,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7848,7 +8191,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Input |= (InputIndex(b) & 0x7F) << shift + m.Input |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -7867,7 +8210,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SecondaryInput |= (InputIndex(b) & 0x7F) << shift + m.SecondaryInput |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -7886,7 +8229,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Output |= (OutputIndex(b) & 0x7F) << shift + m.Output |= OutputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -7905,7 +8248,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7914,6 +8257,9 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7937,7 +8283,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7946,6 +8292,9 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -7969,7 +8318,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -7978,6 +8327,9 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8001,7 +8353,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8010,6 +8362,9 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8028,6 +8383,9 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8055,7 +8413,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8083,7 +8441,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8093,6 +8451,9 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8112,7 +8473,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8122,6 +8483,9 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8141,7 +8505,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8150,6 +8514,9 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8174,7 +8541,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mode |= (int32(b) & 0x7F) << shift + m.Mode |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -8193,7 +8560,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8213,7 +8580,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8233,7 +8600,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8253,7 +8620,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8273,7 +8640,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8293,7 +8660,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8313,7 +8680,7 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= (int64(b) & 0x7F) << shift + m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -8327,6 +8694,9 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8354,7 +8724,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8382,7 +8752,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8392,6 +8762,9 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8411,7 +8784,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mode |= (int32(b) & 0x7F) << shift + m.Mode |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -8430,7 +8803,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8439,6 +8812,9 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8461,7 +8837,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8470,6 +8846,9 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8494,7 +8873,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= (int64(b) & 0x7F) << shift + m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -8508,6 +8887,9 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8535,7 +8917,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8563,7 +8945,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8573,6 +8955,9 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8592,7 +8977,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mode |= (int32(b) & 0x7F) << shift + m.Mode |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -8611,7 +8996,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8631,7 +9016,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8640,6 +9025,9 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8664,7 +9052,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= (int64(b) & 0x7F) << shift + m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -8678,6 +9066,9 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8705,7 +9096,7 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8733,7 +9124,7 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8743,6 +9134,9 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8762,7 +9156,7 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8782,7 +9176,7 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8797,6 +9191,9 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8824,7 +9221,7 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8852,7 +9249,7 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8861,6 +9258,9 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8885,7 +9285,7 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8894,6 +9294,9 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -8913,6 +9316,9 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -8940,7 +9346,7 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -8968,7 +9374,7 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -8977,6 +9383,9 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -9000,7 +9409,7 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -9015,6 +9424,9 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -9042,7 +9454,7 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9070,7 +9482,7 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9080,6 +9492,9 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { return ErrInvalidLengthOps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -9099,7 +9514,7 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Input |= (InputIndex(b) & 0x7F) << shift + m.Input |= InputIndex(b&0x7F) << shift if b < 0x80 { break } @@ -9113,6 +9528,9 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthOps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -9128,6 +9546,7 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { func skipOps(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9159,10 +9578,8 @@ func skipOps(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9179,183 +9596,34 @@ func skipOps(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthOps } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOps - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipOps(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOps + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthOps + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthOps = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOps = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthOps = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOps = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOps = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("ops.proto", fileDescriptor_ops_0b9d2e829935306b) } - -var fileDescriptor_ops_0b9d2e829935306b = []byte{ - // 1978 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5f, 0x6f, 0x1b, 0xc7, - 0x11, 0xd7, 0x1d, 0xff, 0xde, 0x50, 0x92, 0xd9, 0x8d, 0x93, 0xb2, 0xaa, 0x2b, 0x29, 0x97, 0x34, - 0x90, 0x65, 0x5b, 0x02, 0x14, 0x20, 0x09, 0xf2, 0x50, 0x54, 0xfc, 0x63, 0x88, 0x49, 0x2c, 0x0a, - 0x4b, 0xdb, 0xe9, 0x9b, 0x71, 0xbc, 0x5b, 0x52, 0x07, 0xf2, 0x6e, 0x0f, 0x7b, 0x4b, 0x5b, 0x7c, - 0xe9, 0x83, 0x3f, 0x41, 0x80, 0x02, 0x7d, 0x6b, 0x81, 0xbe, 0x14, 0xe8, 0x87, 0xe8, 0x7b, 0x1e, - 0x83, 0xa2, 0x0f, 0x69, 0x1f, 0xd2, 0xc2, 0xfe, 0x22, 0xc5, 0xec, 0xee, 0xf1, 0x8e, 0xb4, 0x02, - 0xdb, 0x68, 0xd1, 0x27, 0xce, 0xcd, 0xfc, 0x76, 0x76, 0x76, 0x66, 0x76, 0x66, 0x96, 0xe0, 0xf0, - 0x24, 0x3d, 0x4a, 0x04, 0x97, 0x9c, 0xd8, 0xc9, 0x68, 0xe7, 0xde, 0x24, 0x94, 0x97, 0xf3, 0xd1, - 0x91, 0xcf, 0xa3, 0xe3, 0x09, 0x9f, 0xf0, 0x63, 0x25, 0x1a, 0xcd, 0xc7, 0xea, 0x4b, 0x7d, 0x28, - 0x4a, 0x2f, 0x71, 0xff, 0x64, 0x83, 0x3d, 0x48, 0xc8, 0xfb, 0x50, 0x0d, 0xe3, 0x64, 0x2e, 0xd3, - 0x96, 0xb5, 0x5f, 0x3a, 0x68, 0x9c, 0x38, 0x47, 0xc9, 0xe8, 0xa8, 0x8f, 0x1c, 0x6a, 0x04, 0x64, - 0x1f, 0xca, 0xec, 0x8a, 0xf9, 0x2d, 0x7b, 0xdf, 0x3a, 0x68, 0x9c, 0x00, 0x02, 0x7a, 0x57, 0xcc, - 0x1f, 0x24, 0x67, 0x1b, 0x54, 0x49, 0xc8, 0x47, 0x50, 0x4d, 0xf9, 0x5c, 0xf8, 0xac, 0x55, 0x52, - 0x98, 0x4d, 0xc4, 0x0c, 0x15, 0x47, 0xa1, 0x8c, 0x14, 0x35, 0x8d, 0xc3, 0x19, 0x6b, 0x95, 0x73, - 0x4d, 0xf7, 0xc3, 0x99, 0xc6, 0x28, 0x09, 0xf9, 0x00, 0x2a, 0xa3, 0x79, 0x38, 0x0b, 0x5a, 0x15, - 0x05, 0x69, 0x20, 0xa4, 0x8d, 0x0c, 0x85, 0xd1, 0x32, 0x72, 0x00, 0xf5, 0x64, 0xe6, 0xc9, 0x31, - 0x17, 0x51, 0x0b, 0xf2, 0x0d, 0x2f, 0x0c, 0x8f, 0x2e, 0xa5, 0xe4, 0x53, 0x68, 0xf8, 0x3c, 0x4e, - 0xa5, 0xf0, 0xc2, 0x58, 0xa6, 0xad, 0x86, 0x02, 0xbf, 0x8b, 0xe0, 0xaf, 0xb9, 0x98, 0x32, 0xd1, - 0xc9, 0x85, 0xb4, 0x88, 0x6c, 0x97, 0xc1, 0xe6, 0x89, 0xfb, 0x7b, 0x0b, 0xea, 0x99, 0x56, 0xe2, - 0xc2, 0xe6, 0xa9, 0xf0, 0x2f, 0x43, 0xc9, 0x7c, 0x39, 0x17, 0xac, 0x65, 0xed, 0x5b, 0x07, 0x0e, - 0x5d, 0xe1, 0x91, 0x6d, 0xb0, 0x07, 0x43, 0xe5, 0x28, 0x87, 0xda, 0x83, 0x21, 0x69, 0x41, 0xed, - 0xb1, 0x27, 0x42, 0x2f, 0x96, 0xca, 0x33, 0x0e, 0xcd, 0x3e, 0xc9, 0x2d, 0x70, 0x06, 0xc3, 0xc7, - 0x4c, 0xa4, 0x21, 0x8f, 0x95, 0x3f, 0x1c, 0x9a, 0x33, 0xc8, 0x2e, 0xc0, 0x60, 0x78, 0x9f, 0x79, - 0xa8, 0x34, 0x6d, 0x55, 0xf6, 0x4b, 0x07, 0x0e, 0x2d, 0x70, 0xdc, 0xdf, 0x42, 0x45, 0xc5, 0x88, - 0x7c, 0x01, 0xd5, 0x20, 0x9c, 0xb0, 0x54, 0x6a, 0x73, 0xda, 0x27, 0xdf, 0xfe, 0xb0, 0xb7, 0xf1, - 0xcf, 0x1f, 0xf6, 0x0e, 0x0b, 0xc9, 0xc0, 0x13, 0x16, 0xfb, 0x3c, 0x96, 0x5e, 0x18, 0x33, 0x91, - 0x1e, 0x4f, 0xf8, 0x3d, 0xbd, 0xe4, 0xa8, 0xab, 0x7e, 0xa8, 0xd1, 0x40, 0x6e, 0x43, 0x25, 0x8c, - 0x03, 0x76, 0xa5, 0xec, 0x2f, 0xb5, 0xdf, 0x31, 0xaa, 0x1a, 0x83, 0xb9, 0x4c, 0xe6, 0xb2, 0x8f, - 0x22, 0xaa, 0x11, 0xee, 0x1f, 0x2d, 0xa8, 0xea, 0x1c, 0x20, 0xb7, 0xa0, 0x1c, 0x31, 0xe9, 0xa9, - 0xfd, 0x1b, 0x27, 0x75, 0xf4, 0xed, 0x03, 0x26, 0x3d, 0xaa, 0xb8, 0x98, 0x5e, 0x11, 0x9f, 0xa3, - 0xef, 0xed, 0x3c, 0xbd, 0x1e, 0x20, 0x87, 0x1a, 0x01, 0xf9, 0x25, 0xd4, 0x62, 0x26, 0x9f, 0x71, - 0x31, 0x55, 0x3e, 0xda, 0xd6, 0x41, 0x3f, 0x67, 0xf2, 0x01, 0x0f, 0x18, 0xcd, 0x64, 0xe4, 0x2e, - 0xd4, 0x53, 0xe6, 0xcf, 0x45, 0x28, 0x17, 0xca, 0x5f, 0xdb, 0x27, 0x4d, 0x95, 0x65, 0x86, 0xa7, - 0xc0, 0x4b, 0x84, 0xfb, 0x17, 0x0b, 0xca, 0x68, 0x06, 0x21, 0x50, 0xf6, 0xc4, 0x44, 0x67, 0xb7, - 0x43, 0x15, 0x4d, 0x9a, 0x50, 0x62, 0xf1, 0x53, 0x65, 0x91, 0x43, 0x91, 0x44, 0x8e, 0xff, 0x2c, - 0x30, 0x31, 0x42, 0x12, 0xd7, 0xcd, 0x53, 0x26, 0x4c, 0x68, 0x14, 0x4d, 0x6e, 0x83, 0x93, 0x08, - 0x7e, 0xb5, 0x78, 0x82, 0xab, 0x2b, 0x85, 0xc4, 0x43, 0x66, 0x2f, 0x7e, 0x4a, 0xeb, 0x89, 0xa1, - 0xc8, 0x21, 0x00, 0xbb, 0x92, 0xc2, 0x3b, 0xe3, 0xa9, 0x4c, 0x5b, 0x55, 0x75, 0x76, 0x95, 0xef, - 0xc8, 0xe8, 0x5f, 0xd0, 0x82, 0xd4, 0xfd, 0x9b, 0x0d, 0x15, 0xe5, 0x12, 0x72, 0x80, 0x11, 0x48, - 0xe6, 0x3a, 0x98, 0xa5, 0x36, 0x31, 0x11, 0x00, 0x15, 0xeb, 0x65, 0x00, 0x30, 0xee, 0x3b, 0xe8, - 0x8d, 0x19, 0xf3, 0x25, 0x17, 0x26, 0xdd, 0x96, 0xdf, 0x68, 0x7a, 0x80, 0x19, 0xa1, 0x4f, 0xa3, - 0x68, 0x72, 0x07, 0xaa, 0x5c, 0x85, 0x51, 0x1d, 0xe8, 0x47, 0x82, 0x6b, 0x20, 0xa8, 0x5c, 0x30, - 0x2f, 0xe0, 0xf1, 0x6c, 0xa1, 0x8e, 0x59, 0xa7, 0xcb, 0x6f, 0x72, 0x07, 0x1c, 0x15, 0xb7, 0x87, - 0x8b, 0x84, 0xb5, 0xaa, 0x2a, 0x0e, 0x5b, 0xcb, 0x98, 0x22, 0x93, 0xe6, 0x72, 0xbc, 0xa8, 0xbe, - 0xe7, 0x5f, 0xb2, 0x41, 0x22, 0x5b, 0x37, 0x73, 0x7f, 0x75, 0x0c, 0x8f, 0x2e, 0xa5, 0xa8, 0x36, - 0x65, 0xbe, 0x60, 0x12, 0xa1, 0xef, 0x2a, 0xe8, 0x96, 0x09, 0xaf, 0x66, 0xd2, 0x5c, 0x4e, 0x5c, - 0xa8, 0x0e, 0x87, 0x67, 0x88, 0x7c, 0x2f, 0x2f, 0x24, 0x9a, 0x43, 0x8d, 0xc4, 0xed, 0x43, 0x3d, - 0xdb, 0x06, 0x6f, 0x65, 0xbf, 0x6b, 0xee, 0xab, 0xdd, 0xef, 0x92, 0x7b, 0x50, 0x4b, 0x2f, 0x3d, - 0x11, 0xc6, 0x13, 0xe5, 0xbb, 0xed, 0x93, 0x77, 0x96, 0x56, 0x0d, 0x35, 0x1f, 0x35, 0x65, 0x18, - 0x97, 0x83, 0xb3, 0x34, 0xe3, 0x15, 0x5d, 0x4d, 0x28, 0xcd, 0xc3, 0x40, 0xe9, 0xd9, 0xa2, 0x48, - 0x22, 0x67, 0x12, 0xea, 0x5c, 0xda, 0xa2, 0x48, 0x62, 0x40, 0x22, 0x1e, 0xe8, 0xb2, 0xb7, 0x45, - 0x15, 0x8d, 0x3e, 0xe6, 0x89, 0x0c, 0x79, 0xec, 0xcd, 0x32, 0x1f, 0x67, 0xdf, 0xee, 0x2c, 0x3b, - 0xdf, 0xff, 0x65, 0xb7, 0xdf, 0x59, 0x50, 0xcf, 0x6a, 0x35, 0x16, 0x9e, 0x30, 0x60, 0xb1, 0x0c, - 0xc7, 0x21, 0x13, 0x66, 0xe3, 0x02, 0x87, 0xdc, 0x83, 0x8a, 0x27, 0xa5, 0xc8, 0xae, 0xf3, 0x4f, - 0x8b, 0x85, 0xfe, 0xe8, 0x14, 0x25, 0xbd, 0x58, 0x8a, 0x05, 0xd5, 0xa8, 0x9d, 0xcf, 0x00, 0x72, - 0x26, 0xda, 0x3a, 0x65, 0x0b, 0xa3, 0x15, 0x49, 0x72, 0x13, 0x2a, 0x4f, 0xbd, 0xd9, 0x9c, 0x99, - 0x1c, 0xd6, 0x1f, 0x9f, 0xdb, 0x9f, 0x59, 0xee, 0x5f, 0x6d, 0xa8, 0x99, 0xc2, 0x4f, 0xee, 0x42, - 0x4d, 0x15, 0x7e, 0x63, 0xd1, 0xf5, 0x17, 0x23, 0x83, 0x90, 0xe3, 0x65, 0x47, 0x2b, 0xd8, 0x68, - 0x54, 0xe9, 0xce, 0x66, 0x6c, 0xcc, 0xfb, 0x5b, 0x29, 0x60, 0x63, 0xd3, 0xba, 0xb6, 0x11, 0xdd, - 0x65, 0xe3, 0x30, 0x0e, 0xd1, 0x3f, 0x14, 0x45, 0xe4, 0x6e, 0x76, 0xea, 0xb2, 0xd2, 0xf8, 0x5e, - 0x51, 0xe3, 0xab, 0x87, 0xee, 0x43, 0xa3, 0xb0, 0xcd, 0x35, 0xa7, 0xfe, 0xb0, 0x78, 0x6a, 0xb3, - 0xa5, 0x52, 0xa7, 0xfb, 0x6e, 0xee, 0x85, 0xff, 0xc2, 0x7f, 0x9f, 0x00, 0xe4, 0x2a, 0xdf, 0xbc, - 0xb0, 0xb8, 0xcf, 0x4b, 0x00, 0x83, 0x04, 0x4b, 0x67, 0xe0, 0xa9, 0xfa, 0xbd, 0x19, 0x4e, 0x62, - 0x2e, 0xd8, 0x13, 0x75, 0x55, 0xd5, 0xfa, 0x3a, 0x6d, 0x68, 0x9e, 0xba, 0x31, 0xe4, 0x14, 0x1a, - 0x01, 0x4b, 0x7d, 0x11, 0xaa, 0x84, 0x32, 0x4e, 0xdf, 0xc3, 0x33, 0xe5, 0x7a, 0x8e, 0xba, 0x39, - 0x42, 0xfb, 0xaa, 0xb8, 0x86, 0x9c, 0xc0, 0x26, 0xbb, 0x4a, 0xb8, 0x90, 0x66, 0x17, 0x3d, 0x1f, - 0xdc, 0xd0, 0x93, 0x06, 0xf2, 0xd5, 0x4e, 0xb4, 0xc1, 0xf2, 0x0f, 0xe2, 0x41, 0xd9, 0xf7, 0x12, - 0xdd, 0x1c, 0x1b, 0x27, 0xad, 0xb5, 0xfd, 0x3a, 0x5e, 0xa2, 0x9d, 0xd6, 0xfe, 0x18, 0xcf, 0xfa, - 0xfc, 0x5f, 0x7b, 0x77, 0x0a, 0x1d, 0x31, 0xe2, 0xa3, 0xc5, 0xb1, 0xca, 0x97, 0x69, 0x28, 0x8f, - 0xe7, 0x32, 0x9c, 0x1d, 0x7b, 0x49, 0x88, 0xea, 0x70, 0x61, 0xbf, 0x4b, 0x95, 0xea, 0x9d, 0x5f, - 0x41, 0x73, 0xdd, 0xee, 0xb7, 0x89, 0xc1, 0xce, 0xa7, 0xe0, 0x2c, 0xed, 0x78, 0xdd, 0xc2, 0x7a, - 0x31, 0x78, 0x1f, 0x40, 0xa3, 0x70, 0x6e, 0x04, 0x3e, 0x56, 0x40, 0xed, 0x7d, 0xfd, 0xe1, 0x3e, - 0xc7, 0xe1, 0x24, 0xeb, 0x37, 0xbf, 0x00, 0xb8, 0x94, 0x32, 0x79, 0xa2, 0x1a, 0x90, 0xd9, 0xc4, - 0x41, 0x8e, 0x42, 0x90, 0x3d, 0x68, 0xe0, 0x47, 0x6a, 0xe4, 0xda, 0x52, 0xb5, 0x22, 0xd5, 0x80, - 0x9f, 0x83, 0x33, 0x5e, 0x2e, 0xd7, 0x8d, 0xa3, 0x3e, 0xce, 0x56, 0xff, 0x0c, 0xea, 0x31, 0x37, - 0x32, 0xdd, 0x0f, 0x6b, 0x31, 0x57, 0x22, 0xf7, 0x0e, 0xfc, 0xe4, 0x95, 0x49, 0x8a, 0xbc, 0x07, - 0xd5, 0x71, 0x38, 0x93, 0xea, 0xba, 0x62, 0x8b, 0x35, 0x5f, 0xee, 0x3f, 0x2c, 0x80, 0xfc, 0x6a, - 0xa1, 0x47, 0xf0, 0xde, 0x21, 0x66, 0x53, 0xdf, 0xb3, 0x19, 0xd4, 0x23, 0x13, 0x41, 0x93, 0x47, - 0xb7, 0x56, 0xaf, 0xe3, 0x51, 0x16, 0x60, 0x1d, 0xdb, 0x13, 0x13, 0xdb, 0xb7, 0x99, 0x76, 0x96, - 0x3b, 0xec, 0x7c, 0x09, 0x5b, 0x2b, 0xea, 0xde, 0xf0, 0xa6, 0xe6, 0x59, 0x56, 0x0c, 0xd9, 0x5d, - 0xa8, 0xea, 0xd6, 0x8e, 0xf5, 0x17, 0x29, 0xa3, 0x46, 0xd1, 0xaa, 0x8e, 0x5f, 0x64, 0x73, 0x61, - 0xff, 0xc2, 0x3d, 0x81, 0xaa, 0x1e, 0x7c, 0xc9, 0x01, 0xd4, 0x3c, 0x1f, 0x8f, 0x96, 0x95, 0xab, - 0xed, 0x6c, 0x2a, 0x3e, 0x55, 0x6c, 0x9a, 0x89, 0xdd, 0xbf, 0xdb, 0x00, 0x39, 0xff, 0x2d, 0x66, - 0x85, 0xcf, 0x61, 0x3b, 0x65, 0x3e, 0x8f, 0x03, 0x4f, 0x2c, 0x94, 0xd4, 0x0c, 0x78, 0xd7, 0x2d, - 0x59, 0x43, 0x16, 0xe6, 0x86, 0xd2, 0xeb, 0xe7, 0x86, 0x03, 0x28, 0xfb, 0x3c, 0x59, 0x98, 0xeb, - 0x4b, 0x56, 0x0f, 0xd2, 0xe1, 0xc9, 0x02, 0xc7, 0x7c, 0x44, 0x90, 0x23, 0xa8, 0x46, 0x53, 0xf5, - 0x14, 0xd0, 0x63, 0xd4, 0xcd, 0x55, 0xec, 0x83, 0x29, 0xd2, 0xf8, 0x70, 0xd0, 0x28, 0x72, 0x07, - 0x2a, 0xd1, 0x34, 0x08, 0x85, 0x9a, 0x38, 0x1a, 0xba, 0x5f, 0x17, 0xe1, 0xdd, 0x50, 0xe0, 0xf3, - 0x40, 0x61, 0x88, 0x0b, 0xb6, 0x88, 0x5a, 0x35, 0x85, 0x6c, 0xae, 0x79, 0x33, 0x3a, 0xdb, 0xa0, - 0xb6, 0x88, 0xda, 0x75, 0xa8, 0x6a, 0xbf, 0xba, 0x7f, 0x2e, 0xc1, 0xf6, 0xaa, 0x95, 0x98, 0x07, - 0xa9, 0xf0, 0xb3, 0x3c, 0x48, 0x85, 0xbf, 0x1c, 0xa9, 0xec, 0xc2, 0x48, 0xe5, 0x42, 0x85, 0x3f, - 0x8b, 0x99, 0x28, 0xbe, 0x79, 0x3a, 0x97, 0xfc, 0x59, 0x8c, 0xc3, 0x83, 0x16, 0xad, 0xf4, 0xe2, - 0x8a, 0xe9, 0xc5, 0x1f, 0xc2, 0xd6, 0x98, 0xcf, 0x66, 0xfc, 0xd9, 0x70, 0x11, 0xcd, 0xc2, 0x78, - 0x6a, 0x1a, 0xf2, 0x2a, 0x93, 0x1c, 0xc0, 0x8d, 0x20, 0x14, 0x68, 0x4e, 0x87, 0xc7, 0x92, 0xc5, - 0x6a, 0x8a, 0x44, 0xdc, 0x3a, 0x9b, 0x7c, 0x01, 0xfb, 0x9e, 0x94, 0x2c, 0x4a, 0xe4, 0xa3, 0x38, - 0xf1, 0xfc, 0x69, 0x97, 0xfb, 0xea, 0x3e, 0x46, 0x89, 0x27, 0xc3, 0x51, 0x38, 0xc3, 0x81, 0xb9, - 0xa6, 0x96, 0xbe, 0x16, 0x47, 0x3e, 0x82, 0x6d, 0x5f, 0x30, 0x4f, 0xb2, 0x2e, 0x4b, 0xe5, 0x85, - 0x27, 0x2f, 0x5b, 0x75, 0xb5, 0x72, 0x8d, 0x8b, 0x67, 0xf0, 0xd0, 0xda, 0xaf, 0xc3, 0x59, 0xe0, - 0x7b, 0x22, 0x68, 0x39, 0xfa, 0x0c, 0x2b, 0x4c, 0x72, 0x04, 0x44, 0x31, 0x7a, 0x51, 0x22, 0x17, - 0x4b, 0x28, 0x28, 0xe8, 0x35, 0x12, 0x7c, 0x13, 0xc9, 0x30, 0x62, 0xa9, 0xf4, 0xa2, 0x44, 0xbd, - 0xd5, 0x4a, 0x34, 0x67, 0xb8, 0xdf, 0x58, 0xd0, 0x5c, 0x4f, 0x11, 0x74, 0x70, 0x82, 0x66, 0x9a, - 0xcb, 0x86, 0xf4, 0xd2, 0xe9, 0x76, 0xc1, 0xe9, 0x18, 0x40, 0xac, 0x2a, 0x18, 0xab, 0x4d, 0xaa, - 0xe8, 0x3c, 0x80, 0xe5, 0x1f, 0x0f, 0xe0, 0x8a, 0x49, 0x95, 0x75, 0x93, 0xfe, 0x60, 0xc1, 0x8d, - 0xb5, 0x34, 0x7c, 0x63, 0x8b, 0xf6, 0xa1, 0x11, 0x79, 0x53, 0x76, 0xe1, 0x09, 0x15, 0xdc, 0x92, - 0x6e, 0xac, 0x05, 0xd6, 0xff, 0xc0, 0xbe, 0x18, 0x36, 0x8b, 0xb9, 0x7f, 0xad, 0x6d, 0x59, 0x28, - 0xcf, 0xb9, 0xbc, 0xcf, 0xe7, 0x71, 0x60, 0xba, 0xd1, 0x2a, 0xf3, 0xd5, 0x80, 0x97, 0xae, 0x09, - 0xb8, 0x7b, 0x0e, 0xf5, 0xcc, 0x40, 0xb2, 0x67, 0x1e, 0x50, 0x56, 0xfe, 0x90, 0x7f, 0x94, 0x32, - 0x81, 0xb6, 0xeb, 0xd7, 0xd4, 0xfb, 0x50, 0x99, 0x08, 0x3e, 0x4f, 0x4c, 0x6d, 0x5d, 0x41, 0x68, - 0x89, 0x3b, 0x84, 0x9a, 0xe1, 0x90, 0x43, 0xa8, 0x8e, 0x16, 0xe7, 0x5e, 0xc4, 0x8c, 0x42, 0x75, - 0xb1, 0xf1, 0x3b, 0x30, 0x08, 0xac, 0x16, 0x1a, 0x41, 0x6e, 0x42, 0x79, 0xb4, 0xe8, 0x77, 0xf5, - 0x98, 0x8c, 0x35, 0x07, 0xbf, 0xda, 0x55, 0x6d, 0x90, 0xfb, 0x15, 0x6c, 0x16, 0xd7, 0xa1, 0x53, - 0xe2, 0x4c, 0xaf, 0x43, 0x15, 0x9d, 0x17, 0x57, 0xfb, 0x35, 0xc5, 0xf5, 0xf0, 0x00, 0x6a, 0xe6, - 0xa9, 0x4a, 0x1c, 0xa8, 0x3c, 0x3a, 0x1f, 0xf6, 0x1e, 0x36, 0x37, 0x48, 0x1d, 0xca, 0x67, 0x83, - 0xe1, 0xc3, 0xa6, 0x85, 0xd4, 0xf9, 0xe0, 0xbc, 0xd7, 0xb4, 0x0f, 0x6f, 0xc3, 0x66, 0xf1, 0xb1, - 0x4a, 0x1a, 0x50, 0x1b, 0x9e, 0x9e, 0x77, 0xdb, 0x83, 0xdf, 0x34, 0x37, 0xc8, 0x26, 0xd4, 0xfb, - 0xe7, 0xc3, 0x5e, 0xe7, 0x11, 0xed, 0x35, 0xad, 0xc3, 0x5f, 0x83, 0xb3, 0x7c, 0x4f, 0xa1, 0x86, - 0x76, 0xff, 0xbc, 0xdb, 0xdc, 0x20, 0x00, 0xd5, 0x61, 0xaf, 0x43, 0x7b, 0xa8, 0xb7, 0x06, 0xa5, - 0xe1, 0xf0, 0xac, 0x69, 0xe3, 0xae, 0x9d, 0xd3, 0xce, 0x59, 0xaf, 0x59, 0x42, 0xf2, 0xe1, 0x83, - 0x8b, 0xfb, 0xc3, 0x66, 0xf9, 0xf0, 0x13, 0xb8, 0xb1, 0xf6, 0x9e, 0x51, 0xab, 0xcf, 0x4e, 0x69, - 0x0f, 0x35, 0x35, 0xa0, 0x76, 0x41, 0xfb, 0x8f, 0x4f, 0x1f, 0xf6, 0x9a, 0x16, 0x0a, 0xbe, 0x1a, - 0x74, 0xbe, 0xec, 0x75, 0x9b, 0x76, 0xfb, 0xd6, 0xb7, 0x2f, 0x76, 0xad, 0xef, 0x5e, 0xec, 0x5a, - 0xdf, 0xbf, 0xd8, 0xb5, 0xfe, 0xfd, 0x62, 0xd7, 0xfa, 0xe6, 0xe5, 0xee, 0xc6, 0x77, 0x2f, 0x77, - 0x37, 0xbe, 0x7f, 0xb9, 0xbb, 0x31, 0xaa, 0xaa, 0xbf, 0x8e, 0x3e, 0xfe, 0x4f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x87, 0x95, 0x80, 0x20, 0x7a, 0x12, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go b/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go index 5b99b4ee1b..3977e4d6f0 100644 --- a/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go +++ b/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go @@ -3,12 +3,14 @@ package moby_buildkit_v1_apicaps -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" - -import io "io" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -19,7 +21,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // APICap defines a capability supported by the service type APICap struct { @@ -38,7 +40,7 @@ func (m *APICap) Reset() { *m = APICap{} } func (m *APICap) String() string { return proto.CompactTextString(m) } func (*APICap) ProtoMessage() {} func (*APICap) Descriptor() ([]byte, []int) { - return fileDescriptor_caps_04e1bcd232e9a565, []int{0} + return fileDescriptor_e19c39d9fcb89b83, []int{0} } func (m *APICap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -48,15 +50,15 @@ func (m *APICap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_APICap.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } -func (dst *APICap) XXX_Merge(src proto.Message) { - xxx_messageInfo_APICap.Merge(dst, src) +func (m *APICap) XXX_Merge(src proto.Message) { + xxx_messageInfo_APICap.Merge(m, src) } func (m *APICap) XXX_Size() int { return m.Size() @@ -112,10 +114,32 @@ func (m *APICap) GetDisabledAlternative() string { func init() { proto.RegisterType((*APICap)(nil), "moby.buildkit.v1.apicaps.APICap") } + +func init() { proto.RegisterFile("caps.proto", fileDescriptor_e19c39d9fcb89b83) } + +var fileDescriptor_e19c39d9fcb89b83 = []byte{ + // 236 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x4e, 0x2c, 0x28, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, 0x4b, 0x2a, 0xcd, + 0xcc, 0x49, 0xc9, 0xce, 0x2c, 0xd1, 0x2b, 0x33, 0xd4, 0x4b, 0x2c, 0xc8, 0x04, 0xc9, 0x4b, 0xe9, + 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb, + 0x83, 0x35, 0x24, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x31, 0x48, 0xe9, 0x16, 0x23, + 0x17, 0x9b, 0x63, 0x80, 0xa7, 0x73, 0x62, 0x81, 0x10, 0x1f, 0x17, 0x93, 0xa7, 0x8b, 0x04, 0xa3, + 0x02, 0xa3, 0x06, 0x67, 0x10, 0x93, 0xa7, 0x8b, 0x90, 0x04, 0x17, 0xbb, 0x6b, 0x5e, 0x62, 0x52, + 0x4e, 0x6a, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x8c, 0x2b, 0x24, 0xc7, 0xc5, 0xe5, + 0x92, 0x5a, 0x50, 0x94, 0x9a, 0x9c, 0x58, 0x92, 0x9a, 0x22, 0xc1, 0x0c, 0x96, 0x44, 0x12, 0x11, + 0x52, 0xe3, 0xe2, 0x73, 0xc9, 0x2c, 0x06, 0xab, 0x0d, 0x4a, 0x4d, 0x2c, 0xce, 0xcf, 0x93, 0x60, + 0x01, 0x9b, 0x8a, 0x26, 0x2a, 0xa4, 0xc3, 0x25, 0x88, 0x2a, 0xe2, 0x5b, 0x9c, 0x2e, 0xc1, 0x0a, + 0x56, 0x8a, 0x29, 0x21, 0x64, 0xc0, 0x25, 0x0c, 0x13, 0x74, 0xcc, 0x29, 0x49, 0x2d, 0xca, 0x4b, + 0x2c, 0xc9, 0x2c, 0x4b, 0x95, 0x60, 0x03, 0xab, 0xc7, 0x26, 0xe5, 0xc4, 0x73, 0xe2, 0x91, 0x1c, + 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x26, 0xb1, 0x81, 0x7d, 0x6c, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0x02, 0x2d, 0x9e, 0x91, 0x48, 0x01, 0x00, 0x00, +} + func (m *APICap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -123,68 +147,80 @@ func (m *APICap) Marshal() (dAtA []byte, err error) { } func (m *APICap) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *APICap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCaps(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Enabled { - dAtA[i] = 0x10 - i++ - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.DisabledAlternative) > 0 { + i -= len(m.DisabledAlternative) + copy(dAtA[i:], m.DisabledAlternative) + i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledAlternative))) + i-- + dAtA[i] = 0x32 + } + if len(m.DisabledReasonMsg) > 0 { + i -= len(m.DisabledReasonMsg) + copy(dAtA[i:], m.DisabledReasonMsg) + i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledReasonMsg))) + i-- + dAtA[i] = 0x2a + } + if len(m.DisabledReason) > 0 { + i -= len(m.DisabledReason) + copy(dAtA[i:], m.DisabledReason) + i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledReason))) + i-- + dAtA[i] = 0x22 } if m.Deprecated { - dAtA[i] = 0x18 - i++ + i-- if m.Deprecated { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if len(m.DisabledReason) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledReason))) - i += copy(dAtA[i:], m.DisabledReason) + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 } - if len(m.DisabledReasonMsg) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledReasonMsg))) - i += copy(dAtA[i:], m.DisabledReasonMsg) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintCaps(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - if len(m.DisabledAlternative) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintCaps(dAtA, i, uint64(len(m.DisabledAlternative))) - i += copy(dAtA[i:], m.DisabledAlternative) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintCaps(dAtA []byte, offset int, v uint64) int { + offset -= sovCaps(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *APICap) Size() (n int) { if m == nil { @@ -221,14 +257,7 @@ func (m *APICap) Size() (n int) { } func sovCaps(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCaps(x uint64) (n int) { return sovCaps(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -248,7 +277,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -276,7 +305,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -286,6 +315,9 @@ func (m *APICap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthCaps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCaps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -305,7 +337,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -325,7 +357,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -345,7 +377,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -355,6 +387,9 @@ func (m *APICap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthCaps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCaps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -374,7 +409,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -384,6 +419,9 @@ func (m *APICap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthCaps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCaps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -403,7 +441,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -413,6 +451,9 @@ func (m *APICap) Unmarshal(dAtA []byte) error { return ErrInvalidLengthCaps } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCaps + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -427,6 +468,9 @@ func (m *APICap) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthCaps } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCaps + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -443,6 +487,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { func skipCaps(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -474,10 +519,8 @@ func skipCaps(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -494,74 +537,34 @@ func skipCaps(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthCaps } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCaps - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCaps(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCaps + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthCaps + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthCaps = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCaps = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthCaps = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCaps = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCaps = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("caps.proto", fileDescriptor_caps_04e1bcd232e9a565) } - -var fileDescriptor_caps_04e1bcd232e9a565 = []byte{ - // 236 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x4e, 0x2c, 0x28, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xc8, 0xcd, 0x4f, 0xaa, 0xd4, 0x4b, 0x2a, 0xcd, - 0xcc, 0x49, 0xc9, 0xce, 0x2c, 0xd1, 0x2b, 0x33, 0xd4, 0x4b, 0x2c, 0xc8, 0x04, 0xc9, 0x4b, 0xe9, - 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb, - 0x83, 0x35, 0x24, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x31, 0x48, 0xe9, 0x16, 0x23, - 0x17, 0x9b, 0x63, 0x80, 0xa7, 0x73, 0x62, 0x81, 0x10, 0x1f, 0x17, 0x93, 0xa7, 0x8b, 0x04, 0xa3, - 0x02, 0xa3, 0x06, 0x67, 0x10, 0x93, 0xa7, 0x8b, 0x90, 0x04, 0x17, 0xbb, 0x6b, 0x5e, 0x62, 0x52, - 0x4e, 0x6a, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x8c, 0x2b, 0x24, 0xc7, 0xc5, 0xe5, - 0x92, 0x5a, 0x50, 0x94, 0x9a, 0x9c, 0x58, 0x92, 0x9a, 0x22, 0xc1, 0x0c, 0x96, 0x44, 0x12, 0x11, - 0x52, 0xe3, 0xe2, 0x73, 0xc9, 0x2c, 0x06, 0xab, 0x0d, 0x4a, 0x4d, 0x2c, 0xce, 0xcf, 0x93, 0x60, - 0x01, 0x9b, 0x8a, 0x26, 0x2a, 0xa4, 0xc3, 0x25, 0x88, 0x2a, 0xe2, 0x5b, 0x9c, 0x2e, 0xc1, 0x0a, - 0x56, 0x8a, 0x29, 0x21, 0x64, 0xc0, 0x25, 0x0c, 0x13, 0x74, 0xcc, 0x29, 0x49, 0x2d, 0xca, 0x4b, - 0x2c, 0xc9, 0x2c, 0x4b, 0x95, 0x60, 0x03, 0xab, 0xc7, 0x26, 0xe5, 0xc4, 0x73, 0xe2, 0x91, 0x1c, - 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x26, 0xb1, 0x81, 0x7d, 0x6c, 0x0c, 0x08, - 0x00, 0x00, 0xff, 0xff, 0x02, 0x2d, 0x9e, 0x91, 0x48, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go b/vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go index 74f8389da6..d5d0ca1fb9 100644 --- a/vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go +++ b/vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_windows.go @@ -1,9 +1,17 @@ package appdefaults +import ( + "os" + "path/filepath" +) + const ( - Address = "npipe:////./pipe/buildkitd" - Root = ".buildstate" - ConfigDir = "" + Address = "npipe:////./pipe/buildkitd" +) + +var ( + Root = filepath.Join(os.Getenv("ProgramData"), "buildkitd", ".buildstate") + ConfigDir = filepath.Join(os.Getenv("ProgramData"), "buildkitd") ) func UserAddress() string { diff --git a/vendor/github.com/moby/buildkit/util/entitlements/security_linux.go b/vendor/github.com/moby/buildkit/util/entitlements/security_linux.go deleted file mode 100644 index c4cfc6c6de..0000000000 --- a/vendor/github.com/moby/buildkit/util/entitlements/security_linux.go +++ /dev/null @@ -1,67 +0,0 @@ -package entitlements - -import ( - "context" - - "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/oci" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -// WithInsecureSpec sets spec with All capability. -func WithInsecureSpec() oci.SpecOpts { - return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error { - addCaps := []string{ - "CAP_FSETID", - "CAP_KILL", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETPCAP", - "CAP_SETFCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_AUDIT_WRITE", - "CAP_MAC_ADMIN", - "CAP_MAC_OVERRIDE", - "CAP_DAC_READ_SEARCH", - "CAP_SYS_PTRACE", - "CAP_SYS_MODULE", - "CAP_SYSLOG", - "CAP_SYS_RAWIO", - "CAP_SYS_ADMIN", - "CAP_LINUX_IMMUTABLE", - "CAP_SYS_BOOT", - "CAP_SYS_NICE", - "CAP_SYS_PACCT", - "CAP_SYS_TTY_CONFIG", - "CAP_SYS_TIME", - "CAP_WAKE_ALARM", - "CAP_AUDIT_READ", - "CAP_AUDIT_CONTROL", - "CAP_SYS_RESOURCE", - "CAP_BLOCK_SUSPEND", - "CAP_IPC_LOCK", - "CAP_IPC_OWNER", - "CAP_LEASE", - "CAP_NET_ADMIN", - "CAP_NET_BROADCAST", - } - for _, cap := range addCaps { - s.Process.Capabilities.Bounding = append(s.Process.Capabilities.Bounding, cap) - s.Process.Capabilities.Ambient = append(s.Process.Capabilities.Ambient, cap) - s.Process.Capabilities.Effective = append(s.Process.Capabilities.Effective, cap) - s.Process.Capabilities.Inheritable = append(s.Process.Capabilities.Inheritable, cap) - s.Process.Capabilities.Permitted = append(s.Process.Capabilities.Permitted, cap) - } - s.Linux.ReadonlyPaths = []string{} - s.Linux.MaskedPaths = []string{} - s.Process.ApparmorProfile = "" - - return nil - } -} diff --git a/vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go b/vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go new file mode 100644 index 0000000000..f06d4e8954 --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go @@ -0,0 +1,341 @@ +package flightcontrol + +import ( + "context" + "io" + "runtime" + "sort" + "sync" + "time" + + "github.com/moby/buildkit/util/progress" + "github.com/pkg/errors" +) + +// flightcontrol is like singleflight but with support for cancellation and +// nested progress reporting + +var ( + errRetry = errors.Errorf("retry") + errRetryTimeout = errors.Errorf("exceeded retry timeout") +) + +type contextKeyT string + +var contextKey = contextKeyT("buildkit/util/flightcontrol.progress") + +// Group is a flightcontrol synchronization group +type Group struct { + mu sync.Mutex // protects m + m map[string]*call // lazily initialized +} + +// Do executes a context function syncronized by the key +func (g *Group) Do(ctx context.Context, key string, fn func(ctx context.Context) (interface{}, error)) (v interface{}, err error) { + var backoff time.Duration + for { + v, err = g.do(ctx, key, fn) + if err == nil || errors.Cause(err) != errRetry { + return v, err + } + // backoff logic + if backoff >= 3*time.Second { + err = errors.Wrapf(errRetryTimeout, "flightcontrol") + return v, err + } + runtime.Gosched() + if backoff > 0 { + time.Sleep(backoff) + backoff *= 2 + } else { + backoff = time.Millisecond + } + } +} + +func (g *Group) do(ctx context.Context, key string, fn func(ctx context.Context) (interface{}, error)) (interface{}, error) { + g.mu.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + + if c, ok := g.m[key]; ok { // register 2nd waiter + g.mu.Unlock() + return c.wait(ctx) + } + + c := newCall(fn) + g.m[key] = c + go func() { + // cleanup after a caller has returned + <-c.ready + g.mu.Lock() + delete(g.m, key) + g.mu.Unlock() + close(c.cleaned) + }() + g.mu.Unlock() + return c.wait(ctx) +} + +type call struct { + mu sync.Mutex + result interface{} + err error + ready chan struct{} + cleaned chan struct{} + + ctx *sharedContext + ctxs []context.Context + fn func(ctx context.Context) (interface{}, error) + once sync.Once + + closeProgressWriter func() + progressState *progressState + progressCtx context.Context +} + +func newCall(fn func(ctx context.Context) (interface{}, error)) *call { + c := &call{ + fn: fn, + ready: make(chan struct{}), + cleaned: make(chan struct{}), + progressState: newProgressState(), + } + ctx := newContext(c) // newSharedContext + pr, pctx, closeProgressWriter := progress.NewContext(context.Background()) + + c.progressCtx = pctx + c.ctx = ctx + c.closeProgressWriter = closeProgressWriter + + go c.progressState.run(pr) // TODO: remove this, wrap writer instead + + return c +} + +func (c *call) run() { + defer c.closeProgressWriter() + ctx, cancel := context.WithCancel(c.ctx) + defer cancel() + v, err := c.fn(ctx) + c.mu.Lock() + c.result = v + c.err = err + c.mu.Unlock() + close(c.ready) +} + +func (c *call) wait(ctx context.Context) (v interface{}, err error) { + c.mu.Lock() + // detect case where caller has just returned, let it clean up before + select { + case <-c.ready: // could return if no error + c.mu.Unlock() + <-c.cleaned + return nil, errRetry + default: + } + + pw, ok, ctx := progress.FromContext(ctx) + if ok { + c.progressState.add(pw) + } + c.ctxs = append(c.ctxs, ctx) + + c.mu.Unlock() + + go c.once.Do(c.run) + + select { + case <-ctx.Done(): + select { + case <-c.ctx.Done(): + // if this cancelled the last context, then wait for function to shut down + // and don't accept any more callers + <-c.ready + return c.result, c.err + default: + if ok { + c.progressState.close(pw) + } + return nil, ctx.Err() + } + case <-c.ready: + return c.result, c.err // shared not implemented yet + } +} + +func (c *call) Deadline() (deadline time.Time, ok bool) { + c.mu.Lock() + defer c.mu.Unlock() + for _, ctx := range c.ctxs { + select { + case <-ctx.Done(): + default: + dl, ok := ctx.Deadline() + if ok { + return dl, ok + } + } + } + return time.Time{}, false +} + +func (c *call) Done() <-chan struct{} { + c.mu.Lock() + c.ctx.signal() + c.mu.Unlock() + return c.ctx.done +} + +func (c *call) Err() error { + select { + case <-c.ctx.Done(): + return c.ctx.err + default: + return nil + } +} + +func (c *call) Value(key interface{}) interface{} { + if key == contextKey { + return c.progressState + } + c.mu.Lock() + defer c.mu.Unlock() + + ctx := c.progressCtx + select { + case <-ctx.Done(): + default: + if v := ctx.Value(key); v != nil { + return v + } + } + + if len(c.ctxs) > 0 { + ctx = c.ctxs[0] + select { + case <-ctx.Done(): + default: + if v := ctx.Value(key); v != nil { + return v + } + } + } + + return nil +} + +type sharedContext struct { + *call + done chan struct{} + err error +} + +func newContext(c *call) *sharedContext { + return &sharedContext{call: c, done: make(chan struct{})} +} + +// call with lock +func (c *sharedContext) signal() { + select { + case <-c.done: + default: + var err error + for _, ctx := range c.ctxs { + select { + case <-ctx.Done(): + err = ctx.Err() + default: + return + } + } + c.err = err + close(c.done) + } +} + +type rawProgressWriter interface { + WriteRawProgress(*progress.Progress) error + Close() error +} + +type progressState struct { + mu sync.Mutex + items map[string]*progress.Progress + writers []rawProgressWriter + done bool +} + +func newProgressState() *progressState { + return &progressState{ + items: make(map[string]*progress.Progress), + } +} + +func (ps *progressState) run(pr progress.Reader) { + for { + p, err := pr.Read(context.TODO()) + if err != nil { + if err == io.EOF { + ps.mu.Lock() + ps.done = true + ps.mu.Unlock() + for _, w := range ps.writers { + w.Close() + } + } + return + } + ps.mu.Lock() + for _, p := range p { + for _, w := range ps.writers { + w.WriteRawProgress(p) + } + ps.items[p.ID] = p + } + ps.mu.Unlock() + } +} + +func (ps *progressState) add(pw progress.Writer) { + rw, ok := pw.(rawProgressWriter) + if !ok { + return + } + ps.mu.Lock() + plist := make([]*progress.Progress, 0, len(ps.items)) + for _, p := range ps.items { + plist = append(plist, p) + } + sort.Slice(plist, func(i, j int) bool { + return plist[i].Timestamp.Before(plist[j].Timestamp) + }) + for _, p := range plist { + rw.WriteRawProgress(p) + } + if ps.done { + rw.Close() + } else { + ps.writers = append(ps.writers, rw) + } + ps.mu.Unlock() +} + +func (ps *progressState) close(pw progress.Writer) { + rw, ok := pw.(rawProgressWriter) + if !ok { + return + } + ps.mu.Lock() + for i, w := range ps.writers { + if w == rw { + w.Close() + ps.writers = append(ps.writers[:i], ps.writers[i+1:]...) + break + } + } + ps.mu.Unlock() +} diff --git a/vendor/github.com/moby/buildkit/util/progress/multireader.go b/vendor/github.com/moby/buildkit/util/progress/multireader.go new file mode 100644 index 0000000000..2bd3f2ca86 --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/progress/multireader.go @@ -0,0 +1,77 @@ +package progress + +import ( + "context" + "io" + "sync" +) + +type MultiReader struct { + mu sync.Mutex + main Reader + initialized bool + done chan struct{} + writers map[*progressWriter]func() +} + +func NewMultiReader(pr Reader) *MultiReader { + mr := &MultiReader{ + main: pr, + writers: make(map[*progressWriter]func()), + done: make(chan struct{}), + } + return mr +} + +func (mr *MultiReader) Reader(ctx context.Context) Reader { + mr.mu.Lock() + defer mr.mu.Unlock() + + pr, ctx, closeWriter := NewContext(ctx) + pw, _, ctx := FromContext(ctx) + + w := pw.(*progressWriter) + mr.writers[w] = closeWriter + + go func() { + select { + case <-ctx.Done(): + case <-mr.done: + } + mr.mu.Lock() + defer mr.mu.Unlock() + delete(mr.writers, w) + }() + + if !mr.initialized { + go mr.handle() + mr.initialized = true + } + + return pr +} + +func (mr *MultiReader) handle() error { + for { + p, err := mr.main.Read(context.TODO()) + if err != nil { + if err == io.EOF { + mr.mu.Lock() + for w, c := range mr.writers { + w.Close() + c() + } + mr.mu.Unlock() + return nil + } + return err + } + mr.mu.Lock() + for _, p := range p { + for w := range mr.writers { + w.writeRawProgress(p) + } + } + mr.mu.Unlock() + } +} diff --git a/vendor/github.com/moby/buildkit/util/progress/multiwriter.go b/vendor/github.com/moby/buildkit/util/progress/multiwriter.go new file mode 100644 index 0000000000..51989368ce --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/progress/multiwriter.go @@ -0,0 +1,105 @@ +package progress + +import ( + "sort" + "sync" + "time" +) + +type rawProgressWriter interface { + WriteRawProgress(*Progress) error + Close() error +} + +type MultiWriter struct { + mu sync.Mutex + items []*Progress + writers map[rawProgressWriter]struct{} + done bool + meta map[string]interface{} +} + +func NewMultiWriter(opts ...WriterOption) *MultiWriter { + mw := &MultiWriter{ + writers: map[rawProgressWriter]struct{}{}, + meta: map[string]interface{}{}, + } + for _, o := range opts { + o(mw) + } + return mw +} + +func (ps *MultiWriter) Add(pw Writer) { + rw, ok := pw.(rawProgressWriter) + if !ok { + return + } + ps.mu.Lock() + plist := make([]*Progress, 0, len(ps.items)) + for _, p := range ps.items { + plist = append(plist, p) + } + sort.Slice(plist, func(i, j int) bool { + return plist[i].Timestamp.Before(plist[j].Timestamp) + }) + for _, p := range plist { + rw.WriteRawProgress(p) + } + ps.writers[rw] = struct{}{} + ps.mu.Unlock() +} + +func (ps *MultiWriter) Delete(pw Writer) { + rw, ok := pw.(rawProgressWriter) + if !ok { + return + } + + ps.mu.Lock() + delete(ps.writers, rw) + ps.mu.Unlock() +} + +func (ps *MultiWriter) Write(id string, v interface{}) error { + p := &Progress{ + ID: id, + Timestamp: time.Now(), + Sys: v, + meta: ps.meta, + } + return ps.WriteRawProgress(p) +} + +func (ps *MultiWriter) WriteRawProgress(p *Progress) error { + meta := p.meta + if len(ps.meta) > 0 { + meta = map[string]interface{}{} + for k, v := range p.meta { + meta[k] = v + } + for k, v := range ps.meta { + if _, ok := meta[k]; !ok { + meta[k] = v + } + } + } + p.meta = meta + return ps.writeRawProgress(p) +} + +func (ps *MultiWriter) writeRawProgress(p *Progress) error { + ps.mu.Lock() + defer ps.mu.Unlock() + ps.items = append(ps.items, p) + for w := range ps.writers { + if err := w.WriteRawProgress(p); err != nil { + return err + } + } + return nil +} + +func (ps *MultiWriter) Close() error { + return nil +} diff --git a/vendor/github.com/moby/buildkit/util/progress/progress.go b/vendor/github.com/moby/buildkit/util/progress/progress.go new file mode 100644 index 0000000000..ffe3d88b55 --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/progress/progress.go @@ -0,0 +1,256 @@ +package progress + +import ( + "context" + "io" + "sort" + "sync" + "time" + + "github.com/pkg/errors" +) + +// Progress package provides utility functions for using the context to capture +// progress of a running function. All progress items written contain an ID +// that is used to collapse unread messages. + +type contextKeyT string + +var contextKey = contextKeyT("buildkit/util/progress") + +// FromContext returns a progress writer from a context. +func FromContext(ctx context.Context, opts ...WriterOption) (Writer, bool, context.Context) { + v := ctx.Value(contextKey) + pw, ok := v.(*progressWriter) + if !ok { + if pw, ok := v.(*MultiWriter); ok { + return pw, true, ctx + } + return &noOpWriter{}, false, ctx + } + pw = newWriter(pw) + for _, o := range opts { + o(pw) + } + ctx = context.WithValue(ctx, contextKey, pw) + return pw, true, ctx +} + +type WriterOption func(Writer) + +// NewContext returns a new context and a progress reader that captures all +// progress items writtern to this context. Last returned parameter is a closer +// function to signal that no new writes will happen to this context. +func NewContext(ctx context.Context) (Reader, context.Context, func()) { + pr, pw, cancel := pipe() + ctx = WithProgress(ctx, pw) + return pr, ctx, cancel +} + +func WithProgress(ctx context.Context, pw Writer) context.Context { + return context.WithValue(ctx, contextKey, pw) +} + +func WithMetadata(key string, val interface{}) WriterOption { + return func(w Writer) { + if pw, ok := w.(*progressWriter); ok { + pw.meta[key] = val + } + if pw, ok := w.(*MultiWriter); ok { + pw.meta[key] = val + } + } +} + +type Writer interface { + Write(id string, value interface{}) error + Close() error +} + +type Reader interface { + Read(context.Context) ([]*Progress, error) +} + +type Progress struct { + ID string + Timestamp time.Time + Sys interface{} + meta map[string]interface{} +} + +type Status struct { + Action string + Current int + Total int + Started *time.Time + Completed *time.Time +} + +type progressReader struct { + ctx context.Context + cond *sync.Cond + mu sync.Mutex + writers map[*progressWriter]struct{} + dirty map[string]*Progress +} + +func (pr *progressReader) Read(ctx context.Context) ([]*Progress, error) { + done := make(chan struct{}) + defer close(done) + go func() { + select { + case <-done: + case <-ctx.Done(): + pr.mu.Lock() + pr.cond.Broadcast() + pr.mu.Unlock() + } + }() + pr.mu.Lock() + for { + select { + case <-ctx.Done(): + pr.mu.Unlock() + return nil, ctx.Err() + default: + } + dmap := pr.dirty + if len(dmap) == 0 { + select { + case <-pr.ctx.Done(): + if len(pr.writers) == 0 { + pr.mu.Unlock() + return nil, io.EOF + } + default: + } + pr.cond.Wait() + continue + } + pr.dirty = make(map[string]*Progress) + pr.mu.Unlock() + + out := make([]*Progress, 0, len(dmap)) + for _, p := range dmap { + out = append(out, p) + } + + sort.Slice(out, func(i, j int) bool { + return out[i].Timestamp.Before(out[j].Timestamp) + }) + + return out, nil + } +} + +func (pr *progressReader) append(pw *progressWriter) { + pr.mu.Lock() + defer pr.mu.Unlock() + + select { + case <-pr.ctx.Done(): + return + default: + pr.writers[pw] = struct{}{} + } +} + +func pipe() (*progressReader, *progressWriter, func()) { + ctx, cancel := context.WithCancel(context.Background()) + pr := &progressReader{ + ctx: ctx, + writers: make(map[*progressWriter]struct{}), + dirty: make(map[string]*Progress), + } + pr.cond = sync.NewCond(&pr.mu) + go func() { + <-ctx.Done() + pr.mu.Lock() + pr.cond.Broadcast() + pr.mu.Unlock() + }() + pw := &progressWriter{ + reader: pr, + } + return pr, pw, cancel +} + +func newWriter(pw *progressWriter) *progressWriter { + meta := make(map[string]interface{}) + for k, v := range pw.meta { + meta[k] = v + } + pw = &progressWriter{ + reader: pw.reader, + meta: meta, + } + pw.reader.append(pw) + return pw +} + +type progressWriter struct { + done bool + reader *progressReader + meta map[string]interface{} +} + +func (pw *progressWriter) Write(id string, v interface{}) error { + if pw.done { + return errors.Errorf("writing %s to closed progress writer", id) + } + return pw.writeRawProgress(&Progress{ + ID: id, + Timestamp: time.Now(), + Sys: v, + meta: pw.meta, + }) +} + +func (pw *progressWriter) WriteRawProgress(p *Progress) error { + meta := p.meta + if len(pw.meta) > 0 { + meta = map[string]interface{}{} + for k, v := range p.meta { + meta[k] = v + } + for k, v := range pw.meta { + if _, ok := meta[k]; !ok { + meta[k] = v + } + } + } + p.meta = meta + return pw.writeRawProgress(p) +} + +func (pw *progressWriter) writeRawProgress(p *Progress) error { + pw.reader.mu.Lock() + pw.reader.dirty[p.ID] = p + pw.reader.cond.Broadcast() + pw.reader.mu.Unlock() + return nil +} + +func (pw *progressWriter) Close() error { + pw.reader.mu.Lock() + delete(pw.reader.writers, pw) + pw.reader.mu.Unlock() + pw.reader.cond.Broadcast() + pw.done = true + return nil +} + +func (p *Progress) Meta(key string) (interface{}, bool) { + v, ok := p.meta[key] + return v, ok +} + +type noOpWriter struct{} + +func (pw *noOpWriter) Write(_ string, _ interface{}) error { + return nil +} + +func (pw *noOpWriter) Close() error { + return nil +} diff --git a/vendor/github.com/opencontainers/runtime-spec/LICENSE b/vendor/github.com/opencontainers/runtime-spec/LICENSE deleted file mode 100644 index bdc403653e..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 The Linux Foundation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/opencontainers/runtime-spec/README.md b/vendor/github.com/opencontainers/runtime-spec/README.md deleted file mode 100644 index b40dba17d8..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Open Container Initiative Runtime Specification - -The [Open Container Initiative][oci] develops specifications for standards on Operating System process and application containers. - -The specification can be found [here](spec.md). - -## Table of Contents - -Additional documentation about how this group operates: - -- [Code of Conduct][code-of-conduct] -- [Style and Conventions](style.md) -- [Implementations](implementations.md) -- [Releases](RELEASES.md) -- [project](project.md) -- [charter][charter] - -## Use Cases - -To provide context for users the following section gives example use cases for each part of the spec. - -### Application Bundle Builders - -Application bundle builders can create a [bundle](bundle.md) directory that includes all of the files required for launching an application as a container. -The bundle contains an OCI [configuration file](config.md) where the builder can specify host-independent details such as [which executable to launch](config.md#process) and host-specific settings such as [mount](config.md#mounts) locations, [hook](config.md#posix-platform-hooks) paths, Linux [namespaces](config-linux.md#namespaces) and [cgroups](config-linux.md#control-groups). -Because the configuration includes host-specific settings, application bundle directories copied between two hosts may require configuration adjustments. - -### Hook Developers - -[Hook](config.md#posix-platform-hooks) developers can extend the functionality of an OCI-compliant runtime by hooking into a container's lifecycle with an external application. -Example use cases include sophisticated network configuration, volume garbage collection, etc. - -### Runtime Developers - -Runtime developers can build runtime implementations that run OCI-compliant bundles and container configuration, containing low-level OS and host-specific details, on a particular platform. - -## Contributing - -Development happens on GitHub for the spec. -Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list). - -The specification and code is licensed under the Apache 2.0 license found in the [LICENSE](./LICENSE) file. - -### Discuss your design - -The project welcomes submissions, but please let everyone know what you are working on. - -Before undertaking a nontrivial change to this specification, send mail to the [mailing list](#mailing-list) to discuss what you plan to do. -This gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits. -It also guarantees that the design is sound before code is written; a GitHub pull-request is not the place for high-level discussions. - -Typos and grammatical errors can go straight to a pull-request. -When in doubt, start on the [mailing-list](#mailing-list). - -### Meetings - -The contributors and maintainers of all OCI projects have monthly meetings, which are usually at 2:00 PM (USA Pacific) on the first Wednesday of every month. -There is an [iCalendar][rfc5545] format for the meetings [here](meeting.ics). -Everyone is welcome to participate via [UberConference web][uberconference] or audio-only: +1 415 968 0849 (no PIN needed). -An initial agenda will be posted to the [mailing list](#mailing-list) in the week before each meeting, and everyone is welcome to propose additional topics or suggest other agenda alterations there. -Minutes are posted to the [mailing list](#mailing-list) and minutes from past calls are archived [here][minutes], with minutes from especially old meetings (September 2015 and earlier) archived [here][runtime-wiki]. - -### Mailing List - -You can subscribe and join the mailing list on [Google Groups][dev-list]. - -### IRC - -OCI discussion happens on #opencontainers on Freenode ([logs][irc-logs]). - -### Git commit - -#### Sign your work - -The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. -The rules are pretty simple: if you can certify the below (from http://developercertificate.org): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -using your real name (sorry, no pseudonyms or anonymous contributions.) - -You can add the sign off when creating the git commit via `git commit -s`. - -#### Commit Style - -Simple house-keeping for clean git history. -Read more on [How to Write a Git Commit Message][how-to-git-commit] or the Discussion section of [git-commit(1)][git-commit.1]. - -1. Separate the subject from body with a blank line -2. Limit the subject line to 50 characters -3. Capitalize the subject line -4. Do not end the subject line with a period -5. Use the imperative mood in the subject line -6. Wrap the body at 72 characters -7. Use the body to explain what and why vs. how - * If there was important/useful/essential conversation or information, copy or include a reference -8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") - - -[charter]: https://www.opencontainers.org/about/governance -[code-of-conduct]: https://github.com/opencontainers/tob/blob/master/code-of-conduct.md -[dev-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev -[how-to-git-commit]: http://chris.beams.io/posts/git-commit -[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ -[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date -[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ -[oci]: https://www.opencontainers.org -[rfc5545]: https://tools.ietf.org/html/rfc5545 -[runtime-wiki]: https://github.com/opencontainers/runtime-spec/wiki -[uberconference]: https://www.uberconference.com/opencontainers - -[git-commit.1]: http://git-scm.com/docs/git-commit diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go deleted file mode 100644 index 27268f971c..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ /dev/null @@ -1,642 +0,0 @@ -package specs - -import "os" - -// Spec is the base configuration for the container. -type Spec struct { - // Version of the Open Container Initiative Runtime Specification with which the bundle complies. - Version string `json:"ociVersion"` - // Process configures the container process. - Process *Process `json:"process,omitempty"` - // Root configures the container's root filesystem. - Root *Root `json:"root,omitempty"` - // Hostname configures the container's hostname. - Hostname string `json:"hostname,omitempty"` - // Mounts configures additional mounts (on top of Root). - Mounts []Mount `json:"mounts,omitempty"` - // Hooks configures callbacks for container lifecycle events. - Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"` - // Annotations contains arbitrary metadata for the container. - Annotations map[string]string `json:"annotations,omitempty"` - - // Linux is platform-specific configuration for Linux based containers. - Linux *Linux `json:"linux,omitempty" platform:"linux"` - // Solaris is platform-specific configuration for Solaris based containers. - Solaris *Solaris `json:"solaris,omitempty" platform:"solaris"` - // Windows is platform-specific configuration for Windows based containers. - Windows *Windows `json:"windows,omitempty" platform:"windows"` - // VM specifies configuration for virtual-machine-based containers. - VM *VM `json:"vm,omitempty" platform:"vm"` -} - -// Process contains information to start a specific application inside the container. -type Process struct { - // Terminal creates an interactive terminal for the container. - Terminal bool `json:"terminal,omitempty"` - // ConsoleSize specifies the size of the console. - ConsoleSize *Box `json:"consoleSize,omitempty"` - // User specifies user information for the process. - User User `json:"user"` - // Args specifies the binary and arguments for the application to execute. - Args []string `json:"args,omitempty"` - // CommandLine specifies the full command line for the application to execute on Windows. - CommandLine string `json:"commandLine,omitempty" platform:"windows"` - // Env populates the process environment for the process. - Env []string `json:"env,omitempty"` - // Cwd is the current working directory for the process and must be - // relative to the container's root. - Cwd string `json:"cwd"` - // Capabilities are Linux capabilities that are kept for the process. - Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"` - // Rlimits specifies rlimit options to apply to the process. - Rlimits []POSIXRlimit `json:"rlimits,omitempty" platform:"linux,solaris"` - // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. - NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"` - // ApparmorProfile specifies the apparmor profile for the container. - ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` - // Specify an oom_score_adj for the container. - OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"` - // SelinuxLabel specifies the selinux context that the container process is run as. - SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` -} - -// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. -// http://man7.org/linux/man-pages/man7/capabilities.7.html -type LinuxCapabilities struct { - // Bounding is the set of capabilities checked by the kernel. - Bounding []string `json:"bounding,omitempty" platform:"linux"` - // Effective is the set of capabilities checked by the kernel. - Effective []string `json:"effective,omitempty" platform:"linux"` - // Inheritable is the capabilities preserved across execve. - Inheritable []string `json:"inheritable,omitempty" platform:"linux"` - // Permitted is the limiting superset for effective capabilities. - Permitted []string `json:"permitted,omitempty" platform:"linux"` - // Ambient is the ambient set of capabilities that are kept. - Ambient []string `json:"ambient,omitempty" platform:"linux"` -} - -// Box specifies dimensions of a rectangle. Used for specifying the size of a console. -type Box struct { - // Height is the vertical dimension of a box. - Height uint `json:"height"` - // Width is the horizontal dimension of a box. - Width uint `json:"width"` -} - -// User specifies specific user (and group) information for the container process. -type User struct { - // UID is the user id. - UID uint32 `json:"uid" platform:"linux,solaris"` - // GID is the group id. - GID uint32 `json:"gid" platform:"linux,solaris"` - // AdditionalGids are additional group ids set for the container's process. - AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` - // Username is the user name. - Username string `json:"username,omitempty" platform:"windows"` -} - -// Root contains information about the container's root filesystem on the host. -type Root struct { - // Path is the absolute path to the container's root filesystem. - Path string `json:"path"` - // Readonly makes the root filesystem for the container readonly before the process is executed. - Readonly bool `json:"readonly,omitempty"` -} - -// Mount specifies a mount for a container. -type Mount struct { - // Destination is the absolute path where the mount will be placed in the container. - Destination string `json:"destination"` - // Type specifies the mount kind. - Type string `json:"type,omitempty" platform:"linux,solaris"` - // Source specifies the source path of the mount. - Source string `json:"source,omitempty"` - // Options are fstab style mount options. - Options []string `json:"options,omitempty"` -} - -// Hook specifies a command that is run at a particular event in the lifecycle of a container -type Hook struct { - Path string `json:"path"` - Args []string `json:"args,omitempty"` - Env []string `json:"env,omitempty"` - Timeout *int `json:"timeout,omitempty"` -} - -// Hooks for container setup and teardown -type Hooks struct { - // Prestart is a list of hooks to be run before the container process is executed. - Prestart []Hook `json:"prestart,omitempty"` - // Poststart is a list of hooks to be run after the container process is started. - Poststart []Hook `json:"poststart,omitempty"` - // Poststop is a list of hooks to be run after the container process exits. - Poststop []Hook `json:"poststop,omitempty"` -} - -// Linux contains platform-specific configuration for Linux based containers. -type Linux struct { - // UIDMapping specifies user mappings for supporting user namespaces. - UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"` - // GIDMapping specifies group mappings for supporting user namespaces. - GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"` - // Sysctl are a set of key value pairs that are set for the container on start - Sysctl map[string]string `json:"sysctl,omitempty"` - // Resources contain cgroup information for handling resource constraints - // for the container - Resources *LinuxResources `json:"resources,omitempty"` - // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. - // The path is expected to be relative to the cgroups mountpoint. - // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. - CgroupsPath string `json:"cgroupsPath,omitempty"` - // Namespaces contains the namespaces that are created and/or joined by the container - Namespaces []LinuxNamespace `json:"namespaces,omitempty"` - // Devices are a list of device nodes that are created for the container - Devices []LinuxDevice `json:"devices,omitempty"` - // Seccomp specifies the seccomp security settings for the container. - Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` - // RootfsPropagation is the rootfs mount propagation mode for the container. - RootfsPropagation string `json:"rootfsPropagation,omitempty"` - // MaskedPaths masks over the provided paths inside the container. - MaskedPaths []string `json:"maskedPaths,omitempty"` - // ReadonlyPaths sets the provided paths as RO inside the container. - ReadonlyPaths []string `json:"readonlyPaths,omitempty"` - // MountLabel specifies the selinux context for the mounts in the container. - MountLabel string `json:"mountLabel,omitempty"` - // IntelRdt contains Intel Resource Director Technology (RDT) information for - // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container - IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` -} - -// LinuxNamespace is the configuration for a Linux namespace -type LinuxNamespace struct { - // Type is the type of namespace - Type LinuxNamespaceType `json:"type"` - // Path is a path to an existing namespace persisted on disk that can be joined - // and is of the same type - Path string `json:"path,omitempty"` -} - -// LinuxNamespaceType is one of the Linux namespaces -type LinuxNamespaceType string - -const ( - // PIDNamespace for isolating process IDs - PIDNamespace LinuxNamespaceType = "pid" - // NetworkNamespace for isolating network devices, stacks, ports, etc - NetworkNamespace = "network" - // MountNamespace for isolating mount points - MountNamespace = "mount" - // IPCNamespace for isolating System V IPC, POSIX message queues - IPCNamespace = "ipc" - // UTSNamespace for isolating hostname and NIS domain name - UTSNamespace = "uts" - // UserNamespace for isolating user and group IDs - UserNamespace = "user" - // CgroupNamespace for isolating cgroup hierarchies - CgroupNamespace = "cgroup" -) - -// LinuxIDMapping specifies UID/GID mappings -type LinuxIDMapping struct { - // ContainerID is the starting UID/GID in the container - ContainerID uint32 `json:"containerID"` - // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' - HostID uint32 `json:"hostID"` - // Size is the number of IDs to be mapped - Size uint32 `json:"size"` -} - -// POSIXRlimit type and restrictions -type POSIXRlimit struct { - // Type of the rlimit to set - Type string `json:"type"` - // Hard is the hard limit for the specified type - Hard uint64 `json:"hard"` - // Soft is the soft limit for the specified type - Soft uint64 `json:"soft"` -} - -// LinuxHugepageLimit structure corresponds to limiting kernel hugepages -type LinuxHugepageLimit struct { - // Pagesize is the hugepage size - Pagesize string `json:"pageSize"` - // Limit is the limit of "hugepagesize" hugetlb usage - Limit uint64 `json:"limit"` -} - -// LinuxInterfacePriority for network interfaces -type LinuxInterfacePriority struct { - // Name is the name of the network interface - Name string `json:"name"` - // Priority for the interface - Priority uint32 `json:"priority"` -} - -// linuxBlockIODevice holds major:minor format supported in blkio cgroup -type linuxBlockIODevice struct { - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` -} - -// LinuxWeightDevice struct holds a `major:minor weight` pair for weightDevice -type LinuxWeightDevice struct { - linuxBlockIODevice - // Weight is the bandwidth rate for the device. - Weight *uint16 `json:"weight,omitempty"` - // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` -} - -// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair -type LinuxThrottleDevice struct { - linuxBlockIODevice - // Rate is the IO rate limit per cgroup per device - Rate uint64 `json:"rate"` -} - -// LinuxBlockIO for Linux cgroup 'blkio' resource management -type LinuxBlockIO struct { - // Specifies per cgroup weight - Weight *uint16 `json:"weight,omitempty"` - // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` - // Weight per cgroup per device, can override BlkioWeight - WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` - // IO read rate limit per cgroup per device, bytes per second - ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` - // IO write rate limit per cgroup per device, bytes per second - ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` - // IO read rate limit per cgroup per device, IO per second - ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` - // IO write rate limit per cgroup per device, IO per second - ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` -} - -// LinuxMemory for Linux cgroup 'memory' resource management -type LinuxMemory struct { - // Memory limit (in bytes). - Limit *int64 `json:"limit,omitempty"` - // Memory reservation or soft_limit (in bytes). - Reservation *int64 `json:"reservation,omitempty"` - // Total memory limit (memory + swap). - Swap *int64 `json:"swap,omitempty"` - // Kernel memory limit (in bytes). - Kernel *int64 `json:"kernel,omitempty"` - // Kernel memory limit for tcp (in bytes) - KernelTCP *int64 `json:"kernelTCP,omitempty"` - // How aggressive the kernel will swap memory pages. - Swappiness *uint64 `json:"swappiness,omitempty"` - // DisableOOMKiller disables the OOM killer for out of memory conditions - DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` -} - -// LinuxCPU for Linux cgroup 'cpu' resource management -type LinuxCPU struct { - // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). - Shares *uint64 `json:"shares,omitempty"` - // CPU hardcap limit (in usecs). Allowed cpu time in a given period. - Quota *int64 `json:"quota,omitempty"` - // CPU period to be used for hardcapping (in usecs). - Period *uint64 `json:"period,omitempty"` - // How much time realtime scheduling may use (in usecs). - RealtimeRuntime *int64 `json:"realtimeRuntime,omitempty"` - // CPU period to be used for realtime scheduling (in usecs). - RealtimePeriod *uint64 `json:"realtimePeriod,omitempty"` - // CPUs to use within the cpuset. Default is to use any CPU available. - Cpus string `json:"cpus,omitempty"` - // List of memory nodes in the cpuset. Default is to use any available memory node. - Mems string `json:"mems,omitempty"` -} - -// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) -type LinuxPids struct { - // Maximum number of PIDs. Default is "no limit". - Limit int64 `json:"limit"` -} - -// LinuxNetwork identification and priority configuration -type LinuxNetwork struct { - // Set class identifier for container's network packets - ClassID *uint32 `json:"classID,omitempty"` - // Set priority of network traffic for container - Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` -} - -// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) -type LinuxRdma struct { - // Maximum number of HCA handles that can be opened. Default is "no limit". - HcaHandles *uint32 `json:"hcaHandles,omitempty"` - // Maximum number of HCA objects that can be created. Default is "no limit". - HcaObjects *uint32 `json:"hcaObjects,omitempty"` -} - -// LinuxResources has container runtime resource constraints -type LinuxResources struct { - // Devices configures the device whitelist. - Devices []LinuxDeviceCgroup `json:"devices,omitempty"` - // Memory restriction configuration - Memory *LinuxMemory `json:"memory,omitempty"` - // CPU resource restriction configuration - CPU *LinuxCPU `json:"cpu,omitempty"` - // Task resource restriction configuration. - Pids *LinuxPids `json:"pids,omitempty"` - // BlockIO restriction configuration - BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` - // Hugetlb limit (in bytes) - HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` - // Network restriction configuration - Network *LinuxNetwork `json:"network,omitempty"` - // Rdma resource restriction configuration. - // Limits are a set of key value pairs that define RDMA resource limits, - // where the key is device name and value is resource limits. - Rdma map[string]LinuxRdma `json:"rdma,omitempty"` -} - -// LinuxDevice represents the mknod information for a Linux special device file -type LinuxDevice struct { - // Path to the device. - Path string `json:"path"` - // Device type, block, char, etc. - Type string `json:"type"` - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` - // FileMode permission bits for the device. - FileMode *os.FileMode `json:"fileMode,omitempty"` - // UID of the device. - UID *uint32 `json:"uid,omitempty"` - // Gid of the device. - GID *uint32 `json:"gid,omitempty"` -} - -// LinuxDeviceCgroup represents a device rule for the whitelist controller -type LinuxDeviceCgroup struct { - // Allow or deny - Allow bool `json:"allow"` - // Device type, block, char, etc. - Type string `json:"type,omitempty"` - // Major is the device's major number. - Major *int64 `json:"major,omitempty"` - // Minor is the device's minor number. - Minor *int64 `json:"minor,omitempty"` - // Cgroup access permissions format, rwm. - Access string `json:"access,omitempty"` -} - -// Solaris contains platform-specific configuration for Solaris application containers. -type Solaris struct { - // SMF FMRI which should go "online" before we start the container process. - Milestone string `json:"milestone,omitempty"` - // Maximum set of privileges any process in this container can obtain. - LimitPriv string `json:"limitpriv,omitempty"` - // The maximum amount of shared memory allowed for this container. - MaxShmMemory string `json:"maxShmMemory,omitempty"` - // Specification for automatic creation of network resources for this container. - Anet []SolarisAnet `json:"anet,omitempty"` - // Set limit on the amount of CPU time that can be used by container. - CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"` - // The physical and swap caps on the memory that can be used by this container. - CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"` -} - -// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container. -type SolarisCappedCPU struct { - Ncpus string `json:"ncpus,omitempty"` -} - -// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container. -type SolarisCappedMemory struct { - Physical string `json:"physical,omitempty"` - Swap string `json:"swap,omitempty"` -} - -// SolarisAnet provides the specification for automatic creation of network resources for this container. -type SolarisAnet struct { - // Specify a name for the automatically created VNIC datalink. - Linkname string `json:"linkname,omitempty"` - // Specify the link over which the VNIC will be created. - Lowerlink string `json:"lowerLink,omitempty"` - // The set of IP addresses that the container can use. - Allowedaddr string `json:"allowedAddress,omitempty"` - // Specifies whether allowedAddress limitation is to be applied to the VNIC. - Configallowedaddr string `json:"configureAllowedAddress,omitempty"` - // The value of the optional default router. - Defrouter string `json:"defrouter,omitempty"` - // Enable one or more types of link protection. - Linkprotection string `json:"linkProtection,omitempty"` - // Set the VNIC's macAddress - Macaddress string `json:"macAddress,omitempty"` -} - -// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. -type Windows struct { - // LayerFolders contains a list of absolute paths to directories containing image layers. - LayerFolders []string `json:"layerFolders"` - // Devices are the list of devices to be mapped into the container. - Devices []WindowsDevice `json:"devices,omitempty"` - // Resources contains information for handling resource constraints for the container. - Resources *WindowsResources `json:"resources,omitempty"` - // CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification. - CredentialSpec interface{} `json:"credentialSpec,omitempty"` - // Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation. - Servicing bool `json:"servicing,omitempty"` - // IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process. - IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` - // HyperV contains information for running a container with Hyper-V isolation. - HyperV *WindowsHyperV `json:"hyperv,omitempty"` - // Network restriction configuration. - Network *WindowsNetwork `json:"network,omitempty"` -} - -// WindowsDevice represents information about a host device to be mapped into the container. -type WindowsDevice struct { - // Device identifier: interface class GUID, etc. - ID string `json:"id"` - // Device identifier type: "class", etc. - IDType string `json:"idType"` -} - -// WindowsResources has container runtime resource constraints for containers running on Windows. -type WindowsResources struct { - // Memory restriction configuration. - Memory *WindowsMemoryResources `json:"memory,omitempty"` - // CPU resource restriction configuration. - CPU *WindowsCPUResources `json:"cpu,omitempty"` - // Storage restriction configuration. - Storage *WindowsStorageResources `json:"storage,omitempty"` -} - -// WindowsMemoryResources contains memory resource management settings. -type WindowsMemoryResources struct { - // Memory limit in bytes. - Limit *uint64 `json:"limit,omitempty"` -} - -// WindowsCPUResources contains CPU resource management settings. -type WindowsCPUResources struct { - // Number of CPUs available to the container. - Count *uint64 `json:"count,omitempty"` - // CPU shares (relative weight to other containers with cpu shares). - Shares *uint16 `json:"shares,omitempty"` - // Specifies the portion of processor cycles that this container can use as a percentage times 100. - Maximum *uint16 `json:"maximum,omitempty"` -} - -// WindowsStorageResources contains storage resource management settings. -type WindowsStorageResources struct { - // Specifies maximum Iops for the system drive. - Iops *uint64 `json:"iops,omitempty"` - // Specifies maximum bytes per second for the system drive. - Bps *uint64 `json:"bps,omitempty"` - // Sandbox size specifies the minimum size of the system drive in bytes. - SandboxSize *uint64 `json:"sandboxSize,omitempty"` -} - -// WindowsNetwork contains network settings for Windows containers. -type WindowsNetwork struct { - // List of HNS endpoints that the container should connect to. - EndpointList []string `json:"endpointList,omitempty"` - // Specifies if unqualified DNS name resolution is allowed. - AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` - // Comma separated list of DNS suffixes to use for name resolution. - DNSSearchList []string `json:"DNSSearchList,omitempty"` - // Name (ID) of the container that we will share with the network stack. - NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` - // name (ID) of the network namespace that will be used for the container. - NetworkNamespace string `json:"networkNamespace,omitempty"` -} - -// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. -type WindowsHyperV struct { - // UtilityVMPath is an optional path to the image used for the Utility VM. - UtilityVMPath string `json:"utilityVMPath,omitempty"` -} - -// VM contains information for virtual-machine-based containers. -type VM struct { - // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers. - Hypervisor VMHypervisor `json:"hypervisor,omitempty"` - // Kernel specifies kernel-related configuration for virtual-machine-based containers. - Kernel VMKernel `json:"kernel"` - // Image specifies guest image related configuration for virtual-machine-based containers. - Image VMImage `json:"image,omitempty"` -} - -// VMHypervisor contains information about the hypervisor to use for a virtual machine. -type VMHypervisor struct { - // Path is the host path to the hypervisor used to manage the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the hypervisor. - Parameters []string `json:"parameters,omitempty"` -} - -// VMKernel contains information about the kernel to use for a virtual machine. -type VMKernel struct { - // Path is the host path to the kernel used to boot the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the kernel. - Parameters []string `json:"parameters,omitempty"` - // InitRD is the host path to an initial ramdisk to be used by the kernel. - InitRD string `json:"initrd,omitempty"` -} - -// VMImage contains information about the virtual machine root image. -type VMImage struct { - // Path is the host path to the root image that the VM kernel would boot into. - Path string `json:"path"` - // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc). - Format string `json:"format"` -} - -// LinuxSeccomp represents syscall restrictions -type LinuxSeccomp struct { - DefaultAction LinuxSeccompAction `json:"defaultAction"` - Architectures []Arch `json:"architectures,omitempty"` - Syscalls []LinuxSyscall `json:"syscalls,omitempty"` -} - -// Arch used for additional architectures -type Arch string - -// Additional architectures permitted to be used for system calls -// By default only the native architecture of the kernel is permitted -const ( - ArchX86 Arch = "SCMP_ARCH_X86" - ArchX86_64 Arch = "SCMP_ARCH_X86_64" - ArchX32 Arch = "SCMP_ARCH_X32" - ArchARM Arch = "SCMP_ARCH_ARM" - ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" - ArchMIPS Arch = "SCMP_ARCH_MIPS" - ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" - ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" - ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" - ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" - ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" - ArchPPC Arch = "SCMP_ARCH_PPC" - ArchPPC64 Arch = "SCMP_ARCH_PPC64" - ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" - ArchS390 Arch = "SCMP_ARCH_S390" - ArchS390X Arch = "SCMP_ARCH_S390X" - ArchPARISC Arch = "SCMP_ARCH_PARISC" - ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" -) - -// LinuxSeccompAction taken upon Seccomp rule match -type LinuxSeccompAction string - -// Define actions for Seccomp rules -const ( - ActKill LinuxSeccompAction = "SCMP_ACT_KILL" - ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" - ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" - ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" - ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" -) - -// LinuxSeccompOperator used to match syscall arguments in Seccomp -type LinuxSeccompOperator string - -// Define operators for syscall arguments in Seccomp -const ( - OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE" - OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT" - OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE" - OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ" - OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE" - OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT" - OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ" -) - -// LinuxSeccompArg used for matching specific syscall arguments in Seccomp -type LinuxSeccompArg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"valueTwo,omitempty"` - Op LinuxSeccompOperator `json:"op"` -} - -// LinuxSyscall is used to match a syscall in Seccomp -type LinuxSyscall struct { - Names []string `json:"names"` - Action LinuxSeccompAction `json:"action"` - Args []LinuxSeccompArg `json:"args,omitempty"` -} - -// LinuxIntelRdt has container runtime resource constraints for Intel RDT -// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel -type LinuxIntelRdt struct { - // The identity for RDT Class of Service - ClosID string `json:"closID,omitempty"` - // The schema for L3 cache id and capacity bitmask (CBM) - // Format: "L3:=;=;..." - L3CacheSchema string `json:"l3CacheSchema,omitempty"` - - // The schema of memory bandwidth per L3 cache id - // Format: "MB:=bandwidth0;=bandwidth1;..." - // The unit of memory bandwidth is specified in "percentages" by - // default, and in "MBps" if MBA Software Controller is enabled. - MemBwSchema string `json:"memBwSchema,omitempty"` -} diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go deleted file mode 100644 index 89dce34be2..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go +++ /dev/null @@ -1,17 +0,0 @@ -package specs - -// State holds information about the runtime state of the container. -type State struct { - // Version is the version of the specification that is supported. - Version string `json:"ociVersion"` - // ID is the container ID - ID string `json:"id"` - // Status is the runtime status of the container. - Status string `json:"status"` - // Pid is the process ID for the container process. - Pid int `json:"pid,omitempty"` - // Bundle is the path to the container's bundle directory. - Bundle string `json:"bundle"` - // Annotations are key values associated with the container. - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go deleted file mode 100644 index b920fc1b39..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go +++ /dev/null @@ -1,18 +0,0 @@ -package specs - -import "fmt" - -const ( - // VersionMajor is for an API incompatible changes - VersionMajor = 1 - // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 0 - // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 1 - - // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-dev" -) - -// Version is the specification version that the package types support. -var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/vendor/github.com/syndtr/gocapability/LICENSE b/vendor/github.com/syndtr/gocapability/LICENSE deleted file mode 100644 index 80dd96de77..0000000000 --- a/vendor/github.com/syndtr/gocapability/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2013 Suryandaru Triandana -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/syndtr/gocapability/capability/capability.go b/vendor/github.com/syndtr/gocapability/capability/capability.go deleted file mode 100644 index 61a90775e5..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/capability.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2013, Suryandaru Triandana -// All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Package capability provides utilities for manipulating POSIX capabilities. -package capability - -type Capabilities interface { - // Get check whether a capability present in the given - // capabilities set. The 'which' value should be one of EFFECTIVE, - // PERMITTED, INHERITABLE, BOUNDING or AMBIENT. - Get(which CapType, what Cap) bool - - // Empty check whether all capability bits of the given capabilities - // set are zero. The 'which' value should be one of EFFECTIVE, - // PERMITTED, INHERITABLE, BOUNDING or AMBIENT. - Empty(which CapType) bool - - // Full check whether all capability bits of the given capabilities - // set are one. The 'which' value should be one of EFFECTIVE, - // PERMITTED, INHERITABLE, BOUNDING or AMBIENT. - Full(which CapType) bool - - // Set sets capabilities of the given capabilities sets. The - // 'which' value should be one or combination (OR'ed) of EFFECTIVE, - // PERMITTED, INHERITABLE, BOUNDING or AMBIENT. - Set(which CapType, caps ...Cap) - - // Unset unsets capabilities of the given capabilities sets. The - // 'which' value should be one or combination (OR'ed) of EFFECTIVE, - // PERMITTED, INHERITABLE, BOUNDING or AMBIENT. - Unset(which CapType, caps ...Cap) - - // Fill sets all bits of the given capabilities kind to one. The - // 'kind' value should be one or combination (OR'ed) of CAPS, - // BOUNDS or AMBS. - Fill(kind CapType) - - // Clear sets all bits of the given capabilities kind to zero. The - // 'kind' value should be one or combination (OR'ed) of CAPS, - // BOUNDS or AMBS. - Clear(kind CapType) - - // String return current capabilities state of the given capabilities - // set as string. The 'which' value should be one of EFFECTIVE, - // PERMITTED, INHERITABLE BOUNDING or AMBIENT - StringCap(which CapType) string - - // String return current capabilities state as string. - String() string - - // Load load actual capabilities value. This will overwrite all - // outstanding changes. - Load() error - - // Apply apply the capabilities settings, so all changes will take - // effect. - Apply(kind CapType) error -} - -// NewPid initializes a new Capabilities object for given pid when -// it is nonzero, or for the current process if pid is 0. -// -// Deprecated: Replace with NewPid2. For example, replace: -// -// c, err := NewPid(0) -// if err != nil { -// return err -// } -// -// with: -// -// c, err := NewPid2(0) -// if err != nil { -// return err -// } -// err = c.Load() -// if err != nil { -// return err -// } -func NewPid(pid int) (Capabilities, error) { - c, err := newPid(pid) - if err != nil { - return c, err - } - err = c.Load() - return c, err -} - -// NewPid2 initializes a new Capabilities object for given pid when -// it is nonzero, or for the current process if pid is 0. This -// does not load the process's current capabilities; to do that you -// must call Load explicitly. -func NewPid2(pid int) (Capabilities, error) { - return newPid(pid) -} - -// NewFile initializes a new Capabilities object for given file path. -// -// Deprecated: Replace with NewFile2. For example, replace: -// -// c, err := NewFile(path) -// if err != nil { -// return err -// } -// -// with: -// -// c, err := NewFile2(path) -// if err != nil { -// return err -// } -// err = c.Load() -// if err != nil { -// return err -// } -func NewFile(path string) (Capabilities, error) { - c, err := newFile(path) - if err != nil { - return c, err - } - err = c.Load() - return c, err -} - -// NewFile2 creates a new initialized Capabilities object for given -// file path. This does not load the process's current capabilities; -// to do that you must call Load explicitly. -func NewFile2(path string) (Capabilities, error) { - return newFile(path) -} diff --git a/vendor/github.com/syndtr/gocapability/capability/capability_linux.go b/vendor/github.com/syndtr/gocapability/capability/capability_linux.go deleted file mode 100644 index 1567dc8104..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/capability_linux.go +++ /dev/null @@ -1,642 +0,0 @@ -// Copyright (c) 2013, Suryandaru Triandana -// All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package capability - -import ( - "bufio" - "errors" - "fmt" - "io" - "os" - "strings" - "syscall" -) - -var errUnknownVers = errors.New("unknown capability version") - -const ( - linuxCapVer1 = 0x19980330 - linuxCapVer2 = 0x20071026 - linuxCapVer3 = 0x20080522 -) - -var ( - capVers uint32 - capLastCap Cap -) - -func init() { - var hdr capHeader - capget(&hdr, nil) - capVers = hdr.version - - if initLastCap() == nil { - CAP_LAST_CAP = capLastCap - if capLastCap > 31 { - capUpperMask = (uint32(1) << (uint(capLastCap) - 31)) - 1 - } else { - capUpperMask = 0 - } - } -} - -func initLastCap() error { - if capLastCap != 0 { - return nil - } - - f, err := os.Open("/proc/sys/kernel/cap_last_cap") - if err != nil { - return err - } - defer f.Close() - - var b []byte = make([]byte, 11) - _, err = f.Read(b) - if err != nil { - return err - } - - fmt.Sscanf(string(b), "%d", &capLastCap) - - return nil -} - -func mkStringCap(c Capabilities, which CapType) (ret string) { - for i, first := Cap(0), true; i <= CAP_LAST_CAP; i++ { - if !c.Get(which, i) { - continue - } - if first { - first = false - } else { - ret += ", " - } - ret += i.String() - } - return -} - -func mkString(c Capabilities, max CapType) (ret string) { - ret = "{" - for i := CapType(1); i <= max; i <<= 1 { - ret += " " + i.String() + "=\"" - if c.Empty(i) { - ret += "empty" - } else if c.Full(i) { - ret += "full" - } else { - ret += c.StringCap(i) - } - ret += "\"" - } - ret += " }" - return -} - -func newPid(pid int) (c Capabilities, err error) { - switch capVers { - case linuxCapVer1: - p := new(capsV1) - p.hdr.version = capVers - p.hdr.pid = int32(pid) - c = p - case linuxCapVer2, linuxCapVer3: - p := new(capsV3) - p.hdr.version = capVers - p.hdr.pid = int32(pid) - c = p - default: - err = errUnknownVers - return - } - return -} - -type capsV1 struct { - hdr capHeader - data capData -} - -func (c *capsV1) Get(which CapType, what Cap) bool { - if what > 32 { - return false - } - - switch which { - case EFFECTIVE: - return (1< 32 { - continue - } - - if which&EFFECTIVE != 0 { - c.data.effective |= 1 << uint(what) - } - if which&PERMITTED != 0 { - c.data.permitted |= 1 << uint(what) - } - if which&INHERITABLE != 0 { - c.data.inheritable |= 1 << uint(what) - } - } -} - -func (c *capsV1) Unset(which CapType, caps ...Cap) { - for _, what := range caps { - if what > 32 { - continue - } - - if which&EFFECTIVE != 0 { - c.data.effective &= ^(1 << uint(what)) - } - if which&PERMITTED != 0 { - c.data.permitted &= ^(1 << uint(what)) - } - if which&INHERITABLE != 0 { - c.data.inheritable &= ^(1 << uint(what)) - } - } -} - -func (c *capsV1) Fill(kind CapType) { - if kind&CAPS == CAPS { - c.data.effective = 0x7fffffff - c.data.permitted = 0x7fffffff - c.data.inheritable = 0 - } -} - -func (c *capsV1) Clear(kind CapType) { - if kind&CAPS == CAPS { - c.data.effective = 0 - c.data.permitted = 0 - c.data.inheritable = 0 - } -} - -func (c *capsV1) StringCap(which CapType) (ret string) { - return mkStringCap(c, which) -} - -func (c *capsV1) String() (ret string) { - return mkString(c, BOUNDING) -} - -func (c *capsV1) Load() (err error) { - return capget(&c.hdr, &c.data) -} - -func (c *capsV1) Apply(kind CapType) error { - if kind&CAPS == CAPS { - return capset(&c.hdr, &c.data) - } - return nil -} - -type capsV3 struct { - hdr capHeader - data [2]capData - bounds [2]uint32 - ambient [2]uint32 -} - -func (c *capsV3) Get(which CapType, what Cap) bool { - var i uint - if what > 31 { - i = uint(what) >> 5 - what %= 32 - } - - switch which { - case EFFECTIVE: - return (1< 31 { - i = uint(what) >> 5 - what %= 32 - } - - if which&EFFECTIVE != 0 { - c.data[i].effective |= 1 << uint(what) - } - if which&PERMITTED != 0 { - c.data[i].permitted |= 1 << uint(what) - } - if which&INHERITABLE != 0 { - c.data[i].inheritable |= 1 << uint(what) - } - if which&BOUNDING != 0 { - c.bounds[i] |= 1 << uint(what) - } - if which&AMBIENT != 0 { - c.ambient[i] |= 1 << uint(what) - } - } -} - -func (c *capsV3) Unset(which CapType, caps ...Cap) { - for _, what := range caps { - var i uint - if what > 31 { - i = uint(what) >> 5 - what %= 32 - } - - if which&EFFECTIVE != 0 { - c.data[i].effective &= ^(1 << uint(what)) - } - if which&PERMITTED != 0 { - c.data[i].permitted &= ^(1 << uint(what)) - } - if which&INHERITABLE != 0 { - c.data[i].inheritable &= ^(1 << uint(what)) - } - if which&BOUNDING != 0 { - c.bounds[i] &= ^(1 << uint(what)) - } - if which&AMBIENT != 0 { - c.ambient[i] &= ^(1 << uint(what)) - } - } -} - -func (c *capsV3) Fill(kind CapType) { - if kind&CAPS == CAPS { - c.data[0].effective = 0xffffffff - c.data[0].permitted = 0xffffffff - c.data[0].inheritable = 0 - c.data[1].effective = 0xffffffff - c.data[1].permitted = 0xffffffff - c.data[1].inheritable = 0 - } - - if kind&BOUNDS == BOUNDS { - c.bounds[0] = 0xffffffff - c.bounds[1] = 0xffffffff - } - if kind&AMBS == AMBS { - c.ambient[0] = 0xffffffff - c.ambient[1] = 0xffffffff - } -} - -func (c *capsV3) Clear(kind CapType) { - if kind&CAPS == CAPS { - c.data[0].effective = 0 - c.data[0].permitted = 0 - c.data[0].inheritable = 0 - c.data[1].effective = 0 - c.data[1].permitted = 0 - c.data[1].inheritable = 0 - } - - if kind&BOUNDS == BOUNDS { - c.bounds[0] = 0 - c.bounds[1] = 0 - } - if kind&AMBS == AMBS { - c.ambient[0] = 0 - c.ambient[1] = 0 - } -} - -func (c *capsV3) StringCap(which CapType) (ret string) { - return mkStringCap(c, which) -} - -func (c *capsV3) String() (ret string) { - return mkString(c, BOUNDING) -} - -func (c *capsV3) Load() (err error) { - err = capget(&c.hdr, &c.data[0]) - if err != nil { - return - } - - var status_path string - - if c.hdr.pid == 0 { - status_path = fmt.Sprintf("/proc/self/status") - } else { - status_path = fmt.Sprintf("/proc/%d/status", c.hdr.pid) - } - - f, err := os.Open(status_path) - if err != nil { - return - } - b := bufio.NewReader(f) - for { - line, e := b.ReadString('\n') - if e != nil { - if e != io.EOF { - err = e - } - break - } - if strings.HasPrefix(line, "CapB") { - fmt.Sscanf(line[4:], "nd: %08x%08x", &c.bounds[1], &c.bounds[0]) - continue - } - if strings.HasPrefix(line, "CapA") { - fmt.Sscanf(line[4:], "mb: %08x%08x", &c.ambient[1], &c.ambient[0]) - continue - } - } - f.Close() - - return -} - -func (c *capsV3) Apply(kind CapType) (err error) { - if kind&BOUNDS == BOUNDS { - var data [2]capData - err = capget(&c.hdr, &data[0]) - if err != nil { - return - } - if (1< 31 { - if c.data.version == 1 { - return false - } - i = uint(what) >> 5 - what %= 32 - } - - switch which { - case EFFECTIVE: - return (1< 31 { - if c.data.version == 1 { - continue - } - i = uint(what) >> 5 - what %= 32 - } - - if which&EFFECTIVE != 0 { - c.data.effective[i] |= 1 << uint(what) - } - if which&PERMITTED != 0 { - c.data.data[i].permitted |= 1 << uint(what) - } - if which&INHERITABLE != 0 { - c.data.data[i].inheritable |= 1 << uint(what) - } - } -} - -func (c *capsFile) Unset(which CapType, caps ...Cap) { - for _, what := range caps { - var i uint - if what > 31 { - if c.data.version == 1 { - continue - } - i = uint(what) >> 5 - what %= 32 - } - - if which&EFFECTIVE != 0 { - c.data.effective[i] &= ^(1 << uint(what)) - } - if which&PERMITTED != 0 { - c.data.data[i].permitted &= ^(1 << uint(what)) - } - if which&INHERITABLE != 0 { - c.data.data[i].inheritable &= ^(1 << uint(what)) - } - } -} - -func (c *capsFile) Fill(kind CapType) { - if kind&CAPS == CAPS { - c.data.effective[0] = 0xffffffff - c.data.data[0].permitted = 0xffffffff - c.data.data[0].inheritable = 0 - if c.data.version == 2 { - c.data.effective[1] = 0xffffffff - c.data.data[1].permitted = 0xffffffff - c.data.data[1].inheritable = 0 - } - } -} - -func (c *capsFile) Clear(kind CapType) { - if kind&CAPS == CAPS { - c.data.effective[0] = 0 - c.data.data[0].permitted = 0 - c.data.data[0].inheritable = 0 - if c.data.version == 2 { - c.data.effective[1] = 0 - c.data.data[1].permitted = 0 - c.data.data[1].inheritable = 0 - } - } -} - -func (c *capsFile) StringCap(which CapType) (ret string) { - return mkStringCap(c, which) -} - -func (c *capsFile) String() (ret string) { - return mkString(c, INHERITABLE) -} - -func (c *capsFile) Load() (err error) { - return getVfsCap(c.path, &c.data) -} - -func (c *capsFile) Apply(kind CapType) (err error) { - if kind&CAPS == CAPS { - return setVfsCap(c.path, &c.data) - } - return -} diff --git a/vendor/github.com/syndtr/gocapability/capability/capability_noop.go b/vendor/github.com/syndtr/gocapability/capability/capability_noop.go deleted file mode 100644 index 9bb3070c5e..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/capability_noop.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2013, Suryandaru Triandana -// All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// +build !linux - -package capability - -import "errors" - -func newPid(pid int) (Capabilities, error) { - return nil, errors.New("not supported") -} - -func newFile(path string) (Capabilities, error) { - return nil, errors.New("not supported") -} diff --git a/vendor/github.com/syndtr/gocapability/capability/enum.go b/vendor/github.com/syndtr/gocapability/capability/enum.go deleted file mode 100644 index 693817317b..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/enum.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) 2013, Suryandaru Triandana -// All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package capability - -type CapType uint - -func (c CapType) String() string { - switch c { - case EFFECTIVE: - return "effective" - case PERMITTED: - return "permitted" - case INHERITABLE: - return "inheritable" - case BOUNDING: - return "bounding" - case CAPS: - return "caps" - case AMBIENT: - return "ambient" - } - return "unknown" -} - -const ( - EFFECTIVE CapType = 1 << iota - PERMITTED - INHERITABLE - BOUNDING - AMBIENT - - CAPS = EFFECTIVE | PERMITTED | INHERITABLE - BOUNDS = BOUNDING - AMBS = AMBIENT -) - -//go:generate go run enumgen/gen.go -type Cap int - -// POSIX-draft defined capabilities. -const ( - // In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this - // overrides the restriction of changing file ownership and group - // ownership. - CAP_CHOWN = Cap(0) - - // Override all DAC access, including ACL execute access if - // [_POSIX_ACL] is defined. Excluding DAC access covered by - // CAP_LINUX_IMMUTABLE. - CAP_DAC_OVERRIDE = Cap(1) - - // Overrides all DAC restrictions regarding read and search on files - // and directories, including ACL restrictions if [_POSIX_ACL] is - // defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. - CAP_DAC_READ_SEARCH = Cap(2) - - // Overrides all restrictions about allowed operations on files, where - // file owner ID must be equal to the user ID, except where CAP_FSETID - // is applicable. It doesn't override MAC and DAC restrictions. - CAP_FOWNER = Cap(3) - - // Overrides the following restrictions that the effective user ID - // shall match the file owner ID when setting the S_ISUID and S_ISGID - // bits on that file; that the effective group ID (or one of the - // supplementary group IDs) shall match the file owner ID when setting - // the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are - // cleared on successful return from chown(2) (not implemented). - CAP_FSETID = Cap(4) - - // Overrides the restriction that the real or effective user ID of a - // process sending a signal must match the real or effective user ID - // of the process receiving the signal. - CAP_KILL = Cap(5) - - // Allows setgid(2) manipulation - // Allows setgroups(2) - // Allows forged gids on socket credentials passing. - CAP_SETGID = Cap(6) - - // Allows set*uid(2) manipulation (including fsuid). - // Allows forged pids on socket credentials passing. - CAP_SETUID = Cap(7) - - // Linux-specific capabilities - - // Without VFS support for capabilities: - // Transfer any capability in your permitted set to any pid, - // remove any capability in your permitted set from any pid - // With VFS support for capabilities (neither of above, but) - // Add any capability from current's capability bounding set - // to the current process' inheritable set - // Allow taking bits out of capability bounding set - // Allow modification of the securebits for a process - CAP_SETPCAP = Cap(8) - - // Allow modification of S_IMMUTABLE and S_APPEND file attributes - CAP_LINUX_IMMUTABLE = Cap(9) - - // Allows binding to TCP/UDP sockets below 1024 - // Allows binding to ATM VCIs below 32 - CAP_NET_BIND_SERVICE = Cap(10) - - // Allow broadcasting, listen to multicast - CAP_NET_BROADCAST = Cap(11) - - // Allow interface configuration - // Allow administration of IP firewall, masquerading and accounting - // Allow setting debug option on sockets - // Allow modification of routing tables - // Allow setting arbitrary process / process group ownership on - // sockets - // Allow binding to any address for transparent proxying (also via NET_RAW) - // Allow setting TOS (type of service) - // Allow setting promiscuous mode - // Allow clearing driver statistics - // Allow multicasting - // Allow read/write of device-specific registers - // Allow activation of ATM control sockets - CAP_NET_ADMIN = Cap(12) - - // Allow use of RAW sockets - // Allow use of PACKET sockets - // Allow binding to any address for transparent proxying (also via NET_ADMIN) - CAP_NET_RAW = Cap(13) - - // Allow locking of shared memory segments - // Allow mlock and mlockall (which doesn't really have anything to do - // with IPC) - CAP_IPC_LOCK = Cap(14) - - // Override IPC ownership checks - CAP_IPC_OWNER = Cap(15) - - // Insert and remove kernel modules - modify kernel without limit - CAP_SYS_MODULE = Cap(16) - - // Allow ioperm/iopl access - // Allow sending USB messages to any device via /proc/bus/usb - CAP_SYS_RAWIO = Cap(17) - - // Allow use of chroot() - CAP_SYS_CHROOT = Cap(18) - - // Allow ptrace() of any process - CAP_SYS_PTRACE = Cap(19) - - // Allow configuration of process accounting - CAP_SYS_PACCT = Cap(20) - - // Allow configuration of the secure attention key - // Allow administration of the random device - // Allow examination and configuration of disk quotas - // Allow setting the domainname - // Allow setting the hostname - // Allow calling bdflush() - // Allow mount() and umount(), setting up new smb connection - // Allow some autofs root ioctls - // Allow nfsservctl - // Allow VM86_REQUEST_IRQ - // Allow to read/write pci config on alpha - // Allow irix_prctl on mips (setstacksize) - // Allow flushing all cache on m68k (sys_cacheflush) - // Allow removing semaphores - // Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores - // and shared memory - // Allow locking/unlocking of shared memory segment - // Allow turning swap on/off - // Allow forged pids on socket credentials passing - // Allow setting readahead and flushing buffers on block devices - // Allow setting geometry in floppy driver - // Allow turning DMA on/off in xd driver - // Allow administration of md devices (mostly the above, but some - // extra ioctls) - // Allow tuning the ide driver - // Allow access to the nvram device - // Allow administration of apm_bios, serial and bttv (TV) device - // Allow manufacturer commands in isdn CAPI support driver - // Allow reading non-standardized portions of pci configuration space - // Allow DDI debug ioctl on sbpcd driver - // Allow setting up serial ports - // Allow sending raw qic-117 commands - // Allow enabling/disabling tagged queuing on SCSI controllers and sending - // arbitrary SCSI commands - // Allow setting encryption key on loopback filesystem - // Allow setting zone reclaim policy - CAP_SYS_ADMIN = Cap(21) - - // Allow use of reboot() - CAP_SYS_BOOT = Cap(22) - - // Allow raising priority and setting priority on other (different - // UID) processes - // Allow use of FIFO and round-robin (realtime) scheduling on own - // processes and setting the scheduling algorithm used by another - // process. - // Allow setting cpu affinity on other processes - CAP_SYS_NICE = Cap(23) - - // Override resource limits. Set resource limits. - // Override quota limits. - // Override reserved space on ext2 filesystem - // Modify data journaling mode on ext3 filesystem (uses journaling - // resources) - // NOTE: ext2 honors fsuid when checking for resource overrides, so - // you can override using fsuid too - // Override size restrictions on IPC message queues - // Allow more than 64hz interrupts from the real-time clock - // Override max number of consoles on console allocation - // Override max number of keymaps - CAP_SYS_RESOURCE = Cap(24) - - // Allow manipulation of system clock - // Allow irix_stime on mips - // Allow setting the real-time clock - CAP_SYS_TIME = Cap(25) - - // Allow configuration of tty devices - // Allow vhangup() of tty - CAP_SYS_TTY_CONFIG = Cap(26) - - // Allow the privileged aspects of mknod() - CAP_MKNOD = Cap(27) - - // Allow taking of leases on files - CAP_LEASE = Cap(28) - - CAP_AUDIT_WRITE = Cap(29) - CAP_AUDIT_CONTROL = Cap(30) - CAP_SETFCAP = Cap(31) - - // Override MAC access. - // The base kernel enforces no MAC policy. - // An LSM may enforce a MAC policy, and if it does and it chooses - // to implement capability based overrides of that policy, this is - // the capability it should use to do so. - CAP_MAC_OVERRIDE = Cap(32) - - // Allow MAC configuration or state changes. - // The base kernel requires no MAC configuration. - // An LSM may enforce a MAC policy, and if it does and it chooses - // to implement capability based checks on modifications to that - // policy or the data required to maintain it, this is the - // capability it should use to do so. - CAP_MAC_ADMIN = Cap(33) - - // Allow configuring the kernel's syslog (printk behaviour) - CAP_SYSLOG = Cap(34) - - // Allow triggering something that will wake the system - CAP_WAKE_ALARM = Cap(35) - - // Allow preventing system suspends - CAP_BLOCK_SUSPEND = Cap(36) - - // Allow reading audit messages from the kernel - CAP_AUDIT_READ = Cap(37) -) - -var ( - // Highest valid capability of the running kernel. - CAP_LAST_CAP = Cap(63) - - capUpperMask = ^uint32(0) -) diff --git a/vendor/github.com/syndtr/gocapability/capability/enum_gen.go b/vendor/github.com/syndtr/gocapability/capability/enum_gen.go deleted file mode 100644 index b9e6d2d5e1..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/enum_gen.go +++ /dev/null @@ -1,129 +0,0 @@ -// generated file; DO NOT EDIT - use go generate in directory with source - -package capability - -func (c Cap) String() string { - switch c { - case CAP_CHOWN: - return "chown" - case CAP_DAC_OVERRIDE: - return "dac_override" - case CAP_DAC_READ_SEARCH: - return "dac_read_search" - case CAP_FOWNER: - return "fowner" - case CAP_FSETID: - return "fsetid" - case CAP_KILL: - return "kill" - case CAP_SETGID: - return "setgid" - case CAP_SETUID: - return "setuid" - case CAP_SETPCAP: - return "setpcap" - case CAP_LINUX_IMMUTABLE: - return "linux_immutable" - case CAP_NET_BIND_SERVICE: - return "net_bind_service" - case CAP_NET_BROADCAST: - return "net_broadcast" - case CAP_NET_ADMIN: - return "net_admin" - case CAP_NET_RAW: - return "net_raw" - case CAP_IPC_LOCK: - return "ipc_lock" - case CAP_IPC_OWNER: - return "ipc_owner" - case CAP_SYS_MODULE: - return "sys_module" - case CAP_SYS_RAWIO: - return "sys_rawio" - case CAP_SYS_CHROOT: - return "sys_chroot" - case CAP_SYS_PTRACE: - return "sys_ptrace" - case CAP_SYS_PACCT: - return "sys_pacct" - case CAP_SYS_ADMIN: - return "sys_admin" - case CAP_SYS_BOOT: - return "sys_boot" - case CAP_SYS_NICE: - return "sys_nice" - case CAP_SYS_RESOURCE: - return "sys_resource" - case CAP_SYS_TIME: - return "sys_time" - case CAP_SYS_TTY_CONFIG: - return "sys_tty_config" - case CAP_MKNOD: - return "mknod" - case CAP_LEASE: - return "lease" - case CAP_AUDIT_WRITE: - return "audit_write" - case CAP_AUDIT_CONTROL: - return "audit_control" - case CAP_SETFCAP: - return "setfcap" - case CAP_MAC_OVERRIDE: - return "mac_override" - case CAP_MAC_ADMIN: - return "mac_admin" - case CAP_SYSLOG: - return "syslog" - case CAP_WAKE_ALARM: - return "wake_alarm" - case CAP_BLOCK_SUSPEND: - return "block_suspend" - case CAP_AUDIT_READ: - return "audit_read" - } - return "unknown" -} - -// List returns list of all supported capabilities -func List() []Cap { - return []Cap{ - CAP_CHOWN, - CAP_DAC_OVERRIDE, - CAP_DAC_READ_SEARCH, - CAP_FOWNER, - CAP_FSETID, - CAP_KILL, - CAP_SETGID, - CAP_SETUID, - CAP_SETPCAP, - CAP_LINUX_IMMUTABLE, - CAP_NET_BIND_SERVICE, - CAP_NET_BROADCAST, - CAP_NET_ADMIN, - CAP_NET_RAW, - CAP_IPC_LOCK, - CAP_IPC_OWNER, - CAP_SYS_MODULE, - CAP_SYS_RAWIO, - CAP_SYS_CHROOT, - CAP_SYS_PTRACE, - CAP_SYS_PACCT, - CAP_SYS_ADMIN, - CAP_SYS_BOOT, - CAP_SYS_NICE, - CAP_SYS_RESOURCE, - CAP_SYS_TIME, - CAP_SYS_TTY_CONFIG, - CAP_MKNOD, - CAP_LEASE, - CAP_AUDIT_WRITE, - CAP_AUDIT_CONTROL, - CAP_SETFCAP, - CAP_MAC_OVERRIDE, - CAP_MAC_ADMIN, - CAP_SYSLOG, - CAP_WAKE_ALARM, - CAP_BLOCK_SUSPEND, - CAP_AUDIT_READ, - } -} diff --git a/vendor/github.com/syndtr/gocapability/capability/syscall_linux.go b/vendor/github.com/syndtr/gocapability/capability/syscall_linux.go deleted file mode 100644 index 3d2bf6927f..0000000000 --- a/vendor/github.com/syndtr/gocapability/capability/syscall_linux.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) 2013, Suryandaru Triandana -// All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package capability - -import ( - "syscall" - "unsafe" -) - -type capHeader struct { - version uint32 - pid int32 -} - -type capData struct { - effective uint32 - permitted uint32 - inheritable uint32 -} - -func capget(hdr *capHeader, data *capData) (err error) { - _, _, e1 := syscall.Syscall(syscall.SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) - if e1 != 0 { - err = e1 - } - return -} - -func capset(hdr *capHeader, data *capData) (err error) { - _, _, e1 := syscall.Syscall(syscall.SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) - if e1 != 0 { - err = e1 - } - return -} - -// not yet in syscall -const ( - pr_CAP_AMBIENT = 47 - pr_CAP_AMBIENT_IS_SET = uintptr(1) - pr_CAP_AMBIENT_RAISE = uintptr(2) - pr_CAP_AMBIENT_LOWER = uintptr(3) - pr_CAP_AMBIENT_CLEAR_ALL = uintptr(4) -) - -func prctl(option int, arg2, arg3, arg4, arg5 uintptr) (err error) { - _, _, e1 := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0) - if e1 != 0 { - err = e1 - } - return -} - -const ( - vfsXattrName = "security.capability" - - vfsCapVerMask = 0xff000000 - vfsCapVer1 = 0x01000000 - vfsCapVer2 = 0x02000000 - - vfsCapFlagMask = ^vfsCapVerMask - vfsCapFlageffective = 0x000001 - - vfscapDataSizeV1 = 4 * (1 + 2*1) - vfscapDataSizeV2 = 4 * (1 + 2*2) -) - -type vfscapData struct { - magic uint32 - data [2]struct { - permitted uint32 - inheritable uint32 - } - effective [2]uint32 - version int8 -} - -var ( - _vfsXattrName *byte -) - -func init() { - _vfsXattrName, _ = syscall.BytePtrFromString(vfsXattrName) -} - -func getVfsCap(path string, dest *vfscapData) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_vfsXattrName)), uintptr(unsafe.Pointer(dest)), vfscapDataSizeV2, 0, 0) - if e1 != 0 { - if e1 == syscall.ENODATA { - dest.version = 2 - return - } - err = e1 - } - switch dest.magic & vfsCapVerMask { - case vfsCapVer1: - dest.version = 1 - if r0 != vfscapDataSizeV1 { - return syscall.EINVAL - } - dest.data[1].permitted = 0 - dest.data[1].inheritable = 0 - case vfsCapVer2: - dest.version = 2 - if r0 != vfscapDataSizeV2 { - return syscall.EINVAL - } - default: - return syscall.EINVAL - } - if dest.magic&vfsCapFlageffective != 0 { - dest.effective[0] = dest.data[0].permitted | dest.data[0].inheritable - dest.effective[1] = dest.data[1].permitted | dest.data[1].inheritable - } else { - dest.effective[0] = 0 - dest.effective[1] = 0 - } - return -} - -func setVfsCap(path string, data *vfscapData) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var size uintptr - if data.version == 1 { - data.magic = vfsCapVer1 - size = vfscapDataSizeV1 - } else if data.version == 2 { - data.magic = vfsCapVer2 - if data.effective[0] != 0 || data.effective[1] != 0 { - data.magic |= vfsCapFlageffective - } - size = vfscapDataSizeV2 - } else { - return syscall.EINVAL - } - _, _, e1 := syscall.Syscall6(syscall.SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_vfsXattrName)), uintptr(unsafe.Pointer(data)), size, 0, 0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/golang.org/x/sync/semaphore/semaphore.go b/vendor/golang.org/x/sync/semaphore/semaphore.go deleted file mode 100644 index ac53e733e7..0000000000 --- a/vendor/golang.org/x/sync/semaphore/semaphore.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2017 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 semaphore provides a weighted semaphore implementation. -package semaphore // import "golang.org/x/sync/semaphore" - -import ( - "container/list" - "context" - "sync" -) - -type waiter struct { - n int64 - ready chan<- struct{} // Closed when semaphore acquired. -} - -// NewWeighted creates a new weighted semaphore with the given -// maximum combined weight for concurrent access. -func NewWeighted(n int64) *Weighted { - w := &Weighted{size: n} - return w -} - -// Weighted provides a way to bound concurrent access to a resource. -// The callers can request access with a given weight. -type Weighted struct { - size int64 - cur int64 - mu sync.Mutex - waiters list.List -} - -// Acquire acquires the semaphore with a weight of n, blocking until resources -// are available or ctx is done. On success, returns nil. On failure, returns -// ctx.Err() and leaves the semaphore unchanged. -// -// If ctx is already done, Acquire may still succeed without blocking. -func (s *Weighted) Acquire(ctx context.Context, n int64) error { - s.mu.Lock() - if s.size-s.cur >= n && s.waiters.Len() == 0 { - s.cur += n - s.mu.Unlock() - return nil - } - - if n > s.size { - // Don't make other Acquire calls block on one that's doomed to fail. - s.mu.Unlock() - <-ctx.Done() - return ctx.Err() - } - - ready := make(chan struct{}) - w := waiter{n: n, ready: ready} - elem := s.waiters.PushBack(w) - s.mu.Unlock() - - select { - case <-ctx.Done(): - err := ctx.Err() - s.mu.Lock() - select { - case <-ready: - // Acquired the semaphore after we were canceled. Rather than trying to - // fix up the queue, just pretend we didn't notice the cancelation. - err = nil - default: - s.waiters.Remove(elem) - } - s.mu.Unlock() - return err - - case <-ready: - return nil - } -} - -// TryAcquire acquires the semaphore with a weight of n without blocking. -// On success, returns true. On failure, returns false and leaves the semaphore unchanged. -func (s *Weighted) TryAcquire(n int64) bool { - s.mu.Lock() - success := s.size-s.cur >= n && s.waiters.Len() == 0 - if success { - s.cur += n - } - s.mu.Unlock() - return success -} - -// Release releases the semaphore with a weight of n. -func (s *Weighted) Release(n int64) { - s.mu.Lock() - s.cur -= n - if s.cur < 0 { - s.mu.Unlock() - panic("semaphore: bad release") - } - for { - next := s.waiters.Front() - if next == nil { - break // No more waiters blocked. - } - - w := next.Value.(waiter) - if s.size-s.cur < w.n { - // Not enough tokens for the next waiter. We could keep going (to try to - // find a waiter with a smaller request), but under load that could cause - // starvation for large requests; instead, we leave all remaining waiters - // blocked. - // - // Consider a semaphore used as a read-write lock, with N tokens, N - // readers, and one writer. Each reader can Acquire(1) to obtain a read - // lock. The writer can Acquire(N) to obtain a write lock, excluding all - // of the readers. If we allow the readers to jump ahead in the queue, - // the writer will starve — there is always one token available for every - // reader. - break - } - - s.cur += w.n - s.waiters.Remove(next) - close(w.ready) - } - s.mu.Unlock() -}