From f647fce891f77acdc48685a4ca786cc2e0b8ff26 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 21 Jun 2021 17:08:47 +0200 Subject: [PATCH 1/4] vendor: github.com/containerd/containerd v1.5.2 - update to v1.5.0 https://github.com/containerd/containerd/compare/0edc412565dcc6e3d6125ff9e4b009ad4b89c638...v1.5.0 (v1.5.0 is last tag on master/main branch) - update to v1.5.2 https://github.com/containerd/containerd/compare/v1.5.0...v1.5.2 Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- .../containerd/containerd/README.md | 50 +++++- .../api/services/content/v1/content.pb.go | 94 +++------- .../api/services/content/v1/content.proto | 16 ++ .../containerd/containerd/content/adaptor.go | 52 ++++++ .../containerd/containerd/content/content.go | 2 +- .../containerd/content/local/locks.go | 13 +- .../containerd/content/local/readerat.go | 28 +++ .../containerd/content/local/store.go | 38 ++-- .../containerd/content/local/store_unix.go | 2 +- .../content/proxy/content_writer.go | 9 +- .../containerd/defaults/defaults_unix.go | 2 + .../containerd/defaults/defaults_windows.go | 3 + .../github.com/containerd/containerd/go.mod | 82 +++++++++ .../containerd/containerd/log/context.go | 14 +- .../{sys => pkg/userns}/userns_linux.go | 2 +- .../{sys => pkg/userns}/userns_unsupported.go | 2 +- .../containerd/platforms/compare.go | 166 +++++++----------- .../containerd/platforms/cpuinfo.go | 26 +-- .../containerd/platforms/defaults.go | 7 +- .../containerd/platforms/defaults_windows.go | 62 ++++++- .../containerd/platforms/platforms.go | 4 +- .../containerd/remotes/docker/auth/fetch.go | 2 +- .../containerd/remotes/errors/errors.go | 18 +- .../containerd/containerd/sys/filesys.go | 35 ---- .../containerd/sys/filesys_windows.go | 72 +++++++- .../containerd/containerd/sys/oom_linux.go | 83 +++++++++ .../sys/{oom_unix.go => oom_unsupported.go} | 47 ++--- .../sys/{env.go => stat_openbsd.go} | 32 ++-- .../{oom_windows.go => userns_deprecated.go} | 16 +- .../containerd/containerd/vendor.conf | 107 ----------- 31 files changed, 647 insertions(+), 441 deletions(-) create mode 100644 vendor/github.com/containerd/containerd/content/adaptor.go create mode 100644 vendor/github.com/containerd/containerd/go.mod rename vendor/github.com/containerd/containerd/{sys => pkg/userns}/userns_linux.go (98%) rename vendor/github.com/containerd/containerd/{sys => pkg/userns}/userns_unsupported.go (98%) delete mode 100644 vendor/github.com/containerd/containerd/sys/filesys.go create mode 100644 vendor/github.com/containerd/containerd/sys/oom_linux.go rename vendor/github.com/containerd/containerd/sys/{oom_unix.go => oom_unsupported.go} (50%) rename vendor/github.com/containerd/containerd/sys/{env.go => stat_openbsd.go} (50%) rename vendor/github.com/containerd/containerd/sys/{oom_windows.go => userns_deprecated.go} (68%) delete mode 100644 vendor/github.com/containerd/containerd/vendor.conf diff --git a/vendor.conf b/vendor.conf index 24a62c89e6..9937745fe5 100755 --- a/vendor.conf +++ b/vendor.conf @@ -4,7 +4,7 @@ github.com/beorn7/perks 37c8de3658fcb183f997c4e13e83 github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 github.com/containerd/cgroups b9de8a2212026c07cec67baf3323f1fc0121e048 # v1.0.1 github.com/containerd/console 2f1e3d2b6afd18e8b2077816c711205a0b4d8769 # v1.0.2 -github.com/containerd/containerd 0edc412565dcc6e3d6125ff9e4b009ad4b89c638 # master (v1.5.0-dev) +github.com/containerd/containerd 36cc874494a56a253cd181a1a685b44b58a2e34a # v1.5.2 github.com/containerd/continuity bce1c3f9669b6f3e7f6656ee715b0b4d75fa64a6 # v0.1.0 github.com/containerd/typeurl 5e43fb8b75ed2f2305fc04e6918c8d10636771bc # v1.0.2 github.com/coreos/etcd 2c834459e1aab78a5d5219c7dfe42335fc4b617a # v3.3.25 diff --git a/vendor/github.com/containerd/containerd/README.md b/vendor/github.com/containerd/containerd/README.md index 06331484ad..1ecec1ff04 100644 --- a/vendor/github.com/containerd/containerd/README.md +++ b/vendor/github.com/containerd/containerd/README.md @@ -2,7 +2,6 @@ [![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/containerd)](https://pkg.go.dev/github.com/containerd/containerd) [![Build Status](https://github.com/containerd/containerd/workflows/CI/badge.svg)](https://github.com/containerd/containerd/actions?query=workflow%3ACI) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/containerd/containerd?branch=master&svg=true)](https://ci.appveyor.com/project/mlaventure/containerd-3g73f?branch=master) [![Nightlies](https://github.com/containerd/containerd/workflows/Nightly/badge.svg)](https://github.com/containerd/containerd/actions?query=workflow%3ANightly) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fcontainerd%2Fcontainerd.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fcontainerd%2Fcontainerd?ref=badge_shield) [![Go Report Card](https://goreportcard.com/badge/github.com/containerd/containerd)](https://goreportcard.com/report/github.com/containerd/containerd) @@ -44,13 +43,14 @@ If you are interested in trying out containerd see our example at [Getting Start There are nightly builds available for download [here](https://github.com/containerd/containerd/actions?query=workflow%3ANightly). Binaries are generated from `master` branch every night for `Linux` and `Windows`. -Please be aware: nightly builds might have critical bugs, it's not recommended for use in prodution and no support provided. +Please be aware: nightly builds might have critical bugs, it's not recommended for use in production and no support provided. ## Runtime Requirements Runtime requirements for containerd are very minimal. Most interactions with the Linux and Windows container feature sets are handled via [runc](https://github.com/opencontainers/runc) and/or -OS-specific libraries (e.g. [hcsshim](https://github.com/Microsoft/hcsshim) for Microsoft). The current required version of `runc` is always listed in [RUNC.md](/RUNC.md). +OS-specific libraries (e.g. [hcsshim](https://github.com/Microsoft/hcsshim) for Microsoft). +The current required version of `runc` is described in [RUNC.md](docs/RUNC.md). There are specific features used by containerd core code and snapshotters that will require a minimum kernel @@ -140,7 +140,7 @@ redis, err := client.NewContainer(context, "redis-master", containerd.WithNewSpe ### Root Filesystems -containerd allows you to use overlay or snapshot filesystems with your containers. It comes with builtin support for overlayfs and btrfs. +containerd allows you to use overlay or snapshot filesystems with your containers. It comes with built in support for overlayfs and btrfs. ```go // pull an image and unpack it into the configured snapshotter @@ -171,7 +171,7 @@ Taking a container object and turning it into a runnable process on a system is task, err := redis.NewTask(context, cio.NewCreator(cio.WithStdio)) defer task.Delete(context) -// the task is now running and has a pid that can be use to setup networking +// the task is now running and has a pid that can be used to setup networking // or other runtime settings outside of containerd pid := task.Pid() @@ -184,7 +184,7 @@ status, err := task.Wait(context) ### Checkpoint and Restore -If you have [criu](https://criu.org/Main_Page) installed on your machine you can checkpoint and restore containers and their tasks. This allow you to clone and/or live migrate containers to other machines. +If you have [criu](https://criu.org/Main_Page) installed on your machine you can checkpoint and restore containers and their tasks. This allows you to clone and/or live migrate containers to other machines. ```go // checkpoint the task then push it to a registry @@ -224,7 +224,7 @@ effect. address = "/var/run/mysnapshotter.sock" ``` -See [PLUGINS.md](PLUGINS.md) for how to create plugins +See [PLUGINS.md](/docs/PLUGINS.md) for how to create plugins ### Releases and API Stability @@ -232,8 +232,7 @@ Please see [RELEASES.md](RELEASES.md) for details on versioning and stability of containerd components. Downloadable 64-bit Intel/AMD binaries of all official releases are available on -our [releases page](https://github.com/containerd/containerd/releases), as well as -auto-published to the [cri-containerd-release storage bucket](https://console.cloud.google.com/storage/browser/cri-containerd-release?pli=1). +our [releases page](https://github.com/containerd/containerd/releases). For other architectures and distribution support, you will find that many Linux distributions package their own containerd and provide it across several @@ -259,6 +258,39 @@ Provide documentation to users to `source` this file into their shell if you don't place the autocomplete file in a location where it is automatically loaded for the user's shell environment. +### CRI + +`cri` is a [containerd](https://containerd.io/) plugin implementation of the Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1alpha2/api.proto). With it, you are able to use containerd as the container runtime for a Kubernetes cluster. + +![cri](./docs/cri/cri.png) + +#### CRI Status + +`cri` is a native plugin of containerd. Since containerd 1.1, the cri plugin is built into the release binaries and enabled by default. + +> **Note:** As of containerd 1.5, the `cri` plugin is merged into the containerd/containerd repo. For example, the source code previously stored under [`containerd/cri/pkg`](https://github.com/containerd/cri/tree/release/1.4/pkg) +was moved to [`containerd/containerd/pkg/cri` package](https://github.com/containerd/containerd/tree/master/pkg/cri). + +The `cri` plugin has reached GA status, representing that it is: +* Feature complete +* Works with Kubernetes 1.10 and above +* Passes all [CRI validation tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md). +* Passes all [node e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/e2e-node-tests.md). +* Passes all [e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/e2e-tests.md). + +See results on the containerd k8s [test dashboard](https://k8s-testgrid.appspot.com/sig-node-containerd) + +#### Validating Your `cri` Setup +A Kubernetes incubator project, [cri-tools](https://github.com/kubernetes-sigs/cri-tools), includes programs for exercising CRI implementations. More importantly, cri-tools includes the program `critest` which is used for running [CRI Validation Testing](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md). + +#### CRI Guides +* [Installing with Ansible and Kubeadm](contrib/ansible/README.md) +* [For Non-Ansible Users, Preforming a Custom Installation Using the Release Tarball and Kubeadm](docs/cri/installation.md) +* [CRI Plugin Testing Guide](./docs/cri/testing.md) +* [Debugging Pods, Containers, and Images with `crictl`](./docs/cri/crictl.md) +* [Configuring `cri` Plugins](./docs/cri/config.md) +* [Configuring containerd](https://github.com/containerd/containerd/blob/master/docs/man/containerd-config.8.md) + ### Communication For async communication and long running discussions please use issues and pull requests on the github repo. diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go index 1cf0aaa910..97c7d4a92b 100644 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go +++ b/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go @@ -3280,7 +3280,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > postIndex { @@ -3297,10 +3297,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3383,10 +3380,7 @@ func (m *InfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3470,10 +3464,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3593,10 +3584,7 @@ func (m *UpdateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3680,10 +3668,7 @@ func (m *UpdateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3766,10 +3751,7 @@ func (m *ListContentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3854,10 +3836,7 @@ func (m *ListContentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -3940,10 +3919,7 @@ func (m *DeleteContentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4064,10 +4040,7 @@ func (m *ReadContentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4171,10 +4144,7 @@ func (m *ReadContentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4393,10 +4363,7 @@ func (m *Status) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4479,10 +4446,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4569,10 +4533,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4655,10 +4616,7 @@ func (m *ListStatusesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -4743,10 +4701,7 @@ func (m *ListStatusesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -5062,7 +5017,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > postIndex { @@ -5079,10 +5034,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -5288,10 +5240,7 @@ func (m *WriteContentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { @@ -5374,10 +5323,7 @@ func (m *AbortRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContent } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto b/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto index 086b3e39b1..b33ea5b2e8 100644 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto +++ b/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto @@ -1,3 +1,19 @@ +/* + 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. +*/ + syntax = "proto3"; package containerd.services.content.v1; diff --git a/vendor/github.com/containerd/containerd/content/adaptor.go b/vendor/github.com/containerd/containerd/content/adaptor.go new file mode 100644 index 0000000000..88bad2610e --- /dev/null +++ b/vendor/github.com/containerd/containerd/content/adaptor.go @@ -0,0 +1,52 @@ +/* + 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 content + +import ( + "strings" + + "github.com/containerd/containerd/filters" +) + +// AdaptInfo returns `filters.Adaptor` that handles `content.Info`. +func AdaptInfo(info Info) filters.Adaptor { + return filters.AdapterFunc(func(fieldpath []string) (string, bool) { + if len(fieldpath) == 0 { + return "", false + } + + switch fieldpath[0] { + case "digest": + return info.Digest.String(), true + case "size": + // TODO: support size based filtering + case "labels": + return checkMap(fieldpath[1:], info.Labels) + } + + return "", false + }) +} + +func checkMap(fieldpath []string, m map[string]string) (string, bool) { + if len(m) == 0 { + return "", false + } + + value, ok := m[strings.Join(fieldpath, ".")] + return value, ok +} diff --git a/vendor/github.com/containerd/containerd/content/content.go b/vendor/github.com/containerd/containerd/content/content.go index d8141a68bc..ff17a8417b 100644 --- a/vendor/github.com/containerd/containerd/content/content.go +++ b/vendor/github.com/containerd/containerd/content/content.go @@ -37,7 +37,7 @@ type Provider interface { // ReaderAt only requires desc.Digest to be set. // Other fields in the descriptor may be used internally for resolving // the location of the actual data. - ReaderAt(ctx context.Context, dec ocispec.Descriptor) (ReaderAt, error) + ReaderAt(ctx context.Context, desc ocispec.Descriptor) (ReaderAt, error) } // Ingester writes content diff --git a/vendor/github.com/containerd/containerd/content/local/locks.go b/vendor/github.com/containerd/containerd/content/local/locks.go index bc3bd18e09..d1d2d564df 100644 --- a/vendor/github.com/containerd/containerd/content/local/locks.go +++ b/vendor/github.com/containerd/containerd/content/local/locks.go @@ -18,6 +18,7 @@ package local import ( "sync" + "time" "github.com/containerd/containerd/errdefs" "github.com/pkg/errors" @@ -25,9 +26,13 @@ import ( // Handles locking references +type lock struct { + since time.Time +} + var ( // locks lets us lock in process - locks = map[string]struct{}{} + locks = make(map[string]*lock) locksMu sync.Mutex ) @@ -35,11 +40,11 @@ func tryLock(ref string) error { locksMu.Lock() defer locksMu.Unlock() - if _, ok := locks[ref]; ok { - return errors.Wrapf(errdefs.ErrUnavailable, "ref %s locked", ref) + if v, ok := locks[ref]; ok { + return errors.Wrapf(errdefs.ErrUnavailable, "ref %s locked since %s", ref, v.since) } - locks[ref] = struct{}{} + locks[ref] = &lock{time.Now()} return nil } diff --git a/vendor/github.com/containerd/containerd/content/local/readerat.go b/vendor/github.com/containerd/containerd/content/local/readerat.go index 42b99dc42b..5d3ae03903 100644 --- a/vendor/github.com/containerd/containerd/content/local/readerat.go +++ b/vendor/github.com/containerd/containerd/content/local/readerat.go @@ -18,6 +18,11 @@ package local import ( "os" + + "github.com/pkg/errors" + + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/errdefs" ) // readerat implements io.ReaderAt in a completely stateless manner by opening @@ -27,6 +32,29 @@ type sizeReaderAt struct { fp *os.File } +// OpenReader creates ReaderAt from a file +func OpenReader(p string) (content.ReaderAt, error) { + fi, err := os.Stat(p) + if err != nil { + if !os.IsNotExist(err) { + return nil, err + } + + return nil, errors.Wrap(errdefs.ErrNotFound, "blob not found") + } + + fp, err := os.Open(p) + if err != nil { + if !os.IsNotExist(err) { + return nil, err + } + + return nil, errors.Wrap(errdefs.ErrNotFound, "blob not found") + } + + return sizeReaderAt{size: fi.Size(), fp: fp}, nil +} + func (ra sizeReaderAt) ReadAt(p []byte, offset int64) (int, error) { return ra.fp.ReadAt(p, offset) } diff --git a/vendor/github.com/containerd/containerd/content/local/store.go b/vendor/github.com/containerd/containerd/content/local/store.go index 87056814ab..cb6aae8293 100644 --- a/vendor/github.com/containerd/containerd/content/local/store.go +++ b/vendor/github.com/containerd/containerd/content/local/store.go @@ -131,25 +131,13 @@ func (s *store) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content. if err != nil { return nil, errors.Wrapf(err, "calculating blob path for ReaderAt") } - fi, err := os.Stat(p) - if err != nil { - if !os.IsNotExist(err) { - return nil, err - } - return nil, errors.Wrapf(errdefs.ErrNotFound, "blob %s expected at %s", desc.Digest, p) + reader, err := OpenReader(p) + if err != nil { + return nil, errors.Wrapf(err, "blob %s expected at %s", desc.Digest, p) } - fp, err := os.Open(p) - if err != nil { - if !os.IsNotExist(err) { - return nil, err - } - - return nil, errors.Wrapf(errdefs.ErrNotFound, "blob %s expected at %s", desc.Digest, p) - } - - return sizeReaderAt{size: fi.Size(), fp: fp}, nil + return reader, nil } // Delete removes a blob by its digest. @@ -240,9 +228,14 @@ func (s *store) Update(ctx context.Context, info content.Info, fieldpaths ...str return info, nil } -func (s *store) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error { - // TODO: Support filters +func (s *store) Walk(ctx context.Context, fn content.WalkFunc, fs ...string) error { root := filepath.Join(s.root, "blobs") + + filter, err := filters.ParseAll(fs...) + if err != nil { + return err + } + var alg digest.Algorithm return filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { if err != nil { @@ -286,7 +279,12 @@ func (s *store) Walk(ctx context.Context, fn content.WalkFunc, filters ...string return err } } - return fn(s.info(dgst, fi, labels)) + + info := s.info(dgst, fi, labels) + if !filter.Match(content.AdaptInfo(info)) { + return nil + } + return fn(info) }) } @@ -467,7 +465,6 @@ func (s *store) Writer(ctx context.Context, opts ...content.WriterOpt) (content. } var lockErr error for count := uint64(0); count < 10; count++ { - time.Sleep(time.Millisecond * time.Duration(rand.Intn(1< ./.empty-mod/ + github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2 + github.com/golang/protobuf => github.com/golang/protobuf v1.3.5 + // urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092 + github.com/urfave/cli => github.com/urfave/cli v1.22.1 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 + google.golang.org/grpc => google.golang.org/grpc v1.27.1 +) diff --git a/vendor/github.com/containerd/containerd/log/context.go b/vendor/github.com/containerd/containerd/log/context.go index 21599c4fd6..37b6a7d1c8 100644 --- a/vendor/github.com/containerd/containerd/log/context.go +++ b/vendor/github.com/containerd/containerd/log/context.go @@ -37,9 +37,17 @@ type ( loggerKey struct{} ) -// RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to -// ensure the formatted time is always the same number of characters. -const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" +const ( + // RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to + // ensure the formatted time is always the same number of characters. + RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" + + // TextFormat represents the text logging format + TextFormat = "text" + + // JSONFormat represents the JSON logging format + JSONFormat = "json" +) // WithLogger returns a new context with the provided logger. Use in // combination with logger.WithField(s) for great effect. diff --git a/vendor/github.com/containerd/containerd/sys/userns_linux.go b/vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go similarity index 98% rename from vendor/github.com/containerd/containerd/sys/userns_linux.go rename to vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go index 3cd1a22220..6656465efb 100644 --- a/vendor/github.com/containerd/containerd/sys/userns_linux.go +++ b/vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go @@ -14,7 +14,7 @@ limitations under the License. */ -package sys +package userns import ( "bufio" diff --git a/vendor/github.com/containerd/containerd/sys/userns_unsupported.go b/vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go similarity index 98% rename from vendor/github.com/containerd/containerd/sys/userns_unsupported.go rename to vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go index 549b50200c..aab756fd2a 100644 --- a/vendor/github.com/containerd/containerd/sys/userns_unsupported.go +++ b/vendor/github.com/containerd/containerd/pkg/userns/userns_unsupported.go @@ -16,7 +16,7 @@ limitations under the License. */ -package sys +package userns // RunningInUserNS is a stub for non-Linux systems // Always returns false diff --git a/vendor/github.com/containerd/containerd/platforms/compare.go b/vendor/github.com/containerd/containerd/platforms/compare.go index 3ad22a10d0..c7657e1869 100644 --- a/vendor/github.com/containerd/containerd/platforms/compare.go +++ b/vendor/github.com/containerd/containerd/platforms/compare.go @@ -16,7 +16,12 @@ package platforms -import specs "github.com/opencontainers/image-spec/specs-go/v1" +import ( + "strconv" + "strings" + + specs "github.com/opencontainers/image-spec/specs-go/v1" +) // MatchComparer is able to match and compare platforms to // filter and sort platforms. @@ -26,103 +31,70 @@ type MatchComparer interface { Less(specs.Platform, specs.Platform) bool } +// platformVector returns an (ordered) vector of appropriate specs.Platform +// objects to try matching for the given platform object (see platforms.Only). +func platformVector(platform specs.Platform) []specs.Platform { + vector := []specs.Platform{platform} + + switch platform.Architecture { + case "amd64": + vector = append(vector, specs.Platform{ + Architecture: "386", + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: platform.Variant, + }) + case "arm": + if armVersion, err := strconv.Atoi(strings.TrimPrefix(platform.Variant, "v")); err == nil && armVersion > 5 { + for armVersion--; armVersion >= 5; armVersion-- { + vector = append(vector, specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v" + strconv.Itoa(armVersion), + }) + } + } + case "arm64": + variant := platform.Variant + if variant == "" { + variant = "v8" + } + vector = append(vector, platformVector(specs.Platform{ + Architecture: "arm", + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: variant, + })...) + } + + return vector +} + // Only returns a match comparer for a single platform // using default resolution logic for the platform. // -// For ARMv8, will also match ARMv7, ARMv6 and ARMv5 (for 32bit runtimes) -// For ARMv7, will also match ARMv6 and ARMv5 -// For ARMv6, will also match ARMv5 +// For arm/v8, will also match arm/v7, arm/v6 and arm/v5 +// For arm/v7, will also match arm/v6 and arm/v5 +// For arm/v6, will also match arm/v5 +// For amd64, will also match 386 func Only(platform specs.Platform) MatchComparer { - platform = Normalize(platform) - if platform.Architecture == "arm" { - if platform.Variant == "v8" { - return orderedPlatformComparer{ - matchers: []Matcher{ - &matcher{ - Platform: platform, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v7", - }, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v6", - }, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v5", - }, - }, - }, - } - } - if platform.Variant == "v7" { - return orderedPlatformComparer{ - matchers: []Matcher{ - &matcher{ - Platform: platform, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v6", - }, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v5", - }, - }, - }, - } - } - if platform.Variant == "v6" { - return orderedPlatformComparer{ - matchers: []Matcher{ - &matcher{ - Platform: platform, - }, - &matcher{ - Platform: specs.Platform{ - Architecture: platform.Architecture, - OS: platform.OS, - OSVersion: platform.OSVersion, - OSFeatures: platform.OSFeatures, - Variant: "v5", - }, - }, - }, - } - } - } + return Ordered(platformVector(Normalize(platform))...) +} - return singlePlatformComparer{ - Matcher: &matcher{ - Platform: platform, - }, - } +// OnlyStrict returns a match comparer for a single platform. +// +// Unlike Only, OnlyStrict does not match sub platforms. +// So, "arm/vN" will not match "arm/vM" where M < N, +// and "amd64" will not also match "386". +// +// OnlyStrict matches non-canonical forms. +// So, "arm64" matches "arm/64/v8". +func OnlyStrict(platform specs.Platform) MatchComparer { + return Ordered(Normalize(platform)) } // Ordered returns a platform MatchComparer which matches any of the platforms @@ -153,14 +125,6 @@ func Any(platforms ...specs.Platform) MatchComparer { // with preference for ordering. var All MatchComparer = allPlatformComparer{} -type singlePlatformComparer struct { - Matcher -} - -func (c singlePlatformComparer) Less(p1, p2 specs.Platform) bool { - return c.Match(p1) && !c.Match(p2) -} - type orderedPlatformComparer struct { matchers []Matcher } diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go b/vendor/github.com/containerd/containerd/platforms/cpuinfo.go index 0512bc90e0..4a7177e313 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go +++ b/vendor/github.com/containerd/containerd/platforms/cpuinfo.go @@ -21,6 +21,7 @@ import ( "os" "runtime" "strings" + "sync" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" @@ -28,14 +29,18 @@ import ( ) // Present the ARM instruction set architecture, eg: v7, v8 -var cpuVariant string +// Don't use this value directly; call cpuVariant() instead. +var cpuVariantValue string -func init() { - if isArmArch(runtime.GOARCH) { - cpuVariant = getCPUVariant() - } else { - cpuVariant = "" - } +var cpuVariantOnce sync.Once + +func cpuVariant() string { + cpuVariantOnce.Do(func() { + if isArmArch(runtime.GOARCH) { + cpuVariantValue = getCPUVariant() + } + }) + return cpuVariantValue } // For Linux, the kernel has already detected the ABI, ISA and Features. @@ -107,12 +112,7 @@ func getCPUVariant() string { switch strings.ToLower(variant) { case "8", "aarch64": - // special case: if running a 32-bit userspace on aarch64, the variant should be "v7" - if runtime.GOARCH == "arm" { - variant = "v7" - } else { - variant = "v8" - } + variant = "v8" case "7", "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)": variant = "v7" case "6", "6tej": diff --git a/vendor/github.com/containerd/containerd/platforms/defaults.go b/vendor/github.com/containerd/containerd/platforms/defaults.go index a14d80e58c..cb77fbc9f7 100644 --- a/vendor/github.com/containerd/containerd/platforms/defaults.go +++ b/vendor/github.com/containerd/containerd/platforms/defaults.go @@ -33,6 +33,11 @@ func DefaultSpec() specs.Platform { OS: runtime.GOOS, Architecture: runtime.GOARCH, // The Variant field will be empty if arch != ARM. - Variant: cpuVariant, + Variant: cpuVariant(), } } + +// DefaultStrict returns strict form of Default. +func DefaultStrict() MatchComparer { + return OnlyStrict(DefaultSpec()) +} diff --git a/vendor/github.com/containerd/containerd/platforms/defaults_windows.go b/vendor/github.com/containerd/containerd/platforms/defaults_windows.go index 0defbd36c0..0c380e3b7c 100644 --- a/vendor/github.com/containerd/containerd/platforms/defaults_windows.go +++ b/vendor/github.com/containerd/containerd/platforms/defaults_windows.go @@ -19,13 +19,63 @@ package platforms import ( + "fmt" + "runtime" + "strconv" + "strings" + + imagespec "github.com/opencontainers/image-spec/specs-go/v1" specs "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sys/windows" ) -// Default returns the default matcher for the platform. -func Default() MatchComparer { - return Ordered(DefaultSpec(), specs.Platform{ - OS: "linux", - Architecture: "amd64", - }) +type matchComparer struct { + defaults Matcher + osVersionPrefix string +} + +// Match matches platform with the same windows major, minor +// and build version. +func (m matchComparer) Match(p imagespec.Platform) bool { + if m.defaults.Match(p) { + // TODO(windows): Figure out whether OSVersion is deprecated. + return strings.HasPrefix(p.OSVersion, m.osVersionPrefix) + } + return false +} + +// Less sorts matched platforms in front of other platforms. +// For matched platforms, it puts platforms with larger revision +// number in front. +func (m matchComparer) Less(p1, p2 imagespec.Platform) bool { + m1, m2 := m.Match(p1), m.Match(p2) + if m1 && m2 { + r1, r2 := revision(p1.OSVersion), revision(p2.OSVersion) + return r1 > r2 + } + return m1 && !m2 +} + +func revision(v string) int { + parts := strings.Split(v, ".") + if len(parts) < 4 { + return 0 + } + r, err := strconv.Atoi(parts[3]) + if err != nil { + return 0 + } + return r +} + +// Default returns the current platform's default platform specification. +func Default() MatchComparer { + major, minor, build := windows.RtlGetNtVersionNumbers() + return matchComparer{ + defaults: Ordered(DefaultSpec(), specs.Platform{ + OS: "linux", + Architecture: runtime.GOARCH, + }), + osVersionPrefix: fmt.Sprintf("%d.%d.%d", major, minor, build), + } } diff --git a/vendor/github.com/containerd/containerd/platforms/platforms.go b/vendor/github.com/containerd/containerd/platforms/platforms.go index 77d3f184ec..088bdea050 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms.go +++ b/vendor/github.com/containerd/containerd/platforms/platforms.go @@ -189,8 +189,8 @@ func Parse(specifier string) (specs.Platform, error) { if isKnownOS(p.OS) { // picks a default architecture p.Architecture = runtime.GOARCH - if p.Architecture == "arm" && cpuVariant != "v7" { - p.Variant = cpuVariant + if p.Architecture == "arm" && cpuVariant() != "v7" { + p.Variant = cpuVariant() } return p, nil diff --git a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go index f65c6be381..0d01c81ac5 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go @@ -65,7 +65,7 @@ func GenerateTokenOptions(ctx context.Context, host, username, secret string, c return to, nil } -// TokenOptions are optios for requesting a token +// TokenOptions are options for requesting a token type TokenOptions struct { Realm string Service string diff --git a/vendor/github.com/containerd/containerd/remotes/errors/errors.go b/vendor/github.com/containerd/containerd/remotes/errors/errors.go index e58e4afea8..519dbac105 100644 --- a/vendor/github.com/containerd/containerd/remotes/errors/errors.go +++ b/vendor/github.com/containerd/containerd/remotes/errors/errors.go @@ -27,9 +27,10 @@ var _ error = ErrUnexpectedStatus{} // ErrUnexpectedStatus is returned if a registry API request returned with unexpected HTTP status type ErrUnexpectedStatus struct { - Status string - StatusCode int - Body []byte + Status string + StatusCode int + Body []byte + RequestURL, RequestMethod string } func (e ErrUnexpectedStatus) Error() string { @@ -42,5 +43,14 @@ func NewUnexpectedStatusErr(resp *http.Response) error { if resp.Body != nil { b, _ = ioutil.ReadAll(io.LimitReader(resp.Body, 64000)) // 64KB } - return ErrUnexpectedStatus{Status: resp.Status, StatusCode: resp.StatusCode, Body: b} + err := ErrUnexpectedStatus{ + Body: b, + Status: resp.Status, + StatusCode: resp.StatusCode, + RequestMethod: resp.Request.Method, + } + if resp.Request.URL != nil { + err.RequestURL = resp.Request.URL.String() + } + return err } diff --git a/vendor/github.com/containerd/containerd/sys/filesys.go b/vendor/github.com/containerd/containerd/sys/filesys.go deleted file mode 100644 index 825d21d19a..0000000000 --- a/vendor/github.com/containerd/containerd/sys/filesys.go +++ /dev/null @@ -1,35 +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 sys - -import "os" - -// IsFifo checks if a file is a (named pipe) fifo -// if the file does not exist then it returns false -func IsFifo(path string) (bool, error) { - stat, err := os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - if stat.Mode()&os.ModeNamedPipe == os.ModeNamedPipe { - return true, nil - } - return false, nil -} diff --git a/vendor/github.com/containerd/containerd/sys/filesys_windows.go b/vendor/github.com/containerd/containerd/sys/filesys_windows.go index 2eaee2ca29..a9198ef399 100644 --- a/vendor/github.com/containerd/containerd/sys/filesys_windows.go +++ b/vendor/github.com/containerd/containerd/sys/filesys_windows.go @@ -22,11 +22,14 @@ import ( "os" "path/filepath" "regexp" + "sort" + "strconv" "strings" "syscall" "unsafe" "github.com/Microsoft/hcsshim" + "github.com/pkg/errors" "golang.org/x/sys/windows" ) @@ -257,12 +260,71 @@ func windowsOpenSequential(path string, mode int, _ uint32) (fd windows.Handle, return h, e } -// ForceRemoveAll is the same as os.RemoveAll, but uses hcsshim.DestroyLayer in order -// to delete container layers. +// ForceRemoveAll is the same as os.RemoveAll, but is aware of io.containerd.snapshotter.v1.windows +// and uses hcsshim to unmount and delete container layers contained therein, in the correct order, +// when passed a containerd root data directory (i.e. the `--root` directory for containerd). func ForceRemoveAll(path string) error { - info := hcsshim.DriverInfo{ - HomeDir: filepath.Dir(path), + // snapshots/windows/windows.go init() + const snapshotPlugin = "io.containerd.snapshotter.v1" + "." + "windows" + // snapshots/windows/windows.go NewSnapshotter() + snapshotDir := filepath.Join(path, snapshotPlugin, "snapshots") + if stat, err := os.Stat(snapshotDir); err == nil && stat.IsDir() { + if err := cleanupWCOWLayers(snapshotDir); err != nil { + return errors.Wrapf(err, "failed to cleanup WCOW layers in %s", snapshotDir) + } } - return hcsshim.DestroyLayer(info, filepath.Base(path)) + return os.RemoveAll(path) +} + +func cleanupWCOWLayers(root string) error { + // See snapshots/windows/windows.go getSnapshotDir() + var layerNums []int + if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if path != root && info.IsDir() { + if layerNum, err := strconv.Atoi(filepath.Base(path)); err == nil { + layerNums = append(layerNums, layerNum) + } else { + return err + } + return filepath.SkipDir + } + + return nil + }); err != nil { + return err + } + + sort.Sort(sort.Reverse(sort.IntSlice(layerNums))) + + for _, layerNum := range layerNums { + if err := cleanupWCOWLayer(filepath.Join(root, strconv.Itoa(layerNum))); err != nil { + return err + } + } + + return nil +} + +func cleanupWCOWLayer(layerPath string) error { + info := hcsshim.DriverInfo{ + HomeDir: filepath.Dir(layerPath), + } + + // ERROR_DEV_NOT_EXIST is returned if the layer is not currently prepared. + if err := hcsshim.UnprepareLayer(info, filepath.Base(layerPath)); err != nil { + if hcserror, ok := err.(*hcsshim.HcsError); !ok || hcserror.Err != windows.ERROR_DEV_NOT_EXIST { + return errors.Wrapf(err, "failed to unprepare %s", layerPath) + } + } + + if err := hcsshim.DeactivateLayer(info, filepath.Base(layerPath)); err != nil { + return errors.Wrapf(err, "failed to deactivate %s", layerPath) + } + + if err := hcsshim.DestroyLayer(info, filepath.Base(layerPath)); err != nil { + return errors.Wrapf(err, "failed to destroy %s", layerPath) + } + + return nil } diff --git a/vendor/github.com/containerd/containerd/sys/oom_linux.go b/vendor/github.com/containerd/containerd/sys/oom_linux.go new file mode 100644 index 0000000000..82a347c6f7 --- /dev/null +++ b/vendor/github.com/containerd/containerd/sys/oom_linux.go @@ -0,0 +1,83 @@ +/* + 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 sys + +import ( + "fmt" + "io/ioutil" + "os" + "strconv" + "strings" + + "github.com/containerd/containerd/pkg/userns" + "golang.org/x/sys/unix" +) + +const ( + // OOMScoreAdjMin is from OOM_SCORE_ADJ_MIN https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L9 + OOMScoreAdjMin = -1000 + // OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L10 + OOMScoreAdjMax = 1000 +) + +// AdjustOOMScore sets the oom score for the provided pid. If the provided score +// is out of range (-1000 - 1000), it is clipped to the min/max value. +func AdjustOOMScore(pid, score int) error { + if score > OOMScoreAdjMax { + score = OOMScoreAdjMax + } else if score < OOMScoreAdjMin { + score = OOMScoreAdjMin + } + return SetOOMScore(pid, score) +} + +// SetOOMScore sets the oom score for the provided pid +func SetOOMScore(pid, score int) error { + if score > OOMScoreAdjMax || score < OOMScoreAdjMin { + return fmt.Errorf("value out of range (%d): OOM score must be between %d and %d", score, OOMScoreAdjMin, OOMScoreAdjMax) + } + path := fmt.Sprintf("/proc/%d/oom_score_adj", pid) + f, err := os.OpenFile(path, os.O_WRONLY, 0) + if err != nil { + return err + } + defer f.Close() + if _, err = f.WriteString(strconv.Itoa(score)); err != nil { + if os.IsPermission(err) && (!runningPrivileged() || userns.RunningInUserNS()) { + return nil + } + return err + } + return nil +} + +// GetOOMScoreAdj gets the oom score for a process. It returns 0 (zero) if either +// no oom score is set, or a sore is set to 0. +func GetOOMScoreAdj(pid int) (int, error) { + path := fmt.Sprintf("/proc/%d/oom_score_adj", pid) + data, err := ioutil.ReadFile(path) + if err != nil { + return 0, err + } + return strconv.Atoi(strings.TrimSpace(string(data))) +} + +// runningPrivileged returns true if the effective user ID of the +// calling process is 0 +func runningPrivileged() bool { + return unix.Geteuid() == 0 +} diff --git a/vendor/github.com/containerd/containerd/sys/oom_unix.go b/vendor/github.com/containerd/containerd/sys/oom_unsupported.go similarity index 50% rename from vendor/github.com/containerd/containerd/sys/oom_unix.go rename to vendor/github.com/containerd/containerd/sys/oom_unsupported.go index d49d5bc8dd..f5d7e9786b 100644 --- a/vendor/github.com/containerd/containerd/sys/oom_unix.go +++ b/vendor/github.com/containerd/containerd/sys/oom_unsupported.go @@ -1,4 +1,4 @@ -// +build !windows +// +build !linux /* Copyright The containerd Authors. @@ -18,40 +18,31 @@ package sys -import ( - "fmt" - "io/ioutil" - "os" - "strconv" - "strings" +const ( + // OOMScoreMaxKillable is not implemented on non Linux + OOMScoreMaxKillable = 0 + // OOMScoreAdjMax is not implemented on non Linux + OOMScoreAdjMax = 0 ) -// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer -const OOMScoreMaxKillable = -999 +// AdjustOOMScore sets the oom score for the provided pid. If the provided score +// is out of range (-1000 - 1000), it is clipped to the min/max value. +// +// Not implemented on Windows +func AdjustOOMScore(pid, score int) error { + return nil +} -// SetOOMScore sets the oom score for the provided pid +// SetOOMScore sets the oom score for the process +// +// Not implemented on Windows func SetOOMScore(pid, score int) error { - path := fmt.Sprintf("/proc/%d/oom_score_adj", pid) - f, err := os.OpenFile(path, os.O_WRONLY, 0) - if err != nil { - return err - } - defer f.Close() - if _, err = f.WriteString(strconv.Itoa(score)); err != nil { - if os.IsPermission(err) && (RunningInUserNS() || RunningUnprivileged()) { - return nil - } - return err - } return nil } // GetOOMScoreAdj gets the oom score for a process +// +// Not implemented on Windows func GetOOMScoreAdj(pid int) (int, error) { - path := fmt.Sprintf("/proc/%d/oom_score_adj", pid) - data, err := ioutil.ReadFile(path) - if err != nil { - return 0, err - } - return strconv.Atoi(strings.TrimSpace(string(data))) + return 0, nil } diff --git a/vendor/github.com/containerd/containerd/sys/env.go b/vendor/github.com/containerd/containerd/sys/stat_openbsd.go similarity index 50% rename from vendor/github.com/containerd/containerd/sys/env.go rename to vendor/github.com/containerd/containerd/sys/stat_openbsd.go index 8450d62758..ec3b9df69a 100644 --- a/vendor/github.com/containerd/containerd/sys/env.go +++ b/vendor/github.com/containerd/containerd/sys/stat_openbsd.go @@ -1,4 +1,4 @@ -// +build !windows +// +build openbsd /* Copyright The containerd Authors. @@ -18,16 +18,28 @@ package sys -import "golang.org/x/sys/unix" +import ( + "syscall" + "time" +) -// RunningPrivileged returns true if the effective user ID of the -// calling process is 0 -func RunningPrivileged() bool { - return unix.Geteuid() == 0 +// StatAtime returns the Atim +func StatAtime(st *syscall.Stat_t) syscall.Timespec { + return st.Atim } -// RunningUnprivileged returns true if the effective user ID of the -// calling process is not 0 -func RunningUnprivileged() bool { - return !RunningPrivileged() +// StatCtime returns the Ctim +func StatCtime(st *syscall.Stat_t) syscall.Timespec { + return st.Ctim +} + +// StatMtime returns the Mtim +func StatMtime(st *syscall.Stat_t) syscall.Timespec { + return st.Mtim +} + +// StatATimeAsTime returns st.Atim as a time.Time +func StatATimeAsTime(st *syscall.Stat_t) time.Time { + // The int64 conversions ensure the line compiles for 32-bit systems as well. + return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert } diff --git a/vendor/github.com/containerd/containerd/sys/oom_windows.go b/vendor/github.com/containerd/containerd/sys/userns_deprecated.go similarity index 68% rename from vendor/github.com/containerd/containerd/sys/oom_windows.go rename to vendor/github.com/containerd/containerd/sys/userns_deprecated.go index a917ba635b..53acf55477 100644 --- a/vendor/github.com/containerd/containerd/sys/oom_windows.go +++ b/vendor/github.com/containerd/containerd/sys/userns_deprecated.go @@ -16,16 +16,8 @@ package sys -// SetOOMScore sets the oom score for the process -// -// Not implemented on Windows -func SetOOMScore(pid, score int) error { - return nil -} +import "github.com/containerd/containerd/pkg/userns" -// GetOOMScoreAdj gets the oom score for a process -// -// Not implemented on Windows -func GetOOMScoreAdj(pid int) (int, error) { - return 0, nil -} +// RunningInUserNS detects whether we are currently running in a user namespace. +// Deprecated: use github.com/containerd/containerd/pkg/userns.RunningInUserNS instead. +var RunningInUserNS = userns.RunningInUserNS diff --git a/vendor/github.com/containerd/containerd/vendor.conf b/vendor/github.com/containerd/containerd/vendor.conf deleted file mode 100644 index 79f6f2a188..0000000000 --- a/vendor/github.com/containerd/containerd/vendor.conf +++ /dev/null @@ -1,107 +0,0 @@ -github.com/beorn7/perks v1.0.1 -github.com/BurntSushi/toml v0.3.1 -github.com/cespare/xxhash/v2 v2.1.1 -github.com/containerd/btrfs 404b9149801e455c8076f615b06dc0abee0a977a -github.com/containerd/cgroups 0b889c03f102012f1d93a97ddd3ef71cd6f4f510 -github.com/containerd/console v1.0.1 -github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165 -github.com/containerd/fifo 0724c46b320cf96bb172a0550c19a4b1fca4dacb -github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c -github.com/containerd/nri eb1350a75164f76de48e3605389e7a3fbc85d06e -github.com/containerd/ttrpc v1.0.2 -github.com/containerd/typeurl v1.0.1 -github.com/coreos/go-systemd/v22 v22.1.0 -github.com/cpuguy83/go-md2man/v2 v2.0.0 -github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f -github.com/docker/go-metrics v0.0.1 -github.com/docker/go-units v0.4.0 -github.com/godbus/dbus/v5 v5.0.3 -github.com/gogo/googleapis v1.3.2 -github.com/gogo/protobuf v1.3.1 -github.com/golang/protobuf v1.3.5 -github.com/google/go-cmp v0.2.0 -github.com/google/uuid v1.1.1 -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 -github.com/hashicorp/errwrap v1.0.0 -github.com/hashicorp/go-multierror v1.0.0 -github.com/hashicorp/golang-lru v0.5.3 -github.com/imdario/mergo v0.3.7 -github.com/matttproud/golang_protobuf_extensions v1.0.1 -github.com/Microsoft/go-winio v0.4.14 -github.com/Microsoft/hcsshim v0.8.10 -github.com/moby/sys symlink/v0.1.0 -github.com/opencontainers/go-digest v1.0.0 -github.com/opencontainers/image-spec v1.0.1 -github.com/opencontainers/runc v1.0.0-rc92 -github.com/opencontainers/runtime-spec 4d89ac9fbff6c455f46a5bb59c6b1bb7184a5e43 # v1.0.3-0.20200728170252-4d89ac9fbff6 -github.com/pkg/errors v0.9.1 -github.com/prometheus/client_golang v1.6.0 -github.com/prometheus/client_model v0.2.0 -github.com/prometheus/common v0.9.1 -github.com/prometheus/procfs v0.0.11 -github.com/russross/blackfriday/v2 v2.0.1 -github.com/shurcooL/sanitized_anchor_name v1.0.0 -github.com/sirupsen/logrus v1.7.0 -github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2 -github.com/urfave/cli v1.22.1 # NOTE: urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092 -go.etcd.io/bbolt v1.3.5 -go.opencensus.io v0.22.0 -golang.org/x/net ab34263943818b32f575efc978a3d24e80b04bd7 -golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e -golang.org/x/sys 0aaa2718063a42560507fce2cc04508608ca23b3 -golang.org/x/text v0.3.3 -google.golang.org/genproto e50cd9704f63023d62cd06a1994b98227fc4d21a -google.golang.org/grpc v1.27.1 -gotest.tools/v3 v3.0.2 - -# cgroups dependencies -github.com/cilium/ebpf 1c8d4c9ef7759622653a1d319284a44652333b28 - -# cri dependencies -github.com/davecgh/go-spew v1.1.1 -github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528 -github.com/emicklei/go-restful v2.9.5 -github.com/go-logr/logr v0.2.0 -github.com/google/gofuzz v1.1.0 -github.com/json-iterator/go v1.1.10 -github.com/modern-go/concurrent 1.0.3 -github.com/modern-go/reflect2 v1.0.1 -github.com/opencontainers/selinux v1.6.0 -github.com/pmezard/go-difflib v1.0.0 -github.com/stretchr/testify v1.4.0 -github.com/tchap/go-patricia v2.2.6 -github.com/willf/bitset v1.1.11 -golang.org/x/crypto 75b288015ac94e66e3d6715fb68a9b41bf046ec2 -golang.org/x/oauth2 858c2ad4c8b6c5d10852cb89079f6ca1c7309787 -golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 -gopkg.in/inf.v0 v0.9.1 -gopkg.in/yaml.v2 v2.2.8 -k8s.io/api v0.19.4 -k8s.io/apimachinery v0.19.4 -k8s.io/apiserver v0.19.4 -k8s.io/client-go v0.19.4 -k8s.io/component-base v0.19.4 -k8s.io/cri-api v0.19.4 -k8s.io/klog/v2 v2.2.0 -k8s.io/utils d5654de09c73da55eb19ae4ab4f734f7a61747a6 -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 -sigs.k8s.io/yaml v1.2.0 - -# cni dependencies -github.com/containerd/go-cni v1.0.1 -github.com/containernetworking/cni v0.8.0 -github.com/containernetworking/plugins v0.8.6 -github.com/fsnotify/fsnotify v1.4.9 - -# image decrypt depedencies -github.com/containerd/imgcrypt v1.0.1 -github.com/containers/ocicrypt v1.0.1 -github.com/fullsailor/pkcs7 8306686428a5fe132eac8cb7c4848af725098bd4 -gopkg.in/square/go-jose.v2 v2.3.1 - -# zfs dependencies -github.com/containerd/zfs 0a33824f23a2ab8ec84166f47b571ecb793b0354 -github.com/mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb - -# aufs dependencies -github.com/containerd/aufs dab0cbea06f43329c07667afe1a70411ad555a86 From 29fed6bff11d38a3c47a079c90006e96befbd925 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 21 Jun 2021 17:11:02 +0200 Subject: [PATCH 2/4] vendor: github.com/docker/swarmkit 2dcf70aafdc9ea55af3aaaeca440638cde0ecda6 full diff: https://github.com/docker/swarmkit/compare/17d8d4e4d8bdec33d386e6362d3537fa9493ba00...2dcf70aafdc9ea55af3aaaeca440638cde0ecda6 Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- .../github.com/docker/swarmkit/api/ca.pb.go | 372 +- .../docker/swarmkit/api/control.pb.go | 4095 +++++++++------- .../docker/swarmkit/api/dispatcher.pb.go | 852 ++-- .../docker/swarmkit/api/health.pb.go | 129 +- .../docker/swarmkit/api/logbroker.pb.go | 702 +-- .../docker/swarmkit/api/objects.pb.go | 1750 ++++--- .../github.com/docker/swarmkit/api/raft.pb.go | 988 ++-- .../docker/swarmkit/api/resource.pb.go | 200 +- .../docker/swarmkit/api/snapshot.pb.go | 484 +- .../docker/swarmkit/api/specs.pb.go | 2423 +++++---- .../docker/swarmkit/api/types.pb.go | 4356 +++++++++-------- .../docker/swarmkit/api/watch.pb.go | 1512 +++--- .../swarmkit/protobuf/plugin/plugin.pb.go | 422 +- vendor/github.com/docker/swarmkit/vendor.conf | 117 +- 15 files changed, 9249 insertions(+), 9155 deletions(-) diff --git a/vendor.conf b/vendor.conf index 9937745fe5..6922c49e54 100755 --- a/vendor.conf +++ b/vendor.conf @@ -20,7 +20,7 @@ github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79 github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 -github.com/docker/swarmkit 17d8d4e4d8bdec33d386e6362d3537fa9493ba00 +github.com/docker/swarmkit 2dcf70aafdc9ea55af3aaaeca440638cde0ecda6 # master github.com/evanphx/json-patch 72bf35d0ff611848c1dc9df0f976c81192392fa5 # v4.1.0 github.com/fvbommel/sortorder 26fad50c6b32a3064c09ed089865c16f2f3615f6 # v1.0.2 github.com/gofrs/flock 6caa7350c26b838538005fae7dbee4e69d9398db # v0.7.3 diff --git a/vendor/github.com/docker/swarmkit/api/ca.pb.go b/vendor/github.com/docker/swarmkit/api/ca.pb.go index d5a7fd9f4d..e37dbc97a2 100644 --- a/vendor/github.com/docker/swarmkit/api/ca.pb.go +++ b/vendor/github.com/docker/swarmkit/api/ca.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,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 NodeCertificateStatusRequest struct { NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` @@ -51,7 +52,7 @@ func (m *NodeCertificateStatusRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_NodeCertificateStatusRequest.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 } @@ -88,7 +89,7 @@ func (m *NodeCertificateStatusResponse) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_NodeCertificateStatusResponse.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 } @@ -132,7 +133,7 @@ func (m *IssueNodeCertificateRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_IssueNodeCertificateRequest.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 } @@ -169,7 +170,7 @@ func (m *IssueNodeCertificateResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_IssueNodeCertificateResponse.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 } @@ -204,7 +205,7 @@ func (m *GetRootCACertificateRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetRootCACertificateRequest.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 } @@ -240,7 +241,7 @@ func (m *GetRootCACertificateResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetRootCACertificateResponse.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 } @@ -275,7 +276,7 @@ func (m *GetUnlockKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetUnlockKeyRequest.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 } @@ -312,7 +313,7 @@ func (m *GetUnlockKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetUnlockKeyResponse.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 } @@ -621,6 +622,17 @@ type CAServer interface { GetUnlockKey(context.Context, *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) } +// UnimplementedCAServer can be embedded to have forward compatible implementations. +type UnimplementedCAServer struct { +} + +func (*UnimplementedCAServer) GetRootCACertificate(ctx context.Context, req *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRootCACertificate not implemented") +} +func (*UnimplementedCAServer) GetUnlockKey(ctx context.Context, req *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUnlockKey not implemented") +} + func RegisterCAServer(s *grpc.Server, srv CAServer) { s.RegisterService(&_CA_serviceDesc, srv) } @@ -718,6 +730,17 @@ type NodeCAServer interface { NodeCertificateStatus(context.Context, *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) } +// UnimplementedNodeCAServer can be embedded to have forward compatible implementations. +type UnimplementedNodeCAServer struct { +} + +func (*UnimplementedNodeCAServer) IssueNodeCertificate(ctx context.Context, req *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IssueNodeCertificate not implemented") +} +func (*UnimplementedNodeCAServer) NodeCertificateStatus(ctx context.Context, req *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeCertificateStatus not implemented") +} + func RegisterNodeCAServer(s *grpc.Server, srv NodeCAServer) { s.RegisterService(&_NodeCA_serviceDesc, srv) } @@ -778,7 +801,7 @@ var _NodeCA_serviceDesc = grpc.ServiceDesc{ func (m *NodeCertificateStatusRequest) 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 } @@ -786,23 +809,29 @@ func (m *NodeCertificateStatusRequest) Marshal() (dAtA []byte, err error) { } func (m *NodeCertificateStatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeCertificateStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NodeCertificateStatusResponse) 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 } @@ -810,37 +839,46 @@ func (m *NodeCertificateStatusResponse) Marshal() (dAtA []byte, err error) { } func (m *NodeCertificateStatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeCertificateStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Status != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Status.Size())) - n1, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if m.Certificate != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Certificate.Size())) - n2, err := m.Certificate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IssueNodeCertificateRequest) 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 } @@ -848,39 +886,46 @@ func (m *IssueNodeCertificateRequest) Marshal() (dAtA []byte, err error) { } func (m *IssueNodeCertificateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssueNodeCertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Role)) - } - if len(m.CSR) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.CSR))) - i += copy(dAtA[i:], m.CSR) + if m.Availability != 0 { + i = encodeVarintCa(dAtA, i, uint64(m.Availability)) + i-- + dAtA[i] = 0x20 } if len(m.Token) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Token) + copy(dAtA[i:], m.Token) i = encodeVarintCa(dAtA, i, uint64(len(m.Token))) - i += copy(dAtA[i:], m.Token) + i-- + dAtA[i] = 0x1a } - if m.Availability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Availability)) + if len(m.CSR) > 0 { + i -= len(m.CSR) + copy(dAtA[i:], m.CSR) + i = encodeVarintCa(dAtA, i, uint64(len(m.CSR))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Role != 0 { + i = encodeVarintCa(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *IssueNodeCertificateResponse) 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 } @@ -888,28 +933,34 @@ func (m *IssueNodeCertificateResponse) Marshal() (dAtA []byte, err error) { } func (m *IssueNodeCertificateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssueNodeCertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if m.NodeMembership != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintCa(dAtA, i, uint64(m.NodeMembership)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetRootCACertificateRequest) 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 } @@ -917,17 +968,22 @@ func (m *GetRootCACertificateRequest) Marshal() (dAtA []byte, err error) { } func (m *GetRootCACertificateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetRootCACertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetRootCACertificateResponse) 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 } @@ -935,23 +991,29 @@ func (m *GetRootCACertificateResponse) Marshal() (dAtA []byte, err error) { } func (m *GetRootCACertificateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetRootCACertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Certificate) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Certificate) + copy(dAtA[i:], m.Certificate) i = encodeVarintCa(dAtA, i, uint64(len(m.Certificate))) - i += copy(dAtA[i:], m.Certificate) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetUnlockKeyRequest) 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 } @@ -959,17 +1021,22 @@ func (m *GetUnlockKeyRequest) Marshal() (dAtA []byte, err error) { } func (m *GetUnlockKeyRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUnlockKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetUnlockKeyResponse) 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 } @@ -977,35 +1044,45 @@ func (m *GetUnlockKeyResponse) Marshal() (dAtA []byte, err error) { } func (m *GetUnlockKeyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUnlockKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.UnlockKey) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey))) - i += copy(dAtA[i:], m.UnlockKey) + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Version.Size())) - n3, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.UnlockKey) > 0 { + i -= len(m.UnlockKey) + copy(dAtA[i:], m.UnlockKey) + i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey))) + i-- + dAtA[i] = 0xa } - i += n3 - return i, nil + return len(dAtA) - i, nil } func encodeVarintCa(dAtA []byte, offset int, v uint64) int { + offset -= sovCa(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 } type raftProxyCAServer struct { @@ -1408,14 +1485,7 @@ func (m *GetUnlockKeyResponse) Size() (n int) { } func sovCa(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCa(x uint64) (n int) { return sovCa(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1499,7 +1569,7 @@ func (this *GetUnlockKeyResponse) String() string { } s := strings.Join([]string{`&GetUnlockKeyResponse{`, `UnlockKey:` + fmt.Sprintf("%v", this.UnlockKey) + `,`, - `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`, + `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1579,10 +1649,7 @@ func (m *NodeCertificateStatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1704,10 +1771,7 @@ func (m *NodeCertificateStatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1861,10 +1925,7 @@ func (m *IssueNodeCertificateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1965,10 +2026,7 @@ func (m *IssueNodeCertificateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2018,10 +2076,7 @@ func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2105,10 +2160,7 @@ func (m *GetRootCACertificateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2158,10 +2210,7 @@ func (m *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2278,10 +2327,7 @@ func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2299,6 +2345,7 @@ func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error { func skipCa(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 { @@ -2330,10 +2377,8 @@ func skipCa(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 { @@ -2354,55 +2399,30 @@ func skipCa(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthCa } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCa - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCa - } - 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 := skipCa(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCa - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCa + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthCa + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCa = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCa = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCa = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/control.pb.go b/vendor/github.com/docker/swarmkit/api/control.pb.go index 8c106ff16b..9268b44c2b 100644 --- a/vendor/github.com/docker/swarmkit/api/control.pb.go +++ b/vendor/github.com/docker/swarmkit/api/control.pb.go @@ -20,6 +20,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -34,7 +35,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 UpdateServiceRequest_Rollback int32 @@ -82,7 +83,7 @@ func (m *GetNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_GetNodeRequest.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 } @@ -118,7 +119,7 @@ func (m *GetNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetNodeResponse.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 } @@ -154,7 +155,7 @@ func (m *ListNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ListNodesRequest.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 } @@ -200,7 +201,7 @@ func (m *ListNodesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ListNodesRequest_Filters.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 } @@ -236,7 +237,7 @@ func (m *ListNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ListNodesResponse.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 } @@ -277,7 +278,7 @@ func (m *UpdateNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_UpdateNodeRequest.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 } @@ -313,7 +314,7 @@ func (m *UpdateNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateNodeResponse.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 } @@ -351,7 +352,7 @@ func (m *RemoveNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RemoveNodeRequest.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 } @@ -386,7 +387,7 @@ func (m *RemoveNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveNodeResponse.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 } @@ -422,7 +423,7 @@ func (m *GetTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_GetTaskRequest.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 } @@ -458,7 +459,7 @@ func (m *GetTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTaskResponse.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 } @@ -494,7 +495,7 @@ func (m *RemoveTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RemoveTaskRequest.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 } @@ -529,7 +530,7 @@ func (m *RemoveTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveTaskResponse.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 } @@ -565,7 +566,7 @@ func (m *ListTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ListTasksRequest.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 } @@ -614,7 +615,7 @@ func (m *ListTasksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ListTasksRequest_Filters.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 } @@ -650,7 +651,7 @@ func (m *ListTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ListTasksResponse.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 } @@ -686,7 +687,7 @@ func (m *CreateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateServiceRequest.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 } @@ -722,7 +723,7 @@ func (m *CreateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateServiceResponse.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 } @@ -759,7 +760,7 @@ func (m *GetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetServiceRequest.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 } @@ -795,7 +796,7 @@ func (m *GetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServiceResponse.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 } @@ -837,7 +838,7 @@ func (m *UpdateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateServiceRequest.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 } @@ -873,7 +874,7 @@ func (m *UpdateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateServiceResponse.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 } @@ -909,7 +910,7 @@ func (m *RemoveServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveServiceRequest.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 } @@ -944,7 +945,7 @@ func (m *RemoveServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveServiceResponse.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 } @@ -980,7 +981,7 @@ func (m *ListServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListServicesRequest.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 } @@ -1021,7 +1022,7 @@ func (m *ListServicesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListServicesRequest_Filters.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 } @@ -1057,7 +1058,7 @@ func (m *ListServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListServicesResponse.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 } @@ -1097,7 +1098,7 @@ func (m *ListServiceStatusesRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListServiceStatusesRequest.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 } @@ -1137,7 +1138,7 @@ func (m *ListServiceStatusesResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListServiceStatusesResponse.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 } @@ -1190,7 +1191,7 @@ func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Marshal(b []byte, determ return xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus.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 } @@ -1226,7 +1227,7 @@ func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateNetworkRequest.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 } @@ -1262,7 +1263,7 @@ func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateNetworkResponse.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 } @@ -1299,7 +1300,7 @@ func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetNetworkRequest.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 } @@ -1335,7 +1336,7 @@ func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworkResponse.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 } @@ -1372,7 +1373,7 @@ func (m *RemoveNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveNetworkRequest.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 } @@ -1407,7 +1408,7 @@ func (m *RemoveNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveNetworkResponse.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 } @@ -1443,7 +1444,7 @@ func (m *ListNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListNetworksRequest.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 } @@ -1483,7 +1484,7 @@ func (m *ListNetworksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListNetworksRequest_Filters.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 } @@ -1519,7 +1520,7 @@ func (m *ListNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListNetworksResponse.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 } @@ -1555,7 +1556,7 @@ func (m *GetClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetClusterRequest.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 } @@ -1591,7 +1592,7 @@ func (m *GetClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetClusterResponse.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 } @@ -1627,7 +1628,7 @@ func (m *ListClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListClustersRequest.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 } @@ -1667,7 +1668,7 @@ func (m *ListClustersRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListClustersRequest_Filters.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 } @@ -1703,7 +1704,7 @@ func (m *ListClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListClustersResponse.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 } @@ -1745,7 +1746,7 @@ func (m *KeyRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_KeyRotation.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 } @@ -1788,7 +1789,7 @@ func (m *UpdateClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateClusterRequest.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 } @@ -1824,7 +1825,7 @@ func (m *UpdateClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateClusterResponse.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 } @@ -1861,7 +1862,7 @@ 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 } @@ -1900,7 +1901,7 @@ 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 } @@ -1942,7 +1943,7 @@ func (m *UpdateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateSecretRequest.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 } @@ -1978,7 +1979,7 @@ func (m *UpdateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateSecretResponse.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 } @@ -2016,7 +2017,7 @@ func (m *ListSecretsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListSecretsRequest.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 } @@ -2055,7 +2056,7 @@ func (m *ListSecretsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListSecretsRequest_Filters.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 } @@ -2095,7 +2096,7 @@ func (m *ListSecretsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListSecretsResponse.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 } @@ -2133,7 +2134,7 @@ func (m *CreateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CreateSecretRequest.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 } @@ -2172,7 +2173,7 @@ func (m *CreateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateSecretResponse.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 } @@ -2210,7 +2211,7 @@ func (m *RemoveSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveSecretRequest.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 } @@ -2247,7 +2248,7 @@ func (m *RemoveSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveSecretResponse.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 } @@ -2284,7 +2285,7 @@ func (m *GetConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_GetConfigRequest.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 } @@ -2322,7 +2323,7 @@ func (m *GetConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetConfigResponse.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 } @@ -2364,7 +2365,7 @@ func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateConfigRequest.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 } @@ -2400,7 +2401,7 @@ func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateConfigResponse.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 } @@ -2438,7 +2439,7 @@ func (m *ListConfigsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListConfigsRequest.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 } @@ -2477,7 +2478,7 @@ func (m *ListConfigsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListConfigsRequest_Filters.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 } @@ -2515,7 +2516,7 @@ func (m *ListConfigsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListConfigsResponse.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 } @@ -2553,7 +2554,7 @@ func (m *CreateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CreateConfigRequest.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 } @@ -2591,7 +2592,7 @@ func (m *CreateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateConfigResponse.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 } @@ -2629,7 +2630,7 @@ func (m *RemoveConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveConfigRequest.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 } @@ -2666,7 +2667,7 @@ func (m *RemoveConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveConfigResponse.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 } @@ -2705,7 +2706,7 @@ func (m *CreateExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateExtensionRequest.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 } @@ -2743,7 +2744,7 @@ func (m *CreateExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_CreateExtensionResponse.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 } @@ -2781,7 +2782,7 @@ func (m *RemoveExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_RemoveExtensionRequest.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 } @@ -2818,7 +2819,7 @@ func (m *RemoveExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_RemoveExtensionResponse.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 } @@ -2855,7 +2856,7 @@ func (m *GetExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetExtensionRequest.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 } @@ -2893,7 +2894,7 @@ func (m *GetExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetExtensionResponse.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 } @@ -2933,7 +2934,7 @@ func (m *CreateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateResourceRequest.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 } @@ -2971,7 +2972,7 @@ func (m *CreateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateResourceResponse.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 } @@ -3009,7 +3010,7 @@ func (m *RemoveResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveResourceRequest.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 } @@ -3046,7 +3047,7 @@ func (m *RemoveResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_RemoveResourceResponse.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 } @@ -3091,7 +3092,7 @@ func (m *UpdateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateResourceRequest.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 } @@ -3127,7 +3128,7 @@ func (m *UpdateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_UpdateResourceResponse.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 } @@ -3164,7 +3165,7 @@ func (m *GetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetResourceRequest.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 } @@ -3202,7 +3203,7 @@ func (m *GetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetResourceResponse.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 } @@ -3240,7 +3241,7 @@ func (m *ListResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListResourcesRequest.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 } @@ -3280,7 +3281,7 @@ func (m *ListResourcesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListResourcesRequest_Filters.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 } @@ -3318,7 +3319,7 @@ func (m *ListResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ListResourcesResponse.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 } @@ -6304,6 +6305,125 @@ type ControlServer interface { RemoveResource(context.Context, *RemoveResourceRequest) (*RemoveResourceResponse, error) } +// UnimplementedControlServer can be embedded to have forward compatible implementations. +type UnimplementedControlServer struct { +} + +func (*UnimplementedControlServer) GetNode(ctx context.Context, req *GetNodeRequest) (*GetNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") +} +func (*UnimplementedControlServer) ListNodes(ctx context.Context, req *ListNodesRequest) (*ListNodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNodes not implemented") +} +func (*UnimplementedControlServer) UpdateNode(ctx context.Context, req *UpdateNodeRequest) (*UpdateNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented") +} +func (*UnimplementedControlServer) RemoveNode(ctx context.Context, req *RemoveNodeRequest) (*RemoveNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveNode not implemented") +} +func (*UnimplementedControlServer) GetTask(ctx context.Context, req *GetTaskRequest) (*GetTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented") +} +func (*UnimplementedControlServer) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTasks not implemented") +} +func (*UnimplementedControlServer) RemoveTask(ctx context.Context, req *RemoveTaskRequest) (*RemoveTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveTask not implemented") +} +func (*UnimplementedControlServer) GetService(ctx context.Context, req *GetServiceRequest) (*GetServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") +} +func (*UnimplementedControlServer) ListServices(ctx context.Context, req *ListServicesRequest) (*ListServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") +} +func (*UnimplementedControlServer) CreateService(ctx context.Context, req *CreateServiceRequest) (*CreateServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") +} +func (*UnimplementedControlServer) UpdateService(ctx context.Context, req *UpdateServiceRequest) (*UpdateServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") +} +func (*UnimplementedControlServer) RemoveService(ctx context.Context, req *RemoveServiceRequest) (*RemoveServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented") +} +func (*UnimplementedControlServer) ListServiceStatuses(ctx context.Context, req *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServiceStatuses not implemented") +} +func (*UnimplementedControlServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") +} +func (*UnimplementedControlServer) ListNetworks(ctx context.Context, req *ListNetworksRequest) (*ListNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNetworks not implemented") +} +func (*UnimplementedControlServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") +} +func (*UnimplementedControlServer) RemoveNetwork(ctx context.Context, req *RemoveNetworkRequest) (*RemoveNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveNetwork not implemented") +} +func (*UnimplementedControlServer) GetCluster(ctx context.Context, req *GetClusterRequest) (*GetClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") +} +func (*UnimplementedControlServer) ListClusters(ctx context.Context, req *ListClustersRequest) (*ListClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListClusters not implemented") +} +func (*UnimplementedControlServer) UpdateCluster(ctx context.Context, req *UpdateClusterRequest) (*UpdateClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCluster not implemented") +} +func (*UnimplementedControlServer) GetSecret(ctx context.Context, req *GetSecretRequest) (*GetSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") +} +func (*UnimplementedControlServer) UpdateSecret(ctx context.Context, req *UpdateSecretRequest) (*UpdateSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSecret not implemented") +} +func (*UnimplementedControlServer) ListSecrets(ctx context.Context, req *ListSecretsRequest) (*ListSecretsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSecrets not implemented") +} +func (*UnimplementedControlServer) CreateSecret(ctx context.Context, req *CreateSecretRequest) (*CreateSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSecret not implemented") +} +func (*UnimplementedControlServer) RemoveSecret(ctx context.Context, req *RemoveSecretRequest) (*RemoveSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveSecret not implemented") +} +func (*UnimplementedControlServer) GetConfig(ctx context.Context, req *GetConfigRequest) (*GetConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") +} +func (*UnimplementedControlServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*UpdateConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") +} +func (*UnimplementedControlServer) ListConfigs(ctx context.Context, req *ListConfigsRequest) (*ListConfigsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListConfigs not implemented") +} +func (*UnimplementedControlServer) CreateConfig(ctx context.Context, req *CreateConfigRequest) (*CreateConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateConfig not implemented") +} +func (*UnimplementedControlServer) RemoveConfig(ctx context.Context, req *RemoveConfigRequest) (*RemoveConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConfig not implemented") +} +func (*UnimplementedControlServer) GetExtension(ctx context.Context, req *GetExtensionRequest) (*GetExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExtension not implemented") +} +func (*UnimplementedControlServer) CreateExtension(ctx context.Context, req *CreateExtensionRequest) (*CreateExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateExtension not implemented") +} +func (*UnimplementedControlServer) RemoveExtension(ctx context.Context, req *RemoveExtensionRequest) (*RemoveExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveExtension not implemented") +} +func (*UnimplementedControlServer) GetResource(ctx context.Context, req *GetResourceRequest) (*GetResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") +} +func (*UnimplementedControlServer) UpdateResource(ctx context.Context, req *UpdateResourceRequest) (*UpdateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") +} +func (*UnimplementedControlServer) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") +} +func (*UnimplementedControlServer) CreateResource(ctx context.Context, req *CreateResourceRequest) (*CreateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateResource not implemented") +} +func (*UnimplementedControlServer) RemoveResource(ctx context.Context, req *RemoveResourceRequest) (*RemoveResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveResource not implemented") +} + func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) } @@ -7156,7 +7276,7 @@ var _Control_serviceDesc = grpc.ServiceDesc{ func (m *GetNodeRequest) 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 } @@ -7164,23 +7284,29 @@ func (m *GetNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNodeResponse) 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 } @@ -7188,27 +7314,34 @@ func (m *GetNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Node.Size())) - n1, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNodesRequest) 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 } @@ -7216,27 +7349,34 @@ func (m *ListNodesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListNodesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n2, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNodesRequest_Filters) 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 } @@ -7244,110 +7384,101 @@ func (m *ListNodesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListNodesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[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.NodeLabels) > 0 { + for k := range m.NodeLabels { + v := m.NodeLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.Memberships) > 0 { - for _, num := range m.Memberships { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) - } - } - if len(m.Roles) > 0 { - for _, num := range m.Roles { - dAtA[i] = 0x28 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) + 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.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- dAtA[i] = 0x32 - 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.NodeLabels) > 0 { - for k, _ := range m.NodeLabels { - dAtA[i] = 0x3a - i++ - v := m.NodeLabels[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.Roles) > 0 { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.Roles[iNdEx])) + i-- + dAtA[i] = 0x28 + } + } + if len(m.Memberships) > 0 { + for iNdEx := len(m.Memberships) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.Memberships[iNdEx])) + i-- + dAtA[i] = 0x20 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[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] = 0x1a } } - return i, nil + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListNodesResponse) 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 } @@ -7355,29 +7486,36 @@ func (m *ListNodesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListNodesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Nodes) > 0 { - for _, msg := range m.Nodes { - 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.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateNodeRequest) 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 } @@ -7385,43 +7523,53 @@ func (m *UpdateNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.NodeVersion != nil { + { + size, err := m.NodeVersion.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(m.NodeVersion.Size())) - n3, err := m.NodeVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n4, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateNodeResponse) 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 } @@ -7429,27 +7577,34 @@ func (m *UpdateNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Node.Size())) - n5, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveNodeRequest) 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 } @@ -7457,33 +7612,39 @@ func (m *RemoveNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if m.Force { - dAtA[i] = 0x10 - i++ + i-- if m.Force { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemoveNodeResponse) 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 } @@ -7491,17 +7652,22 @@ func (m *RemoveNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetTaskRequest) 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 } @@ -7509,23 +7675,29 @@ func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTaskRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetTaskResponse) 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 } @@ -7533,27 +7705,34 @@ func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) { } func (m *GetTaskResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Task != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Task.Size())) - n6, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveTaskRequest) 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 } @@ -7561,23 +7740,29 @@ func (m *RemoveTaskRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveTaskRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveTaskResponse) 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 } @@ -7585,17 +7770,22 @@ func (m *RemoveTaskResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveTaskResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListTasksRequest) 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 } @@ -7603,27 +7793,34 @@ func (m *ListTasksRequest) Marshal() (dAtA []byte, err error) { } func (m *ListTasksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n7, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListTasksRequest_Filters) 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 } @@ -7631,141 +7828,112 @@ func (m *ListTasksRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListTasksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[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) - } - } - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - 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 len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { - 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) - } - } - if len(m.DesiredStates) > 0 { - for _, num := range m.DesiredStates { - dAtA[i] = 0x30 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x3a - 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.Runtimes) > 0 { + for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Runtimes[iNdEx]) + copy(dAtA[i:], m.Runtimes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) + i-- + dAtA[i] = 0x4a } } if m.UpToDate { - dAtA[i] = 0x40 - i++ + i-- if m.UpToDate { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x40 } - if len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - dAtA[i] = 0x4a - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x3a } } - return i, nil + if len(m.DesiredStates) > 0 { + for iNdEx := len(m.DesiredStates) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.DesiredStates[iNdEx])) + i-- + dAtA[i] = 0x30 + } + } + if len(m.NodeIDs) > 0 { + for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NodeIDs[iNdEx]) + copy(dAtA[i:], m.NodeIDs[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.ServiceIDs) > 0 { + for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceIDs[iNdEx]) + copy(dAtA[i:], m.ServiceIDs[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListTasksResponse) 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 } @@ -7773,29 +7941,36 @@ func (m *ListTasksResponse) Marshal() (dAtA []byte, err error) { } func (m *ListTasksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - 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.Tasks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateServiceRequest) 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 } @@ -7803,27 +7978,34 @@ func (m *CreateServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n8, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateServiceResponse) 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 } @@ -7831,27 +8013,34 @@ func (m *CreateServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n9, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetServiceRequest) 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 } @@ -7859,33 +8048,39 @@ func (m *GetServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } if m.InsertDefaults { - dAtA[i] = 0x10 - i++ + i-- if m.InsertDefaults { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetServiceResponse) 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 } @@ -7893,27 +8088,34 @@ func (m *GetServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n10, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateServiceRequest) 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 } @@ -7921,48 +8123,58 @@ func (m *UpdateServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.ServiceVersion != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ServiceVersion.Size())) - n11, err := m.ServiceVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 + if m.Rollback != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Rollback)) + i-- + dAtA[i] = 0x20 } if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n12, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x1a } - if m.Rollback != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Rollback)) + if m.ServiceVersion != nil { + { + size, err := m.ServiceVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateServiceResponse) 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 } @@ -7970,27 +8182,34 @@ func (m *UpdateServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n13, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveServiceRequest) 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 } @@ -7998,23 +8217,29 @@ func (m *RemoveServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveServiceResponse) 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 } @@ -8022,17 +8247,22 @@ func (m *RemoveServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListServicesRequest) 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 } @@ -8040,27 +8270,34 @@ func (m *ListServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n14, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListServicesRequest_Filters) 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 } @@ -8068,94 +8305,77 @@ func (m *ListServicesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListServicesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[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) + if len(m.Runtimes) > 0 { + for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Runtimes[iNdEx]) + copy(dAtA[i:], m.Runtimes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) + i-- + dAtA[i] = 0x2a } } if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- 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 len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - 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) + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[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 } } - return i, nil + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListServicesResponse) 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 } @@ -8163,29 +8383,36 @@ func (m *ListServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Services) > 0 { - for _, msg := range m.Services { - 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.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListServiceStatusesRequest) 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 } @@ -8193,32 +8420,31 @@ func (m *ListServiceStatusesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListServiceStatusesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Services[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 *ListServiceStatusesResponse) 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 } @@ -8226,29 +8452,36 @@ func (m *ListServiceStatusesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListServiceStatusesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Statuses) > 0 { - for _, msg := range m.Statuses { - 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.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 += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListServiceStatusesResponse_ServiceStatus) 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 } @@ -8256,38 +8489,44 @@ func (m *ListServiceStatusesResponse_ServiceStatus) Marshal() (dAtA []byte, err } func (m *ListServiceStatusesResponse_ServiceStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesResponse_ServiceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.DesiredTasks != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.DesiredTasks)) + if m.CompletedTasks != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.CompletedTasks)) + i-- + dAtA[i] = 0x20 } if m.RunningTasks != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintControl(dAtA, i, uint64(m.RunningTasks)) + i-- + dAtA[i] = 0x18 } - if m.CompletedTasks != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.CompletedTasks)) + if m.DesiredTasks != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.DesiredTasks)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *CreateNetworkRequest) 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 } @@ -8295,27 +8534,34 @@ func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n15, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkResponse) 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 } @@ -8323,27 +8569,34 @@ func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Network.Size())) - n16, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkRequest) 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 } @@ -8351,29 +8604,36 @@ func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.NetworkID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) + i-- + dAtA[i] = 0x12 } - return i, nil + 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] = 0xa + } + return len(dAtA) - i, nil } func (m *GetNetworkResponse) 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 } @@ -8381,27 +8641,34 @@ func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Network.Size())) - n17, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveNetworkRequest) 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 } @@ -8409,29 +8676,36 @@ func (m *RemoveNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.NetworkID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) + i-- + dAtA[i] = 0x12 } - return i, nil + 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] = 0xa + } + return len(dAtA) - i, nil } func (m *RemoveNetworkResponse) 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 } @@ -8439,17 +8713,22 @@ func (m *RemoveNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListNetworksRequest) 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 } @@ -8457,27 +8736,34 @@ func (m *ListNetworksRequest) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n18, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNetworksRequest_Filters) 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 } @@ -8485,79 +8771,68 @@ func (m *ListNetworksRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[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] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - 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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListNetworksResponse) 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 } @@ -8565,29 +8840,36 @@ func (m *ListNetworksResponse) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Networks) > 0 { - for _, msg := range m.Networks { - 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.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *GetClusterRequest) 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 } @@ -8595,23 +8877,29 @@ func (m *GetClusterRequest) Marshal() (dAtA []byte, err error) { } func (m *GetClusterRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ClusterID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ClusterID) + copy(dAtA[i:], m.ClusterID) i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i += copy(dAtA[i:], m.ClusterID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetClusterResponse) 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 } @@ -8619,27 +8907,34 @@ func (m *GetClusterResponse) Marshal() (dAtA []byte, err error) { } func (m *GetClusterResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Cluster != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Cluster.Size())) - n19, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListClustersRequest) 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 } @@ -8647,27 +8942,34 @@ func (m *ListClustersRequest) Marshal() (dAtA []byte, err error) { } func (m *ListClustersRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n20, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListClustersRequest_Filters) 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 } @@ -8675,79 +8977,68 @@ func (m *ListClustersRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListClustersRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[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] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - 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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListClustersResponse) 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 } @@ -8755,29 +9046,36 @@ func (m *ListClustersResponse) Marshal() (dAtA []byte, err error) { } func (m *ListClustersResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Clusters) > 0 { - for _, msg := range m.Clusters { - 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.Clusters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Clusters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *KeyRotation) 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 } @@ -8785,47 +9083,52 @@ func (m *KeyRotation) Marshal() (dAtA []byte, err error) { } func (m *KeyRotation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkerJoinToken { - dAtA[i] = 0x8 - i++ - if m.WorkerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.ManagerJoinToken { - dAtA[i] = 0x10 - i++ - if m.ManagerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.ManagerUnlockKey { - dAtA[i] = 0x18 - i++ + i-- if m.ManagerUnlockKey { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if m.ManagerJoinToken { + i-- + if m.ManagerJoinToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.WorkerJoinToken { + i-- + if m.WorkerJoinToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateClusterRequest) 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 } @@ -8833,51 +9136,63 @@ func (m *UpdateClusterRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateClusterRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ClusterID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i += copy(dAtA[i:], m.ClusterID) + { + size, err := m.Rotation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.ClusterVersion != nil { + { + size, err := m.ClusterVersion.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(m.ClusterVersion.Size())) - n21, err := m.ClusterVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n22, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 + if len(m.ClusterID) > 0 { + i -= len(m.ClusterID) + copy(dAtA[i:], m.ClusterID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) + i-- + dAtA[i] = 0xa } - dAtA[i] = 0x22 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Rotation.Size())) - n23, err := m.Rotation.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - return i, nil + return len(dAtA) - i, nil } func (m *UpdateClusterResponse) 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 } @@ -8885,27 +9200,34 @@ func (m *UpdateClusterResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateClusterResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Cluster != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Cluster.Size())) - n24, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } 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 } @@ -8913,23 +9235,29 @@ 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.SecretID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + i-- + dAtA[i] = 0xa } - return i, nil + 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 } @@ -8937,27 +9265,34 @@ 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 m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n25, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateSecretRequest) 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 } @@ -8965,43 +9300,53 @@ func (m *UpdateSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.SecretVersion != nil { + { + size, err := m.SecretVersion.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(m.SecretVersion.Size())) - n26, err := m.SecretVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n27, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 + if len(m.SecretID) > 0 { + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) + i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateSecretResponse) 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 } @@ -9009,27 +9354,34 @@ func (m *UpdateSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n28, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n28 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListSecretsRequest) 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 } @@ -9037,27 +9389,34 @@ func (m *ListSecretsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n29, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n29 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListSecretsRequest_Filters) 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 } @@ -9065,79 +9424,68 @@ func (m *ListSecretsRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[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] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - 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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListSecretsResponse) 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 } @@ -9145,29 +9493,36 @@ func (m *ListSecretsResponse) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Secrets) > 0 { - for _, msg := range m.Secrets { - 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.Secrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateSecretRequest) 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 } @@ -9175,27 +9530,34 @@ func (m *CreateSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n30, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n30 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateSecretResponse) 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 } @@ -9203,27 +9565,34 @@ func (m *CreateSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n31, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n31 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveSecretRequest) 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 } @@ -9231,23 +9600,29 @@ func (m *RemoveSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveSecretResponse) 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 } @@ -9255,17 +9630,22 @@ func (m *RemoveSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetConfigRequest) 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 } @@ -9273,23 +9653,29 @@ func (m *GetConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *GetConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetConfigResponse) 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 } @@ -9297,27 +9683,34 @@ func (m *GetConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *GetConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n32, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n32 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateConfigRequest) 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 } @@ -9325,43 +9718,53 @@ func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.ConfigVersion != nil { + { + size, err := m.ConfigVersion.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(m.ConfigVersion.Size())) - n33, err := m.ConfigVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n34, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n34 + if len(m.ConfigID) > 0 { + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateConfigResponse) 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 } @@ -9369,27 +9772,34 @@ func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n35, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n35 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListConfigsRequest) 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 } @@ -9397,27 +9807,34 @@ func (m *ListConfigsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n36, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n36 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListConfigsRequest_Filters) 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 } @@ -9425,79 +9842,68 @@ func (m *ListConfigsRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[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] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - 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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListConfigsResponse) 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 } @@ -9505,29 +9911,36 @@ func (m *ListConfigsResponse) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Configs) > 0 { - for _, msg := range m.Configs { - 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.Configs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateConfigRequest) 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 } @@ -9535,27 +9948,34 @@ func (m *CreateConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n37, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n37 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateConfigResponse) 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 } @@ -9563,27 +9983,34 @@ func (m *CreateConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n38, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n38 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveConfigRequest) 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 } @@ -9591,23 +10018,29 @@ func (m *RemoveConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveConfigResponse) 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 } @@ -9615,17 +10048,22 @@ func (m *RemoveConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *CreateExtensionRequest) 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 } @@ -9633,33 +10071,41 @@ func (m *CreateExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Annotations != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n39, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 - } if len(m.Description) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Description) + copy(dAtA[i:], m.Description) i = encodeVarintControl(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *CreateExtensionResponse) 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 } @@ -9667,27 +10113,34 @@ func (m *CreateExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Extension != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Extension.Size())) - n40, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n40 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveExtensionRequest) 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 } @@ -9695,23 +10148,29 @@ func (m *RemoveExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ExtensionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ExtensionID) + copy(dAtA[i:], m.ExtensionID) i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i += copy(dAtA[i:], m.ExtensionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveExtensionResponse) 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 } @@ -9719,17 +10178,22 @@ func (m *RemoveExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetExtensionRequest) 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 } @@ -9737,23 +10201,29 @@ func (m *GetExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *GetExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ExtensionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ExtensionID) + copy(dAtA[i:], m.ExtensionID) i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i += copy(dAtA[i:], m.ExtensionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetExtensionResponse) 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 } @@ -9761,27 +10231,34 @@ func (m *GetExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *GetExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Extension != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Extension.Size())) - n41, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n41 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateResourceRequest) 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 } @@ -9789,43 +10266,53 @@ func (m *CreateResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Annotations != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n42, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n42 + i-- + dAtA[i] = 0x1a } if len(m.Kind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + i-- + dAtA[i] = 0x12 } - if m.Payload != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Payload.Size())) - n43, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n43 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateResourceResponse) 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 } @@ -9833,27 +10320,34 @@ func (m *CreateResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n44, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n44 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveResourceRequest) 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 } @@ -9861,23 +10355,29 @@ func (m *RemoveResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveResourceResponse) 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 } @@ -9885,17 +10385,22 @@ func (m *RemoveResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *UpdateResourceRequest) 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 } @@ -9903,53 +10408,65 @@ func (m *UpdateResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) - } - if m.ResourceVersion != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ResourceVersion.Size())) - n45, err := m.ResourceVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n45 + i-- + dAtA[i] = 0x22 } if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n46, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n46 } - if m.Payload != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Payload.Size())) - n47, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ResourceVersion != nil { + { + size, err := m.ResourceVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n47 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ResourceID) > 0 { + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateResourceResponse) 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 } @@ -9957,27 +10474,34 @@ func (m *UpdateResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n48, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n48 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetResourceRequest) 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 } @@ -9985,23 +10509,29 @@ func (m *GetResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetResourceResponse) 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 } @@ -10009,27 +10539,34 @@ func (m *GetResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *GetResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n49, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n49 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesRequest) 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 } @@ -10037,27 +10574,34 @@ func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n50, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n50 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesRequest_Filters) 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 } @@ -10065,85 +10609,75 @@ func (m *ListResourcesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - 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 len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x2a } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - 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.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[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] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - 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 len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if len(m.Kind) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesResponse) 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 } @@ -10151,33 +10685,42 @@ func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Resources) > 0 { - for _, msg := range m.Resources { - 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.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - 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 } type raftProxyControlServer struct { @@ -13016,14 +13559,7 @@ func (m *ListResourcesResponse) 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)))) @@ -13098,8 +13634,13 @@ func (this *ListNodesResponse) String() string { if this == nil { return "nil" } + repeatedStringForNodes := "[]*Node{" + for _, f := range this.Nodes { + repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + "," + } + repeatedStringForNodes += "}" s := strings.Join([]string{`&ListNodesResponse{`, - `Nodes:` + strings.Replace(fmt.Sprintf("%v", this.Nodes), "Node", "Node", 1) + `,`, + `Nodes:` + repeatedStringForNodes + `,`, `}`, }, "") return s @@ -13227,8 +13768,13 @@ func (this *ListTasksResponse) String() string { if this == nil { return "nil" } + repeatedStringForTasks := "[]*Task{" + for _, f := range this.Tasks { + repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," + } + repeatedStringForTasks += "}" s := strings.Join([]string{`&ListTasksResponse{`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, + `Tasks:` + repeatedStringForTasks + `,`, `}`, }, "") return s @@ -13354,8 +13900,13 @@ func (this *ListServicesResponse) String() string { if this == nil { return "nil" } + repeatedStringForServices := "[]*Service{" + for _, f := range this.Services { + repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + "," + } + repeatedStringForServices += "}" s := strings.Join([]string{`&ListServicesResponse{`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "Service", "Service", 1) + `,`, + `Services:` + repeatedStringForServices + `,`, `}`, }, "") return s @@ -13374,8 +13925,13 @@ func (this *ListServiceStatusesResponse) String() string { if this == nil { return "nil" } + repeatedStringForStatuses := "[]*ListServiceStatusesResponse_ServiceStatus{" + for _, f := range this.Statuses { + repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "ListServiceStatusesResponse_ServiceStatus", "ListServiceStatusesResponse_ServiceStatus", 1) + "," + } + repeatedStringForStatuses += "}" s := strings.Join([]string{`&ListServiceStatusesResponse{`, - `Statuses:` + strings.Replace(fmt.Sprintf("%v", this.Statuses), "ListServiceStatusesResponse_ServiceStatus", "ListServiceStatusesResponse_ServiceStatus", 1) + `,`, + `Statuses:` + repeatedStringForStatuses + `,`, `}`, }, "") return s @@ -13491,8 +14047,13 @@ func (this *ListNetworksResponse) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*Network{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&ListNetworksResponse{`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "Network", "Network", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `}`, }, "") return s @@ -13554,8 +14115,13 @@ func (this *ListClustersResponse) String() string { if this == nil { return "nil" } + repeatedStringForClusters := "[]*Cluster{" + for _, f := range this.Clusters { + repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + "," + } + repeatedStringForClusters += "}" s := strings.Join([]string{`&ListClustersResponse{`, - `Clusters:` + strings.Replace(fmt.Sprintf("%v", this.Clusters), "Cluster", "Cluster", 1) + `,`, + `Clusters:` + repeatedStringForClusters + `,`, `}`, }, "") return s @@ -13674,8 +14240,13 @@ func (this *ListSecretsResponse) String() string { if this == nil { return "nil" } + repeatedStringForSecrets := "[]*Secret{" + for _, f := range this.Secrets { + repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + "," + } + repeatedStringForSecrets += "}" s := strings.Join([]string{`&ListSecretsResponse{`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "Secret", "Secret", 1) + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, `}`, }, "") return s @@ -13798,8 +14369,13 @@ func (this *ListConfigsResponse) String() string { if this == nil { return "nil" } + repeatedStringForConfigs := "[]*Config{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + "," + } + repeatedStringForConfigs += "}" s := strings.Join([]string{`&ListConfigsResponse{`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "Config", "Config", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -14025,8 +14601,13 @@ func (this *ListResourcesResponse) String() string { if this == nil { return "nil" } + repeatedStringForResources := "[]*Resource{" + for _, f := range this.Resources { + repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + "," + } + repeatedStringForResources += "}" s := strings.Join([]string{`&ListResourcesResponse{`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Resources:` + repeatedStringForResources + `,`, `}`, }, "") return s @@ -14106,10 +14687,7 @@ func (m *GetNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14195,10 +14773,7 @@ func (m *GetNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14284,10 +14859,7 @@ func (m *ListNodesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14511,7 +15083,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -14808,7 +15380,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -14825,10 +15397,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14912,10 +15481,7 @@ func (m *ListNodesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15069,10 +15635,7 @@ func (m *UpdateNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15158,10 +15721,7 @@ func (m *UpdateNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15263,10 +15823,7 @@ func (m *RemoveNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15316,10 +15873,7 @@ func (m *RemoveNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15401,10 +15955,7 @@ func (m *GetTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15490,10 +16041,7 @@ func (m *GetTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15575,10 +16123,7 @@ func (m *RemoveTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15628,10 +16173,7 @@ func (m *RemoveTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15717,10 +16259,7 @@ func (m *ListTasksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15944,7 +16483,7 @@ func (m *ListTasksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -16178,10 +16717,7 @@ func (m *ListTasksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16265,10 +16801,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16354,10 +16887,7 @@ func (m *CreateServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16443,10 +16973,7 @@ func (m *CreateServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16548,10 +17075,7 @@ func (m *GetServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16637,10 +17161,7 @@ func (m *GetServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16813,10 +17334,7 @@ func (m *UpdateServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16902,10 +17420,7 @@ func (m *UpdateServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16987,10 +17502,7 @@ func (m *RemoveServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17040,10 +17552,7 @@ func (m *RemoveServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17129,10 +17638,7 @@ func (m *ListServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17356,7 +17862,7 @@ func (m *ListServicesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -17437,10 +17943,7 @@ func (m *ListServicesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17524,10 +18027,7 @@ func (m *ListServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17609,10 +18109,7 @@ func (m *ListServiceStatusesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17696,10 +18193,7 @@ func (m *ListServiceStatusesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17838,10 +18332,7 @@ func (m *ListServiceStatusesResponse_ServiceStatus) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17927,10 +18418,7 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18016,10 +18504,7 @@ func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18133,10 +18618,7 @@ func (m *GetNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18222,10 +18704,7 @@ func (m *GetNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18339,10 +18818,7 @@ func (m *RemoveNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18392,10 +18868,7 @@ func (m *RemoveNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18481,10 +18954,7 @@ func (m *ListNetworksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18708,7 +19178,7 @@ func (m *ListNetworksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -18757,10 +19227,7 @@ func (m *ListNetworksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18844,10 +19311,7 @@ func (m *ListNetworksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18929,10 +19393,7 @@ func (m *GetClusterRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19018,10 +19479,7 @@ func (m *GetClusterResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19107,10 +19565,7 @@ func (m *ListClustersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19334,7 +19789,7 @@ func (m *ListClustersRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -19383,10 +19838,7 @@ func (m *ListClustersRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19470,10 +19922,7 @@ func (m *ListClustersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19583,10 +20032,7 @@ func (m *KeyRotation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19773,10 +20219,7 @@ func (m *UpdateClusterRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19862,10 +20305,7 @@ func (m *UpdateClusterResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19947,10 +20387,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20036,10 +20473,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20193,10 +20627,7 @@ func (m *UpdateSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20282,10 +20713,7 @@ func (m *UpdateSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20371,10 +20799,7 @@ func (m *ListSecretsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20598,7 +21023,7 @@ func (m *ListSecretsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -20647,10 +21072,7 @@ func (m *ListSecretsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20734,10 +21156,7 @@ func (m *ListSecretsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20823,10 +21242,7 @@ func (m *CreateSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20912,10 +21328,7 @@ func (m *CreateSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20997,10 +21410,7 @@ func (m *RemoveSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21050,10 +21460,7 @@ func (m *RemoveSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21135,10 +21542,7 @@ func (m *GetConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21224,10 +21628,7 @@ func (m *GetConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21381,10 +21782,7 @@ func (m *UpdateConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21470,10 +21868,7 @@ func (m *UpdateConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21559,10 +21954,7 @@ func (m *ListConfigsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21786,7 +22178,7 @@ func (m *ListConfigsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -21835,10 +22227,7 @@ func (m *ListConfigsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21922,10 +22311,7 @@ func (m *ListConfigsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22011,10 +22397,7 @@ func (m *CreateConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22100,10 +22483,7 @@ func (m *CreateConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22185,10 +22565,7 @@ func (m *RemoveConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22238,10 +22615,7 @@ func (m *RemoveConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22359,10 +22733,7 @@ func (m *CreateExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22448,10 +22819,7 @@ func (m *CreateExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22533,10 +22901,7 @@ func (m *RemoveExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22586,10 +22951,7 @@ func (m *RemoveExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22671,10 +23033,7 @@ func (m *GetExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22760,10 +23119,7 @@ func (m *GetExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22917,10 +23273,7 @@ func (m *CreateResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23006,10 +23359,7 @@ func (m *CreateResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23091,10 +23441,7 @@ func (m *RemoveResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23144,10 +23491,7 @@ func (m *RemoveResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23337,10 +23681,7 @@ func (m *UpdateResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23426,10 +23767,7 @@ func (m *UpdateResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23511,10 +23849,7 @@ func (m *GetResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23600,10 +23935,7 @@ func (m *GetResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23689,10 +24021,7 @@ func (m *ListResourcesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23916,7 +24245,7 @@ func (m *ListResourcesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -23997,10 +24326,7 @@ func (m *ListResourcesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -24084,10 +24410,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -24105,6 +24428,7 @@ func (m *ListResourcesResponse) 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 { @@ -24136,10 +24460,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 { @@ -24160,55 +24482,30 @@ func skipControl(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthControl } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthControl - } - return iNdEx, nil 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 - if iNdEx < 0 { - return 0, ErrInvalidLengthControl - } - } - 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") ) diff --git a/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go b/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go index 3d76cbf8a7..96b13a1218 100644 --- a/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go +++ b/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go @@ -20,6 +20,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -36,7 +37,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 AssignmentChange_AssignmentAction int32 @@ -113,7 +114,7 @@ func (m *SessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SessionRequest.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 } @@ -203,7 +204,7 @@ func (m *SessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SessionMessage.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 } @@ -240,7 +241,7 @@ func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_HeartbeatRequest.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 } @@ -278,7 +279,7 @@ func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_HeartbeatResponse.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 } @@ -317,7 +318,7 @@ func (m *UpdateTaskStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_UpdateTaskStatusRequest.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 } @@ -356,7 +357,7 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Marshal(b []byte, determi return xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.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 } @@ -391,7 +392,7 @@ func (m *UpdateTaskStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_UpdateTaskStatusResponse.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 } @@ -427,7 +428,7 @@ func (m *TasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TasksRequest.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 } @@ -465,7 +466,7 @@ func (m *TasksMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TasksMessage.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 } @@ -501,7 +502,7 @@ func (m *AssignmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AssignmentsRequest.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 } @@ -541,7 +542,7 @@ func (m *Assignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Assignment.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 } @@ -567,13 +568,13 @@ type isAssignment_Item interface { } type Assignment_Task struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof" json:"task,omitempty"` } type Assignment_Secret struct { - Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type Assignment_Config struct { - Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Assignment_Task) isAssignment_Item() {} @@ -608,99 +609,15 @@ func (m *Assignment) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Assignment) 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 _Assignment_OneofMarshaler, _Assignment_OneofUnmarshaler, _Assignment_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Assignment) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Assignment_Task)(nil), (*Assignment_Secret)(nil), (*Assignment_Config)(nil), } } -func _Assignment_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Assignment) - // item - switch x := m.Item.(type) { - case *Assignment_Task: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *Assignment_Secret: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *Assignment_Config: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Assignment.Item has unexpected type %T", x) - } - return nil -} - -func _Assignment_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Assignment) - switch tag { - case 1: // item.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Task{msg} - return true, err - case 2: // item.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Secret{msg} - return true, err - case 3: // item.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Config{msg} - return true, err - default: - return false, nil - } -} - -func _Assignment_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Assignment) - // item - switch x := m.Item.(type) { - case *Assignment_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Assignment_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Assignment_Config: - s := proto.Size(x.Config) - 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 AssignmentChange struct { Assignment *Assignment `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"` Action AssignmentChange_AssignmentAction `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.AssignmentChange_AssignmentAction" json:"action,omitempty"` @@ -719,7 +636,7 @@ func (m *AssignmentChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_AssignmentChange.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 } @@ -767,7 +684,7 @@ func (m *AssignmentsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AssignmentsMessage.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 } @@ -1401,6 +1318,26 @@ type DispatcherServer interface { Assignments(*AssignmentsRequest, Dispatcher_AssignmentsServer) error } +// UnimplementedDispatcherServer can be embedded to have forward compatible implementations. +type UnimplementedDispatcherServer struct { +} + +func (*UnimplementedDispatcherServer) Session(req *SessionRequest, srv Dispatcher_SessionServer) error { + return status.Errorf(codes.Unimplemented, "method Session not implemented") +} +func (*UnimplementedDispatcherServer) Heartbeat(ctx context.Context, req *HeartbeatRequest) (*HeartbeatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") +} +func (*UnimplementedDispatcherServer) UpdateTaskStatus(ctx context.Context, req *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTaskStatus not implemented") +} +func (*UnimplementedDispatcherServer) Tasks(req *TasksRequest, srv Dispatcher_TasksServer) error { + return status.Errorf(codes.Unimplemented, "method Tasks not implemented") +} +func (*UnimplementedDispatcherServer) Assignments(req *AssignmentsRequest, srv Dispatcher_AssignmentsServer) error { + return status.Errorf(codes.Unimplemented, "method Assignments not implemented") +} + func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer) { s.RegisterService(&_Dispatcher_serviceDesc, srv) } @@ -1540,7 +1477,7 @@ var _Dispatcher_serviceDesc = grpc.ServiceDesc{ func (m *SessionRequest) 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 } @@ -1548,33 +1485,41 @@ func (m *SessionRequest) Marshal() (dAtA []byte, err error) { } func (m *SessionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Description != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Description.Size())) - n1, err := m.Description.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if len(m.SessionID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Description != nil { + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SessionMessage) 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 } @@ -1582,63 +1527,76 @@ func (m *SessionMessage) Marshal() (dAtA []byte, err error) { } func (m *SessionMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) - } - if m.Node != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if len(m.Managers) > 0 { - for _, msg := range m.Managers { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.RootCA) > 0 { + i -= len(m.RootCA) + copy(dAtA[i:], m.RootCA) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA))) + i-- + dAtA[i] = 0x2a } if len(m.NetworkBootstrapKeys) > 0 { - for _, msg := range m.NetworkBootstrapKeys { + for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x22 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if len(m.Managers) > 0 { + for iNdEx := len(m.Managers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Managers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Node != nil { + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if len(m.RootCA) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA))) - i += copy(dAtA[i:], m.RootCA) + if len(m.SessionID) > 0 { + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HeartbeatRequest) 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 } @@ -1646,23 +1604,29 @@ func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) { } func (m *HeartbeatRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeartbeatRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HeartbeatResponse) 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 } @@ -1670,25 +1634,30 @@ func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) { } func (m *HeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeartbeatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period))) - n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period):]) + if err3 != nil { + return 0, err3 } - i += n3 - return i, nil + i -= n3 + i = encodeVarintDispatcher(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *UpdateTaskStatusRequest) 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 } @@ -1696,35 +1665,43 @@ func (m *UpdateTaskStatusRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateTaskStatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) - } if len(m.Updates) > 0 { - for _, msg := range m.Updates { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.SessionID) > 0 { + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateTaskStatusRequest_TaskStatusUpdate) 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 } @@ -1732,33 +1709,41 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Marshal() (dAtA []byte, err e } func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) - } if m.Status != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Status.Size())) - n4, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.TaskID) > 0 { + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateTaskStatusResponse) 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 } @@ -1766,17 +1751,22 @@ func (m *UpdateTaskStatusResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateTaskStatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *TasksRequest) 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 } @@ -1784,23 +1774,29 @@ func (m *TasksRequest) Marshal() (dAtA []byte, err error) { } func (m *TasksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TasksMessage) 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 } @@ -1808,29 +1804,36 @@ func (m *TasksMessage) Marshal() (dAtA []byte, err error) { } func (m *TasksMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TasksMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *AssignmentsRequest) 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 } @@ -1838,23 +1841,29 @@ func (m *AssignmentsRequest) Marshal() (dAtA []byte, err error) { } func (m *AssignmentsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment) 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 } @@ -1862,66 +1871,94 @@ func (m *Assignment) Marshal() (dAtA []byte, err error) { } func (m *Assignment) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Item != nil { - nn5, err := m.Item.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Item.Size() + i -= size + if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn5 } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Task.Size())) - n6, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Secret.Size())) - n7, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Config.Size())) - n8, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *AssignmentChange) 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 } @@ -1929,32 +1966,39 @@ func (m *AssignmentChange) Marshal() (dAtA []byte, err error) { } func (m *AssignmentChange) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Assignment != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Assignment.Size())) - n9, err := m.Assignment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } if m.Action != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintDispatcher(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Assignment != nil { + { + size, err := m.Assignment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AssignmentsMessage) 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 } @@ -1962,50 +2006,61 @@ func (m *AssignmentsMessage) Marshal() (dAtA []byte, err error) { } func (m *AssignmentsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Type)) - } - if len(m.AppliesTo) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo))) - i += copy(dAtA[i:], m.AppliesTo) - } - if len(m.ResultsIn) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn))) - i += copy(dAtA[i:], m.ResultsIn) - } if len(m.Changes) > 0 { - for _, msg := range m.Changes { - dAtA[i] = 0x22 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - return i, nil + if len(m.ResultsIn) > 0 { + i -= len(m.ResultsIn) + copy(dAtA[i:], m.ResultsIn) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn))) + i-- + dAtA[i] = 0x1a + } + if len(m.AppliesTo) > 0 { + i -= len(m.AppliesTo) + copy(dAtA[i:], m.AppliesTo) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintDispatcher(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintDispatcher(dAtA []byte, offset int, v uint64) int { + offset -= sovDispatcher(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 } type raftProxyDispatcherServer struct { @@ -2554,14 +2609,7 @@ func (m *AssignmentsMessage) Size() (n int) { } func sovDispatcher(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozDispatcher(x uint64) (n int) { return sovDispatcher(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2581,11 +2629,21 @@ func (this *SessionMessage) String() string { if this == nil { return "nil" } + repeatedStringForManagers := "[]*WeightedPeer{" + for _, f := range this.Managers { + repeatedStringForManagers += strings.Replace(fmt.Sprintf("%v", f), "WeightedPeer", "WeightedPeer", 1) + "," + } + repeatedStringForManagers += "}" + repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" + for _, f := range this.NetworkBootstrapKeys { + repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForNetworkBootstrapKeys += "}" s := strings.Join([]string{`&SessionMessage{`, `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `Managers:` + strings.Replace(fmt.Sprintf("%v", this.Managers), "WeightedPeer", "WeightedPeer", 1) + `,`, - `NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `Managers:` + repeatedStringForManagers + `,`, + `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, `RootCA:` + fmt.Sprintf("%v", this.RootCA) + `,`, `}`, }, "") @@ -2606,7 +2664,7 @@ func (this *HeartbeatResponse) String() string { return "nil" } s := strings.Join([]string{`&HeartbeatResponse{`, - `Period:` + strings.Replace(strings.Replace(this.Period.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Period:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Period), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -2615,9 +2673,14 @@ func (this *UpdateTaskStatusRequest) String() string { if this == nil { return "nil" } + repeatedStringForUpdates := "[]*UpdateTaskStatusRequest_TaskStatusUpdate{" + for _, f := range this.Updates { + repeatedStringForUpdates += strings.Replace(fmt.Sprintf("%v", f), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + "," + } + repeatedStringForUpdates += "}" s := strings.Join([]string{`&UpdateTaskStatusRequest{`, `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `Updates:` + strings.Replace(fmt.Sprintf("%v", this.Updates), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + `,`, + `Updates:` + repeatedStringForUpdates + `,`, `}`, }, "") return s @@ -2656,8 +2719,13 @@ func (this *TasksMessage) String() string { if this == nil { return "nil" } + repeatedStringForTasks := "[]*Task{" + for _, f := range this.Tasks { + repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," + } + repeatedStringForTasks += "}" s := strings.Join([]string{`&TasksMessage{`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, + `Tasks:` + repeatedStringForTasks + `,`, `}`, }, "") return s @@ -2717,7 +2785,7 @@ func (this *AssignmentChange) String() string { return "nil" } s := strings.Join([]string{`&AssignmentChange{`, - `Assignment:` + strings.Replace(fmt.Sprintf("%v", this.Assignment), "Assignment", "Assignment", 1) + `,`, + `Assignment:` + strings.Replace(this.Assignment.String(), "Assignment", "Assignment", 1) + `,`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, `}`, }, "") @@ -2727,11 +2795,16 @@ func (this *AssignmentsMessage) String() string { if this == nil { return "nil" } + repeatedStringForChanges := "[]*AssignmentChange{" + for _, f := range this.Changes { + repeatedStringForChanges += strings.Replace(f.String(), "AssignmentChange", "AssignmentChange", 1) + "," + } + repeatedStringForChanges += "}" s := strings.Join([]string{`&AssignmentsMessage{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `AppliesTo:` + fmt.Sprintf("%v", this.AppliesTo) + `,`, `ResultsIn:` + fmt.Sprintf("%v", this.ResultsIn) + `,`, - `Changes:` + strings.Replace(fmt.Sprintf("%v", this.Changes), "AssignmentChange", "AssignmentChange", 1) + `,`, + `Changes:` + repeatedStringForChanges + `,`, `}`, }, "") return s @@ -2847,10 +2920,7 @@ func (m *SessionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3070,10 +3140,7 @@ func (m *SessionMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3155,10 +3222,7 @@ func (m *HeartbeatRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3241,10 +3305,7 @@ func (m *HeartbeatResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3360,10 +3421,7 @@ func (m *UpdateTaskStatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3481,10 +3539,7 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3534,10 +3589,7 @@ func (m *UpdateTaskStatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3619,10 +3671,7 @@ func (m *TasksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3706,10 +3755,7 @@ func (m *TasksMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3791,10 +3837,7 @@ func (m *AssignmentsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3949,10 +3992,7 @@ func (m *Assignment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4057,10 +4097,7 @@ func (m *AssignmentChange) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4227,10 +4264,7 @@ func (m *AssignmentsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4248,6 +4282,7 @@ func (m *AssignmentsMessage) Unmarshal(dAtA []byte) error { func skipDispatcher(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 { @@ -4279,10 +4314,8 @@ func skipDispatcher(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 { @@ -4303,55 +4336,30 @@ func skipDispatcher(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthDispatcher } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthDispatcher - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDispatcher - } - 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 := skipDispatcher(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthDispatcher - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDispatcher + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthDispatcher + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDispatcher = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/health.pb.go b/vendor/github.com/docker/swarmkit/api/health.pb.go index 48c3d243c8..3ca506a031 100644 --- a/vendor/github.com/docker/swarmkit/api/health.pb.go +++ b/vendor/github.com/docker/swarmkit/api/health.pb.go @@ -17,6 +17,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -31,7 +32,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 HealthCheckResponse_ServingStatus int32 @@ -78,7 +79,7 @@ func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HealthCheckRequest.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 } @@ -114,7 +115,7 @@ func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HealthCheckResponse.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 } @@ -255,6 +256,14 @@ type HealthServer interface { Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) } +// UnimplementedHealthServer can be embedded to have forward compatible implementations. +type UnimplementedHealthServer struct { +} + +func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} + func RegisterHealthServer(s *grpc.Server, srv HealthServer) { s.RegisterService(&_Health_serviceDesc, srv) } @@ -293,7 +302,7 @@ var _Health_serviceDesc = grpc.ServiceDesc{ func (m *HealthCheckRequest) 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 } @@ -301,23 +310,29 @@ func (m *HealthCheckRequest) Marshal() (dAtA []byte, err error) { } func (m *HealthCheckRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Service) + copy(dAtA[i:], m.Service) i = encodeVarintHealth(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HealthCheckResponse) 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 } @@ -325,26 +340,33 @@ func (m *HealthCheckResponse) Marshal() (dAtA []byte, err error) { } func (m *HealthCheckResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Status != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintHealth(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintHealth(dAtA []byte, offset int, v uint64) int { + offset -= sovHealth(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 } type raftProxyHealthServer struct { @@ -480,14 +502,7 @@ func (m *HealthCheckResponse) Size() (n int) { } func sovHealth(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozHealth(x uint64) (n int) { return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -587,10 +602,7 @@ func (m *HealthCheckRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthHealth } if (iNdEx + skippy) > l { @@ -659,10 +671,7 @@ func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthHealth } if (iNdEx + skippy) > l { @@ -680,6 +689,7 @@ func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error { func skipHealth(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 { @@ -711,10 +721,8 @@ func skipHealth(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 { @@ -735,55 +743,30 @@ func skipHealth(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthHealth } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthHealth - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHealth - } - 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 := skipHealth(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthHealth - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHealth + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthHealth + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/logbroker.pb.go b/vendor/github.com/docker/swarmkit/api/logbroker.pb.go index 17eecbedc1..1b95b226c7 100644 --- a/vendor/github.com/docker/swarmkit/api/logbroker.pb.go +++ b/vendor/github.com/docker/swarmkit/api/logbroker.pb.go @@ -19,6 +19,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -33,7 +34,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 // LogStream defines the stream from which the log message came. type LogStream int32 @@ -106,7 +107,7 @@ func (m *LogSubscriptionOptions) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_LogSubscriptionOptions.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 } @@ -149,7 +150,7 @@ func (m *LogSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LogSelector.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 } @@ -188,7 +189,7 @@ func (m *LogContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogContext.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 } @@ -226,7 +227,7 @@ func (m *LogAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogAttr.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 } @@ -274,7 +275,7 @@ func (m *LogMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogMessage.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 } @@ -312,7 +313,7 @@ func (m *SubscribeLogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_SubscribeLogsRequest.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 } @@ -348,7 +349,7 @@ func (m *SubscribeLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_SubscribeLogsMessage.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 } @@ -385,7 +386,7 @@ func (m *ListenSubscriptionsRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListenSubscriptionsRequest.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 } @@ -433,7 +434,7 @@ func (m *SubscriptionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SubscriptionMessage.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 } @@ -478,7 +479,7 @@ func (m *PublishLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PublishLogsMessage.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 } @@ -513,7 +514,7 @@ func (m *PublishLogsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PublishLogsResponse.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 } @@ -963,6 +964,14 @@ type LogsServer interface { SubscribeLogs(*SubscribeLogsRequest, Logs_SubscribeLogsServer) error } +// UnimplementedLogsServer can be embedded to have forward compatible implementations. +type UnimplementedLogsServer struct { +} + +func (*UnimplementedLogsServer) SubscribeLogs(req *SubscribeLogsRequest, srv Logs_SubscribeLogsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeLogs not implemented") +} + func RegisterLogsServer(s *grpc.Server, srv LogsServer) { s.RegisterService(&_Logs_serviceDesc, srv) } @@ -1104,6 +1113,17 @@ type LogBrokerServer interface { PublishLogs(LogBroker_PublishLogsServer) error } +// UnimplementedLogBrokerServer can be embedded to have forward compatible implementations. +type UnimplementedLogBrokerServer struct { +} + +func (*UnimplementedLogBrokerServer) ListenSubscriptions(req *ListenSubscriptionsRequest, srv LogBroker_ListenSubscriptionsServer) error { + return status.Errorf(codes.Unimplemented, "method ListenSubscriptions not implemented") +} +func (*UnimplementedLogBrokerServer) PublishLogs(srv LogBroker_PublishLogsServer) error { + return status.Errorf(codes.Unimplemented, "method PublishLogs not implemented") +} + func RegisterLogBrokerServer(s *grpc.Server, srv LogBrokerServer) { s.RegisterService(&_LogBroker_serviceDesc, srv) } @@ -1177,7 +1197,7 @@ var _LogBroker_serviceDesc = grpc.ServiceDesc{ func (m *LogSubscriptionOptions) 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 } @@ -1185,49 +1205,56 @@ func (m *LogSubscriptionOptions) Marshal() (dAtA []byte, err error) { } func (m *LogSubscriptionOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogSubscriptionOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Streams) > 0 { - for _, num := range m.Streams { - dAtA[i] = 0x8 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(num)) + if m.Since != nil { + { + size, err := m.Since.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 + } + if m.Tail != 0 { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Tail)) + i-- + dAtA[i] = 0x18 } if m.Follow { - dAtA[i] = 0x10 - i++ + i-- if m.Follow { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Tail != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Tail)) - } - if m.Since != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Since.Size())) - n1, err := m.Since.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Streams[iNdEx])) + i-- + dAtA[i] = 0x8 } - i += n1 } - return i, nil + return len(dAtA) - i, nil } func (m *LogSelector) 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 } @@ -1235,62 +1262,49 @@ func (m *LogSelector) Marshal() (dAtA []byte, err error) { } func (m *LogSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - 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 len(m.TaskIDs) > 0 { + for iNdEx := len(m.TaskIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TaskIDs[iNdEx]) + copy(dAtA[i:], m.TaskIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskIDs[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { + for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NodeIDs[iNdEx]) + copy(dAtA[i:], m.NodeIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) + i-- 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.TaskIDs) > 0 { - for _, s := range m.TaskIDs { - dAtA[i] = 0x1a - 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.ServiceIDs) > 0 { + for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceIDs[iNdEx]) + copy(dAtA[i:], m.ServiceIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *LogContext) 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 } @@ -1298,35 +1312,43 @@ func (m *LogContext) Marshal() (dAtA []byte, err error) { } func (m *LogContext) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + if len(m.TaskID) > 0 { + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskID))) + i-- + dAtA[i] = 0x1a } if len(m.NodeID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0x12 } - if len(m.TaskID) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LogAttr) 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 } @@ -1334,29 +1356,36 @@ func (m *LogAttr) Marshal() (dAtA []byte, err error) { } func (m *LogAttr) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogAttr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *LogMessage) 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 } @@ -1364,58 +1393,70 @@ func (m *LogMessage) Marshal() (dAtA []byte, err error) { } func (m *LogMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Context.Size())) - n2, err := m.Context.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - if m.Timestamp != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Timestamp.Size())) - n3, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Attrs) > 0 { + for iNdEx := len(m.Attrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i += n3 - } - if m.Stream != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Stream)) } if len(m.Data) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0x22 } - if len(m.Attrs) > 0 { - for _, msg := range m.Attrs { - dAtA[i] = 0x2a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Stream != 0 { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Stream)) + i-- + dAtA[i] = 0x18 + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - return i, nil + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SubscribeLogsRequest) 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 } @@ -1423,37 +1464,46 @@ func (m *SubscribeLogsRequest) Marshal() (dAtA []byte, err error) { } func (m *SubscribeLogsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeLogsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Selector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Selector.Size())) - n4, err := m.Selector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } if m.Options != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Options.Size())) - n5, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Selector != nil { + { + size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SubscribeLogsMessage) 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 } @@ -1461,29 +1511,36 @@ func (m *SubscribeLogsMessage) Marshal() (dAtA []byte, err error) { } func (m *SubscribeLogsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Messages) > 0 { - for _, msg := range m.Messages { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListenSubscriptionsRequest) 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 } @@ -1491,17 +1548,22 @@ func (m *ListenSubscriptionsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListenSubscriptionsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenSubscriptionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *SubscriptionMessage) 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 } @@ -1509,53 +1571,63 @@ func (m *SubscriptionMessage) Marshal() (dAtA []byte, err error) { } func (m *SubscriptionMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscriptionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.Selector != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Selector.Size())) - n6, err := m.Selector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.Options != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Options.Size())) - n7, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } if m.Close { - dAtA[i] = 0x20 - i++ + i-- if m.Close { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - return i, nil + if m.Options != nil { + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Selector != nil { + { + size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PublishLogsMessage) 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 } @@ -1563,45 +1635,53 @@ func (m *PublishLogsMessage) Marshal() (dAtA []byte, err error) { } func (m *PublishLogsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublishLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SubscriptionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.SubscriptionID))) - i += copy(dAtA[i:], m.SubscriptionID) - } - if len(m.Messages) > 0 { - for _, msg := range m.Messages { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } if m.Close { - dAtA[i] = 0x18 - i++ + i-- if m.Close { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.SubscriptionID) > 0 { + i -= len(m.SubscriptionID) + copy(dAtA[i:], m.SubscriptionID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.SubscriptionID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PublishLogsResponse) 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 } @@ -1609,21 +1689,28 @@ func (m *PublishLogsResponse) Marshal() (dAtA []byte, err error) { } func (m *PublishLogsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublishLogsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintLogbroker(dAtA []byte, offset int, v uint64) int { + offset -= sovLogbroker(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 } type raftProxyLogsServer struct { @@ -2143,14 +2230,7 @@ func (m *PublishLogsResponse) Size() (n int) { } func sovLogbroker(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozLogbroker(x uint64) (n int) { return sovLogbroker(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2207,12 +2287,17 @@ func (this *LogMessage) String() string { if this == nil { return "nil" } + repeatedStringForAttrs := "[]LogAttr{" + for _, f := range this.Attrs { + repeatedStringForAttrs += strings.Replace(strings.Replace(f.String(), "LogAttr", "LogAttr", 1), `&`, ``, 1) + "," + } + repeatedStringForAttrs += "}" s := strings.Join([]string{`&LogMessage{`, `Context:` + strings.Replace(strings.Replace(this.Context.String(), "LogContext", "LogContext", 1), `&`, ``, 1) + `,`, `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, `Stream:` + fmt.Sprintf("%v", this.Stream) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Attrs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attrs), "LogAttr", "LogAttr", 1), `&`, ``, 1) + `,`, + `Attrs:` + repeatedStringForAttrs + `,`, `}`, }, "") return s @@ -2222,8 +2307,8 @@ func (this *SubscribeLogsRequest) String() string { return "nil" } s := strings.Join([]string{`&SubscribeLogsRequest{`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, + `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, + `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, `}`, }, "") return s @@ -2232,8 +2317,13 @@ func (this *SubscribeLogsMessage) String() string { if this == nil { return "nil" } + repeatedStringForMessages := "[]LogMessage{" + for _, f := range this.Messages { + repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," + } + repeatedStringForMessages += "}" s := strings.Join([]string{`&SubscribeLogsMessage{`, - `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`, + `Messages:` + repeatedStringForMessages + `,`, `}`, }, "") return s @@ -2253,8 +2343,8 @@ func (this *SubscriptionMessage) String() string { } s := strings.Join([]string{`&SubscriptionMessage{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, + `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, + `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, `Close:` + fmt.Sprintf("%v", this.Close) + `,`, `}`, }, "") @@ -2264,9 +2354,14 @@ func (this *PublishLogsMessage) String() string { if this == nil { return "nil" } + repeatedStringForMessages := "[]LogMessage{" + for _, f := range this.Messages { + repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," + } + repeatedStringForMessages += "}" s := strings.Join([]string{`&PublishLogsMessage{`, `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`, - `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`, + `Messages:` + repeatedStringForMessages + `,`, `Close:` + fmt.Sprintf("%v", this.Close) + `,`, `}`, }, "") @@ -2468,10 +2563,7 @@ func (m *LogSubscriptionOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2617,10 +2709,7 @@ func (m *LogSelector) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2766,10 +2855,7 @@ func (m *LogContext) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2883,10 +2969,7 @@ func (m *LogAttr) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3092,10 +3175,7 @@ func (m *LogMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3217,10 +3297,7 @@ func (m *SubscribeLogsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3304,10 +3381,7 @@ func (m *SubscribeLogsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3357,10 +3431,7 @@ func (m *ListenSubscriptionsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3534,10 +3605,7 @@ func (m *SubscriptionMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3673,10 +3741,7 @@ func (m *PublishLogsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3726,10 +3791,7 @@ func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3747,6 +3809,7 @@ func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error { func skipLogbroker(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 { @@ -3778,10 +3841,8 @@ func skipLogbroker(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 { @@ -3802,55 +3863,30 @@ func skipLogbroker(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthLogbroker } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthLogbroker - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogbroker - } - 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 := skipLogbroker(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthLogbroker - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLogbroker + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthLogbroker + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLogbroker = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/objects.pb.go b/vendor/github.com/docker/swarmkit/api/objects.pb.go index 41099f206a..743e6f9003 100644 --- a/vendor/github.com/docker/swarmkit/api/objects.pb.go +++ b/vendor/github.com/docker/swarmkit/api/objects.pb.go @@ -14,6 +14,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -27,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 // Meta contains metadata about objects. Every object contains a meta field. type Meta struct { @@ -52,7 +53,7 @@ func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Meta.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 } @@ -124,7 +125,7 @@ func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Node.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 } @@ -191,7 +192,7 @@ func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Service.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 } @@ -236,7 +237,7 @@ func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Endpoint.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 } @@ -284,7 +285,7 @@ func (m *Endpoint_VirtualIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Endpoint_VirtualIP.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 } @@ -380,7 +381,7 @@ func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Task.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 } @@ -428,7 +429,7 @@ func (m *NetworkAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_NetworkAttachment.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 } @@ -484,7 +485,7 @@ func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Network.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 } @@ -556,7 +557,7 @@ func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Cluster.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 } @@ -600,7 +601,7 @@ func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Secret.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 } @@ -642,7 +643,7 @@ func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Config.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 } @@ -690,7 +691,7 @@ func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resource.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 } @@ -731,7 +732,7 @@ func (m *Extension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Extension.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 } @@ -1272,7 +1273,7 @@ func (m *Extension) CopyFrom(src interface{}) { 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 } @@ -1280,45 +1281,56 @@ 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 - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Version.Size())) - n1, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.CreatedAt != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.CreatedAt.Size())) - n2, err := m.CreatedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } if m.UpdatedAt != nil { + { + size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.UpdatedAt.Size())) - n3, err := m.UpdatedAt.MarshalTo(dAtA[i:]) + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n3 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Node) 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 } @@ -1326,107 +1338,129 @@ func (m *Node) Marshal() (dAtA []byte, err error) { } func (m *Node) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n4, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n5, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - if m.Description != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Description.Size())) - n6, err := m.Description.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size())) - n7, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - if m.ManagerStatus != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.ManagerStatus.Size())) - n8, err := m.ManagerStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Attachment != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Attachment.Size())) - n9, err := m.Attachment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - dAtA[i] = 0x42 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Certificate.Size())) - n10, err := m.Certificate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - if m.Role != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Role)) + if m.VXLANUDPPort != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + i-- + dAtA[i] = 0x58 } if len(m.Attachments) > 0 { - for _, msg := range m.Attachments { + for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attachments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x52 - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Role != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x48 + } + { + size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Attachment != nil { + { + size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x3a } - if m.VXLANUDPPort != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + if m.ManagerStatus != nil { + { + size, err := m.ManagerStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - return i, nil + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.Description != nil { + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Service) 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 } @@ -1434,109 +1468,131 @@ func (m *Service) Marshal() (dAtA []byte, err error) { } func (m *Service) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n11, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n12, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - if m.Endpoint != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size())) - n13, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.JobStatus != nil { + { + size, err := m.JobStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x62 } - if m.UpdateStatus != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.UpdateStatus.Size())) - n14, err := m.UpdateStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PreviousSpecVersion != nil { + { + size, err := m.PreviousSpecVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x5a } - if m.PreviousSpec != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpec.Size())) - n15, err := m.PreviousSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.SpecVersion != nil { + { + size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x52 } if m.PendingDelete { - dAtA[i] = 0x38 - i++ + i-- if m.PendingDelete { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } - if m.SpecVersion != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size())) - n16, err := m.SpecVersion.MarshalTo(dAtA[i:]) + if m.PreviousSpec != nil { + { + size, err := m.PreviousSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.UpdateStatus != nil { + { + size, err := m.UpdateStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n16 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - if m.PreviousSpecVersion != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpecVersion.Size())) - n17, err := m.PreviousSpecVersion.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n17 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - if m.JobStatus != nil { - dAtA[i] = 0x62 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.JobStatus.Size())) - n18, err := m.JobStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Endpoint) 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 } @@ -1544,51 +1600,62 @@ func (m *Endpoint) Marshal() (dAtA []byte, err error) { } func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n19, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.VirtualIPs) > 0 { + for iNdEx := len(m.VirtualIPs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VirtualIPs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n19 } if len(m.Ports) > 0 { - for _, msg := range m.Ports { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if len(m.VirtualIPs) > 0 { - for _, msg := range m.VirtualIPs { - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil + return len(dAtA) - i, nil } func (m *Endpoint_VirtualIP) 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 } @@ -1596,29 +1663,36 @@ func (m *Endpoint_VirtualIP) Marshal() (dAtA []byte, err error) { } func (m *Endpoint_VirtualIP) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint_VirtualIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NetworkID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) - } if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintObjects(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.NetworkID) > 0 { + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Task) 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 } @@ -1626,151 +1700,181 @@ func (m *Task) Marshal() (dAtA []byte, err error) { } func (m *Task) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n20, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n21, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - if len(m.ServiceID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.Slot != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Slot)) - } - if len(m.NodeID) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } - dAtA[i] = 0x3a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n22, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - dAtA[i] = 0x42 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.ServiceAnnotations.Size())) - n23, err := m.ServiceAnnotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - dAtA[i] = 0x4a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size())) - n24, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - if m.DesiredState != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState)) - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x5a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.JobIteration != nil { + { + size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - } - if m.Endpoint != nil { - dAtA[i] = 0x62 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size())) - n25, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.LogDriver != nil { - dAtA[i] = 0x6a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.LogDriver.Size())) - n26, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if m.SpecVersion != nil { - dAtA[i] = 0x72 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size())) - n27, err := m.SpecVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } if len(m.AssignedGenericResources) > 0 { - for _, msg := range m.AssignedGenericResources { + for iNdEx := len(m.AssignedGenericResources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AssignedGenericResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x7a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.SpecVersion != nil { + { + size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.LogDriver != nil { + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.Networks) > 0 { + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a } } - if m.JobIteration != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.JobIteration.Size())) - n28, err := m.JobIteration.MarshalTo(dAtA[i:]) + if m.DesiredState != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState)) + i-- + dAtA[i] = 0x50 + } + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n28 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0x4a + { + size, err := m.ServiceAnnotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0x32 + } + if m.Slot != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.Slot)) + i-- + dAtA[i] = 0x28 + } + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NetworkAttachment) 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 } @@ -1778,74 +1882,71 @@ func (m *NetworkAttachment) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachment) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Network.Size())) - n29, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { + if len(m.DriverAttachmentOpts) > 0 { + for k := range m.DriverAttachmentOpts { + v := m.DriverAttachmentOpts[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintObjects(dAtA, i, uint64(len(v))) + i-- 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) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintObjects(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } if len(m.Aliases) > 0 { - for _, s := range m.Aliases { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- dAtA[i] = 0x1a - 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.DriverAttachmentOpts) > 0 { - for k, _ := range m.DriverAttachmentOpts { - dAtA[i] = 0x22 - i++ - v := m.DriverAttachmentOpts[k] - mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v))) - i = encodeVarintObjects(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - return i, nil + if m.Network != nil { + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Network) 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 } @@ -1853,69 +1954,83 @@ func (m *Network) Marshal() (dAtA []byte, err error) { } func (m *Network) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n30, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n30 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n31, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n31 - if m.DriverState != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.DriverState.Size())) - n32, err := m.DriverState.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if m.IPAM != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.IPAM.Size())) - n33, err := m.IPAM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 - } if m.PendingDelete { - dAtA[i] = 0x30 - i++ + i-- if m.PendingDelete { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - return i, nil + if m.IPAM != nil { + { + size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.DriverState != nil { + { + size, err := m.DriverState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Cluster) 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 } @@ -1923,139 +2038,147 @@ func (m *Cluster) Marshal() (dAtA []byte, err error) { } func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.VXLANUDPPort != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + i-- + dAtA[i] = 0x68 } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n34, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.SubnetSize != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize)) + i-- + dAtA[i] = 0x60 } - i += n34 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n35, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.RootCA.Size())) - n36, err := m.RootCA.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 - if len(m.NetworkBootstrapKeys) > 0 { - for _, msg := range m.NetworkBootstrapKeys { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.EncryptionKeyLamportClock != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock)) - } - if len(m.BlacklistedCertificates) > 0 { - for k, _ := range m.BlacklistedCertificates { - dAtA[i] = 0x42 - i++ - v := m.BlacklistedCertificates[k] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovObjects(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + msgSize - i = encodeVarintObjects(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(v.Size())) - n37, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 - } - } - } - if len(m.UnlockKeys) > 0 { - for _, msg := range m.UnlockKeys { - dAtA[i] = 0x4a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.DefaultAddressPool) > 0 { + for iNdEx := len(m.DefaultAddressPool) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultAddressPool[iNdEx]) + copy(dAtA[i:], m.DefaultAddressPool[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.DefaultAddressPool[iNdEx]))) + i-- + dAtA[i] = 0x5a } } if m.FIPS { - dAtA[i] = 0x50 - i++ + i-- if m.FIPS { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x50 } - if len(m.DefaultAddressPool) > 0 { - for _, s := range m.DefaultAddressPool { - dAtA[i] = 0x5a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.UnlockKeys) > 0 { + for iNdEx := len(m.UnlockKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UnlockKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x4a } } - if m.SubnetSize != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize)) + if len(m.BlacklistedCertificates) > 0 { + for k := range m.BlacklistedCertificates { + v := m.BlacklistedCertificates[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintObjects(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } } - if m.VXLANUDPPort != 0 { - dAtA[i] = 0x68 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + if m.EncryptionKeyLamportClock != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock)) + i-- + dAtA[i] = 0x30 } - return i, nil + if len(m.NetworkBootstrapKeys) > 0 { + for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + { + size, err := m.RootCA.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Secret) 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 } @@ -2063,49 +2186,59 @@ func (m *Secret) Marshal() (dAtA []byte, err error) { } func (m *Secret) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n38, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n39, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 if m.Internal { - dAtA[i] = 0x20 - i++ + i-- if m.Internal { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - return i, nil + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Config) 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 } @@ -2113,39 +2246,49 @@ func (m *Config) Marshal() (dAtA []byte, err error) { } func (m *Config) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n40, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n40 + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n41, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n41 - return i, nil + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Resource) 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,55 +2296,68 @@ func (m *Resource) Marshal() (dAtA []byte, err error) { } func (m *Resource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n42, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n43, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n43 - if len(m.Kind) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Payload.Size())) - n44, err := m.Payload.MarshalTo(dAtA[i:]) + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n44 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Extension) 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 } @@ -2209,49 +2365,62 @@ func (m *Extension) Marshal() (dAtA []byte, err error) { } func (m *Extension) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n45, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n45 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n46, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n46 if len(m.Description) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Description) + copy(dAtA[i:], m.Description) i = encodeVarintObjects(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) + i-- + dAtA[i] = 0x22 } - return i, nil + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintObjects(dAtA []byte, offset int, v uint64) int { + offset -= sovObjects(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 *Meta) Size() (n int) { if m == nil { @@ -2675,14 +2844,7 @@ func (m *Extension) Size() (n int) { } func sovObjects(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozObjects(x uint64) (n int) { return sovObjects(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -5329,7 +5491,7 @@ func (this *Meta) String() string { return "nil" } s := strings.Join([]string{`&Meta{`, - `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`, + `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, `CreatedAt:` + strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `}`, @@ -5340,17 +5502,22 @@ func (this *Node) String() string { if this == nil { return "nil" } + repeatedStringForAttachments := "[]*NetworkAttachment{" + for _, f := range this.Attachments { + repeatedStringForAttachments += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," + } + repeatedStringForAttachments += "}" s := strings.Join([]string{`&Node{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`, `Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`, `ManagerStatus:` + strings.Replace(fmt.Sprintf("%v", this.ManagerStatus), "ManagerStatus", "ManagerStatus", 1) + `,`, - `Attachment:` + strings.Replace(fmt.Sprintf("%v", this.Attachment), "NetworkAttachment", "NetworkAttachment", 1) + `,`, - `Certificate:` + strings.Replace(strings.Replace(this.Certificate.String(), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`, + `Attachment:` + strings.Replace(this.Attachment.String(), "NetworkAttachment", "NetworkAttachment", 1) + `,`, + `Certificate:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Certificate), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`, `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Attachments:` + strings.Replace(fmt.Sprintf("%v", this.Attachments), "NetworkAttachment", "NetworkAttachment", 1) + `,`, + `Attachments:` + repeatedStringForAttachments + `,`, `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`, `}`, }, "") @@ -5363,8 +5530,8 @@ func (this *Service) String() string { s := strings.Join([]string{`&Service{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, `UpdateStatus:` + strings.Replace(fmt.Sprintf("%v", this.UpdateStatus), "UpdateStatus", "UpdateStatus", 1) + `,`, `PreviousSpec:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpec), "ServiceSpec", "ServiceSpec", 1) + `,`, `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, @@ -5379,10 +5546,20 @@ func (this *Endpoint) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" + repeatedStringForVirtualIPs := "[]*Endpoint_VirtualIP{" + for _, f := range this.VirtualIPs { + repeatedStringForVirtualIPs += strings.Replace(fmt.Sprintf("%v", f), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + "," + } + repeatedStringForVirtualIPs += "}" s := strings.Join([]string{`&Endpoint{`, `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "EndpointSpec", "EndpointSpec", 1) + `,`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, - `VirtualIPs:` + strings.Replace(fmt.Sprintf("%v", this.VirtualIPs), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `VirtualIPs:` + repeatedStringForVirtualIPs + `,`, `}`, }, "") return s @@ -5402,22 +5579,32 @@ func (this *Task) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachment{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," + } + repeatedStringForNetworks += "}" + repeatedStringForAssignedGenericResources := "[]*GenericResource{" + for _, f := range this.AssignedGenericResources { + repeatedStringForAssignedGenericResources += strings.Replace(fmt.Sprintf("%v", f), "GenericResource", "GenericResource", 1) + "," + } + repeatedStringForAssignedGenericResources += "}" s := strings.Join([]string{`&Task{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`, `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `ServiceAnnotations:` + strings.Replace(strings.Replace(this.ServiceAnnotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `ServiceAnnotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServiceAnnotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`, `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachment", "NetworkAttachment", 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`, - `AssignedGenericResources:` + strings.Replace(fmt.Sprintf("%v", this.AssignedGenericResources), "GenericResource", "GenericResource", 1) + `,`, + `AssignedGenericResources:` + repeatedStringForAssignedGenericResources + `,`, `JobIteration:` + strings.Replace(fmt.Sprintf("%v", this.JobIteration), "Version", "Version", 1) + `,`, `}`, }, "") @@ -5438,7 +5625,7 @@ func (this *NetworkAttachment) String() string { } mapStringForDriverAttachmentOpts += "}" s := strings.Join([]string{`&NetworkAttachment{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`, `DriverAttachmentOpts:` + mapStringForDriverAttachmentOpts + `,`, @@ -5453,7 +5640,7 @@ func (this *Network) String() string { s := strings.Join([]string{`&Network{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`, `DriverState:` + strings.Replace(fmt.Sprintf("%v", this.DriverState), "Driver", "Driver", 1) + `,`, `IPAM:` + strings.Replace(fmt.Sprintf("%v", this.IPAM), "IPAMOptions", "IPAMOptions", 1) + `,`, `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, @@ -5465,6 +5652,16 @@ func (this *Cluster) String() string { if this == nil { return "nil" } + repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" + for _, f := range this.NetworkBootstrapKeys { + repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForNetworkBootstrapKeys += "}" + repeatedStringForUnlockKeys := "[]*EncryptionKey{" + for _, f := range this.UnlockKeys { + repeatedStringForUnlockKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForUnlockKeys += "}" keysForBlacklistedCertificates := make([]string, 0, len(this.BlacklistedCertificates)) for k, _ := range this.BlacklistedCertificates { keysForBlacklistedCertificates = append(keysForBlacklistedCertificates, k) @@ -5478,12 +5675,12 @@ func (this *Cluster) String() string { s := strings.Join([]string{`&Cluster{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, - `RootCA:` + strings.Replace(strings.Replace(this.RootCA.String(), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`, - `NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, + `RootCA:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.RootCA), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`, + `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, `EncryptionKeyLamportClock:` + fmt.Sprintf("%v", this.EncryptionKeyLamportClock) + `,`, `BlacklistedCertificates:` + mapStringForBlacklistedCertificates + `,`, - `UnlockKeys:` + strings.Replace(fmt.Sprintf("%v", this.UnlockKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `UnlockKeys:` + repeatedStringForUnlockKeys + `,`, `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, `DefaultAddressPool:` + fmt.Sprintf("%v", this.DefaultAddressPool) + `,`, `SubnetSize:` + fmt.Sprintf("%v", this.SubnetSize) + `,`, @@ -5499,7 +5696,7 @@ func (this *Secret) String() string { s := strings.Join([]string{`&Secret{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`, `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, `}`, }, "") @@ -5512,7 +5709,7 @@ func (this *Config) String() string { s := strings.Join([]string{`&Config{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -5524,7 +5721,7 @@ func (this *Resource) String() string { s := strings.Join([]string{`&Resource{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, `}`, @@ -5538,7 +5735,7 @@ func (this *Extension) String() string { s := strings.Join([]string{`&Extension{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `}`, }, "") @@ -5692,10 +5889,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6089,10 +6283,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6476,10 +6667,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6633,10 +6821,7 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6750,10 +6935,7 @@ func (m *Endpoint_VirtualIP) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7314,10 +7496,7 @@ func (m *Task) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7577,7 +7756,7 @@ func (m *NetworkAttachment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > postIndex { @@ -7594,10 +7773,7 @@ func (m *NetworkAttachment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7837,10 +8013,7 @@ func (m *Network) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8186,7 +8359,7 @@ func (m *Cluster) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > postIndex { @@ -8327,10 +8500,7 @@ func (m *Cluster) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8498,10 +8668,7 @@ func (m *Secret) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8649,10 +8816,7 @@ func (m *Config) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8868,10 +9032,7 @@ func (m *Resource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -9051,10 +9212,7 @@ func (m *Extension) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -9072,6 +9230,7 @@ func (m *Extension) Unmarshal(dAtA []byte) error { func skipObjects(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 { @@ -9103,10 +9262,8 @@ func skipObjects(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 { @@ -9127,55 +9284,30 @@ func skipObjects(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthObjects } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthObjects - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowObjects - } - 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 := skipObjects(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthObjects - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupObjects + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthObjects + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupObjects = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/raft.pb.go b/vendor/github.com/docker/swarmkit/api/raft.pb.go index 16fb0b0c8e..1c2537f528 100644 --- a/vendor/github.com/docker/swarmkit/api/raft.pb.go +++ b/vendor/github.com/docker/swarmkit/api/raft.pb.go @@ -17,6 +17,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -31,7 +32,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 // StoreActionKind defines the operation to take on the store for the target of // a storage action. @@ -91,7 +92,7 @@ func (m *RaftMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RaftMember.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 } @@ -128,7 +129,7 @@ func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_JoinRequest.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 } @@ -170,7 +171,7 @@ func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_JoinResponse.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 } @@ -206,7 +207,7 @@ func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LeaveRequest.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 } @@ -241,7 +242,7 @@ func (m *LeaveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_LeaveResponse.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 } @@ -277,7 +278,7 @@ func (m *ProcessRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ProcessRaftMessageRequest.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 } @@ -312,7 +313,7 @@ func (m *ProcessRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ProcessRaftMessageResponse.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 } @@ -349,7 +350,7 @@ func (m *StreamRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_StreamRaftMessageRequest.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 } @@ -385,7 +386,7 @@ func (m *StreamRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_StreamRaftMessageResponse.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 } @@ -422,7 +423,7 @@ func (m *ResolveAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ResolveAddressRequest.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 } @@ -459,7 +460,7 @@ func (m *ResolveAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_ResolveAddressResponse.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 } @@ -499,7 +500,7 @@ func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_InternalRaftRequest.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 } @@ -547,7 +548,7 @@ func (m *StoreAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StoreAction.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 } @@ -573,31 +574,31 @@ type isStoreAction_Target interface { } type StoreAction_Node struct { - Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof"` + Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof" json:"node,omitempty"` } type StoreAction_Service struct { - Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof"` + Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof" json:"service,omitempty"` } type StoreAction_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` } type StoreAction_Network struct { - Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof"` + Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof" json:"network,omitempty"` } type StoreAction_Cluster struct { - Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof"` + Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` } type StoreAction_Secret struct { - Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type StoreAction_Resource struct { - Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof"` + Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof" json:"resource,omitempty"` } type StoreAction_Extension struct { - Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof"` + Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof" json:"extension,omitempty"` } type StoreAction_Config struct { - Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*StoreAction_Node) isStoreAction_Target() {} @@ -680,9 +681,9 @@ func (m *StoreAction) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*StoreAction) 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 _StoreAction_OneofMarshaler, _StoreAction_OneofUnmarshaler, _StoreAction_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StoreAction) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*StoreAction_Node)(nil), (*StoreAction_Service)(nil), (*StoreAction_Task)(nil), @@ -695,198 +696,6 @@ func (*StoreAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _StoreAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*StoreAction) - // target - switch x := m.Target.(type) { - case *StoreAction_Node: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Node); err != nil { - return err - } - case *StoreAction_Service: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Service); err != nil { - return err - } - case *StoreAction_Task: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *StoreAction_Network: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Network); err != nil { - return err - } - case *StoreAction_Cluster: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Cluster); err != nil { - return err - } - case *StoreAction_Secret: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *StoreAction_Resource: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Resource); err != nil { - return err - } - case *StoreAction_Extension: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Extension); err != nil { - return err - } - case *StoreAction_Config: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("StoreAction.Target has unexpected type %T", x) - } - return nil -} - -func _StoreAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*StoreAction) - switch tag { - case 2: // target.node - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Node) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Node{msg} - return true, err - case 3: // target.service - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Service) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Service{msg} - return true, err - case 4: // target.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Task{msg} - return true, err - case 5: // target.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Network) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Network{msg} - return true, err - case 6: // target.cluster - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Cluster) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Cluster{msg} - return true, err - case 7: // target.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Secret{msg} - return true, err - case 8: // target.resource - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Resource) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Resource{msg} - return true, err - case 9: // target.extension - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Extension) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Extension{msg} - return true, err - case 10: // target.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Config{msg} - return true, err - default: - return false, nil - } -} - -func _StoreAction_OneofSizer(msg proto.Message) (n int) { - m := msg.(*StoreAction) - // target - switch x := m.Target.(type) { - case *StoreAction_Node: - s := proto.Size(x.Node) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Service: - s := proto.Size(x.Service) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Network: - s := proto.Size(x.Network) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Cluster: - s := proto.Size(x.Cluster) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Resource: - s := proto.Size(x.Resource) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Extension: - s := proto.Size(x.Extension) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Config: - s := proto.Size(x.Config) - 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 -} - func init() { proto.RegisterEnum("docker.swarmkit.v1.StoreActionKind", StoreActionKind_name, StoreActionKind_value) proto.RegisterType((*RaftMember)(nil), "docker.swarmkit.v1.RaftMember") @@ -1375,6 +1184,20 @@ type RaftServer interface { ResolveAddress(context.Context, *ResolveAddressRequest) (*ResolveAddressResponse, error) } +// UnimplementedRaftServer can be embedded to have forward compatible implementations. +type UnimplementedRaftServer struct { +} + +func (*UnimplementedRaftServer) ProcessRaftMessage(ctx context.Context, req *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProcessRaftMessage not implemented") +} +func (*UnimplementedRaftServer) StreamRaftMessage(srv Raft_StreamRaftMessageServer) error { + return status.Errorf(codes.Unimplemented, "method StreamRaftMessage not implemented") +} +func (*UnimplementedRaftServer) ResolveAddress(ctx context.Context, req *ResolveAddressRequest) (*ResolveAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolveAddress not implemented") +} + func RegisterRaftServer(s *grpc.Server, srv RaftServer) { s.RegisterService(&_Raft_serviceDesc, srv) } @@ -1508,6 +1331,17 @@ type RaftMembershipServer interface { Leave(context.Context, *LeaveRequest) (*LeaveResponse, error) } +// UnimplementedRaftMembershipServer can be embedded to have forward compatible implementations. +type UnimplementedRaftMembershipServer struct { +} + +func (*UnimplementedRaftMembershipServer) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Join not implemented") +} +func (*UnimplementedRaftMembershipServer) Leave(ctx context.Context, req *LeaveRequest) (*LeaveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Leave not implemented") +} + func RegisterRaftMembershipServer(s *grpc.Server, srv RaftMembershipServer) { s.RegisterService(&_RaftMembership_serviceDesc, srv) } @@ -1568,7 +1402,7 @@ var _RaftMembership_serviceDesc = grpc.ServiceDesc{ func (m *RaftMember) 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 } @@ -1576,42 +1410,51 @@ func (m *RaftMember) Marshal() (dAtA []byte, err error) { } func (m *RaftMember) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x1a } if len(m.NodeID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintRaft(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0x12 } - if len(m.Addr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.RaftID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Status.Size())) - n1, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - return i, nil + return len(dAtA) - i, nil } func (m *JoinRequest) 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 } @@ -1619,23 +1462,29 @@ func (m *JoinRequest) Marshal() (dAtA []byte, err error) { } func (m *JoinRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Addr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *JoinResponse) 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 } @@ -1643,41 +1492,48 @@ func (m *JoinResponse) Marshal() (dAtA []byte, err error) { } func (m *JoinResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + if len(m.RemovedMembers) > 0 { + for iNdEx := len(m.RemovedMembers) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintRaft(dAtA, i, uint64(m.RemovedMembers[iNdEx])) + i-- + dAtA[i] = 0x18 + } } if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.RemovedMembers) > 0 { - for _, num := range m.RemovedMembers { - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } + if m.RaftID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaveRequest) 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 } @@ -1685,27 +1541,34 @@ func (m *LeaveRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaveResponse) 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 } @@ -1713,17 +1576,22 @@ func (m *LeaveResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ProcessRaftMessageRequest) 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 } @@ -1731,27 +1599,34 @@ func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) { } func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Message != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) - n3, err := m.Message.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessRaftMessageResponse) 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 } @@ -1759,17 +1634,22 @@ func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) { } func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *StreamRaftMessageRequest) 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 } @@ -1777,27 +1657,34 @@ func (m *StreamRaftMessageRequest) Marshal() (dAtA []byte, err error) { } func (m *StreamRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Message != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) - n4, err := m.Message.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StreamRaftMessageResponse) 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 } @@ -1805,17 +1692,22 @@ func (m *StreamRaftMessageResponse) Marshal() (dAtA []byte, err error) { } func (m *StreamRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ResolveAddressRequest) 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 } @@ -1823,22 +1715,27 @@ func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) { } func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ResolveAddressResponse) 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 } @@ -1846,23 +1743,29 @@ func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) { } func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Addr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InternalRaftRequest) 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 } @@ -1870,34 +1773,41 @@ func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { } func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.ID)) - } if len(m.Action) > 0 { - for _, msg := range m.Action { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Action) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Action[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + if m.ID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreAction) 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 } @@ -1905,159 +1815,231 @@ func (m *StoreAction) Marshal() (dAtA []byte, err error) { } func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Action)) - } if m.Target != nil { - nn5, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn5 } - return i, nil + if m.Action != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Node != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) - n6, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Service != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Service.Size())) - n7, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Task.Size())) - n8, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Network != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Network.Size())) - n9, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Cluster != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Cluster.Size())) - n10, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Secret.Size())) - n11, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Resource != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Resource.Size())) - n12, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Extension != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Extension.Size())) - n13, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Config.Size())) - n14, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { + offset -= sovRaft(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 } type raftProxyRaftServer struct { @@ -2693,14 +2675,7 @@ func (m *StoreAction_Config) Size() (n int) { } func sovRaft(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRaft(x uint64) (n int) { return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2713,7 +2688,7 @@ func (this *RaftMember) String() string { `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -2732,9 +2707,14 @@ func (this *JoinResponse) String() string { if this == nil { return "nil" } + repeatedStringForMembers := "[]*RaftMember{" + for _, f := range this.Members { + repeatedStringForMembers += strings.Replace(f.String(), "RaftMember", "RaftMember", 1) + "," + } + repeatedStringForMembers += "}" s := strings.Join([]string{`&JoinResponse{`, `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`, + `Members:` + repeatedStringForMembers + `,`, `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`, `}`, }, "") @@ -2745,7 +2725,7 @@ func (this *LeaveRequest) String() string { return "nil" } s := strings.Join([]string{`&LeaveRequest{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "RaftMember", "RaftMember", 1) + `,`, + `Node:` + strings.Replace(this.Node.String(), "RaftMember", "RaftMember", 1) + `,`, `}`, }, "") return s @@ -2821,9 +2801,14 @@ func (this *InternalRaftRequest) String() string { if this == nil { return "nil" } + repeatedStringForAction := "[]StoreAction{" + for _, f := range this.Action { + repeatedStringForAction += strings.Replace(strings.Replace(f.String(), "StoreAction", "StoreAction", 1), `&`, ``, 1) + "," + } + repeatedStringForAction += "}" s := strings.Join([]string{`&InternalRaftRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Action:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Action), "StoreAction", "StoreAction", 1), `&`, ``, 1) + `,`, + `Action:` + repeatedStringForAction + `,`, `}`, }, "") return s @@ -3088,10 +3073,7 @@ func (m *RaftMember) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3173,10 +3155,7 @@ func (m *JoinRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3355,10 +3334,7 @@ func (m *JoinResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3444,10 +3420,7 @@ func (m *LeaveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3497,10 +3470,7 @@ func (m *LeaveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3586,10 +3556,7 @@ func (m *ProcessRaftMessageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3639,10 +3606,7 @@ func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3728,10 +3692,7 @@ func (m *StreamRaftMessageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3781,10 +3742,7 @@ func (m *StreamRaftMessageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3853,10 +3811,7 @@ func (m *ResolveAddressRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3938,10 +3893,7 @@ func (m *ResolveAddressResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4044,10 +3996,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4431,10 +4380,7 @@ func (m *StoreAction) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4452,6 +4398,7 @@ func (m *StoreAction) Unmarshal(dAtA []byte) error { func skipRaft(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 { @@ -4483,10 +4430,8 @@ func skipRaft(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 { @@ -4507,55 +4452,30 @@ func skipRaft(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRaft } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - 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 := skipRaft(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRaft + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthRaft + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/resource.pb.go b/vendor/github.com/docker/swarmkit/api/resource.pb.go index d68c4bac02..8c9cf71e26 100644 --- a/vendor/github.com/docker/swarmkit/api/resource.pb.go +++ b/vendor/github.com/docker/swarmkit/api/resource.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,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 AttachNetworkRequest struct { Config *NetworkAttachmentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` @@ -52,7 +53,7 @@ func (m *AttachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_AttachNetworkRequest.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 } @@ -88,7 +89,7 @@ func (m *AttachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AttachNetworkResponse.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 } @@ -124,7 +125,7 @@ func (m *DetachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_DetachNetworkRequest.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 } @@ -159,7 +160,7 @@ func (m *DetachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DetachNetworkResponse.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 } @@ -355,6 +356,17 @@ type ResourceAllocatorServer interface { DetachNetwork(context.Context, *DetachNetworkRequest) (*DetachNetworkResponse, error) } +// UnimplementedResourceAllocatorServer can be embedded to have forward compatible implementations. +type UnimplementedResourceAllocatorServer struct { +} + +func (*UnimplementedResourceAllocatorServer) AttachNetwork(ctx context.Context, req *AttachNetworkRequest) (*AttachNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AttachNetwork not implemented") +} +func (*UnimplementedResourceAllocatorServer) DetachNetwork(ctx context.Context, req *DetachNetworkRequest) (*DetachNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DetachNetwork not implemented") +} + func RegisterResourceAllocatorServer(s *grpc.Server, srv ResourceAllocatorServer) { s.RegisterService(&_ResourceAllocator_serviceDesc, srv) } @@ -415,7 +427,7 @@ var _ResourceAllocator_serviceDesc = grpc.ServiceDesc{ func (m *AttachNetworkRequest) 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 } @@ -423,33 +435,41 @@ func (m *AttachNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *AttachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintResource(dAtA, i, uint64(m.Config.Size())) - n1, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintResource(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResource(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AttachNetworkResponse) 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 } @@ -457,23 +477,29 @@ func (m *AttachNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *AttachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.AttachmentID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.AttachmentID) + copy(dAtA[i:], m.AttachmentID) i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i += copy(dAtA[i:], m.AttachmentID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DetachNetworkRequest) 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 } @@ -481,23 +507,29 @@ func (m *DetachNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *DetachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.AttachmentID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.AttachmentID) + copy(dAtA[i:], m.AttachmentID) i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i += copy(dAtA[i:], m.AttachmentID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DetachNetworkResponse) 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 } @@ -505,21 +537,28 @@ func (m *DetachNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *DetachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintResource(dAtA []byte, offset int, v uint64) int { + offset -= sovResource(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 } type raftProxyResourceAllocatorServer struct { @@ -717,14 +756,7 @@ func (m *DetachNetworkResponse) Size() (n int) { } func sovResource(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozResource(x uint64) (n int) { return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -880,10 +912,7 @@ func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -965,10 +994,7 @@ func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1050,10 +1076,7 @@ func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1103,10 +1126,7 @@ func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1124,6 +1144,7 @@ func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error { func skipResource(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 { @@ -1155,10 +1176,8 @@ func skipResource(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 { @@ -1179,55 +1198,30 @@ func skipResource(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthResource } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthResource - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResource - } - 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 := skipResource(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthResource - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupResource + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthResource + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResource = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowResource = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupResource = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/snapshot.pb.go b/vendor/github.com/docker/swarmkit/api/snapshot.pb.go index 0add79d543..e7f1c35e44 100644 --- a/vendor/github.com/docker/swarmkit/api/snapshot.pb.go +++ b/vendor/github.com/docker/swarmkit/api/snapshot.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -22,7 +23,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 Snapshot_Version int32 @@ -73,7 +74,7 @@ func (m *StoreSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StoreSnapshot.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 } @@ -111,7 +112,7 @@ func (m *ClusterSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ClusterSnapshot.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 } @@ -149,7 +150,7 @@ func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Snapshot.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 } @@ -350,7 +351,7 @@ func (m *Snapshot) CopyFrom(src interface{}) { func (m *StoreSnapshot) 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 } @@ -358,125 +359,148 @@ func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) { } func (m *StoreSnapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Nodes) > 0 { - for _, msg := range m.Nodes { - dAtA[i] = 0xa - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Configs) > 0 { + for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - i += n - } - } - if len(m.Services) > 0 { - for _, msg := range m.Services { - dAtA[i] = 0x12 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x1a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - dAtA[i] = 0x22 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Clusters) > 0 { - for _, msg := range m.Clusters { - dAtA[i] = 0x2a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Secrets) > 0 { - for _, msg := range m.Secrets { - dAtA[i] = 0x32 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0x3a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + i-- + dAtA[i] = 0x4a } } if len(m.Extensions) > 0 { - for _, msg := range m.Extensions { + for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Extensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Configs) > 0 { - for _, msg := range m.Configs { - dAtA[i] = 0x4a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x3a } } - return i, nil + if len(m.Secrets) > 0 { + for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Clusters) > 0 { + for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Clusters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Tasks) > 0 { + for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Networks) > 0 { + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ClusterSnapshot) 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 } @@ -484,36 +508,43 @@ func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) { } func (m *ClusterSnapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0xa - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } if len(m.Removed) > 0 { - for _, num := range m.Removed { + for iNdEx := len(m.Removed) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Removed[iNdEx])) + i-- dAtA[i] = 0x10 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(num)) } } - return i, nil + if len(m.Members) > 0 { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *Snapshot) 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 } @@ -521,42 +552,53 @@ func (m *Snapshot) Marshal() (dAtA []byte, err error) { } func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Version != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - dAtA[i] = 0x12 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Membership.Size())) - n1, err := m.Membership.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Store.Size())) - n2, err := m.Store.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Membership.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - i += n2 - return i, nil + i-- + dAtA[i] = 0x12 + if m.Version != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { + offset -= sovSnapshot(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 *StoreSnapshot) Size() (n int) { if m == nil { @@ -658,14 +700,7 @@ func (m *Snapshot) Size() (n int) { } func sovSnapshot(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSnapshot(x uint64) (n int) { return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -674,16 +709,61 @@ func (this *StoreSnapshot) String() string { if this == nil { return "nil" } + repeatedStringForNodes := "[]*Node{" + for _, f := range this.Nodes { + repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + "," + } + repeatedStringForNodes += "}" + repeatedStringForServices := "[]*Service{" + for _, f := range this.Services { + repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + "," + } + repeatedStringForServices += "}" + repeatedStringForNetworks := "[]*Network{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + "," + } + repeatedStringForNetworks += "}" + repeatedStringForTasks := "[]*Task{" + for _, f := range this.Tasks { + repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," + } + repeatedStringForTasks += "}" + repeatedStringForClusters := "[]*Cluster{" + for _, f := range this.Clusters { + repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + "," + } + repeatedStringForClusters += "}" + repeatedStringForSecrets := "[]*Secret{" + for _, f := range this.Secrets { + repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + "," + } + repeatedStringForSecrets += "}" + repeatedStringForResources := "[]*Resource{" + for _, f := range this.Resources { + repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + "," + } + repeatedStringForResources += "}" + repeatedStringForExtensions := "[]*Extension{" + for _, f := range this.Extensions { + repeatedStringForExtensions += strings.Replace(fmt.Sprintf("%v", f), "Extension", "Extension", 1) + "," + } + repeatedStringForExtensions += "}" + repeatedStringForConfigs := "[]*Config{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + "," + } + repeatedStringForConfigs += "}" s := strings.Join([]string{`&StoreSnapshot{`, - `Nodes:` + strings.Replace(fmt.Sprintf("%v", this.Nodes), "Node", "Node", 1) + `,`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "Service", "Service", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "Network", "Network", 1) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, - `Clusters:` + strings.Replace(fmt.Sprintf("%v", this.Clusters), "Cluster", "Cluster", 1) + `,`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "Secret", "Secret", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Extensions:` + strings.Replace(fmt.Sprintf("%v", this.Extensions), "Extension", "Extension", 1) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "Config", "Config", 1) + `,`, + `Nodes:` + repeatedStringForNodes + `,`, + `Services:` + repeatedStringForServices + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Tasks:` + repeatedStringForTasks + `,`, + `Clusters:` + repeatedStringForClusters + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, + `Resources:` + repeatedStringForResources + `,`, + `Extensions:` + repeatedStringForExtensions + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -692,8 +772,13 @@ func (this *ClusterSnapshot) String() string { if this == nil { return "nil" } + repeatedStringForMembers := "[]*RaftMember{" + for _, f := range this.Members { + repeatedStringForMembers += strings.Replace(fmt.Sprintf("%v", f), "RaftMember", "RaftMember", 1) + "," + } + repeatedStringForMembers += "}" s := strings.Join([]string{`&ClusterSnapshot{`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`, + `Members:` + repeatedStringForMembers + `,`, `Removed:` + fmt.Sprintf("%v", this.Removed) + `,`, `}`, }, "") @@ -1060,10 +1145,7 @@ func (m *StoreSnapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1223,10 +1305,7 @@ func (m *ClusterSnapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1361,10 +1440,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1382,6 +1458,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { func skipSnapshot(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 { @@ -1413,10 +1490,8 @@ func skipSnapshot(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 { @@ -1437,55 +1512,30 @@ func skipSnapshot(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSnapshot } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - 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 := skipSnapshot(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSnapshot + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSnapshot + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/specs.pb.go b/vendor/github.com/docker/swarmkit/api/specs.pb.go index 82e14798be..c04c13a88e 100644 --- a/vendor/github.com/docker/swarmkit/api/specs.pb.go +++ b/vendor/github.com/docker/swarmkit/api/specs.pb.go @@ -12,6 +12,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -25,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 NodeSpec_Membership int32 @@ -178,7 +179,7 @@ func (m *NodeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NodeSpec.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 } @@ -241,7 +242,7 @@ func (m *ServiceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ServiceSpec.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 } @@ -267,16 +268,16 @@ type isServiceSpec_Mode interface { } type ServiceSpec_Replicated struct { - Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,proto3,oneof"` + Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,proto3,oneof" json:"replicated,omitempty"` } type ServiceSpec_Global struct { - Global *GlobalService `protobuf:"bytes,4,opt,name=global,proto3,oneof"` + Global *GlobalService `protobuf:"bytes,4,opt,name=global,proto3,oneof" json:"global,omitempty"` } type ServiceSpec_ReplicatedJob struct { - ReplicatedJob *ReplicatedJob `protobuf:"bytes,10,opt,name=replicated_job,json=replicatedJob,proto3,oneof"` + ReplicatedJob *ReplicatedJob `protobuf:"bytes,10,opt,name=replicated_job,json=replicatedJob,proto3,oneof" json:"replicated_job,omitempty"` } type ServiceSpec_GlobalJob struct { - GlobalJob *GlobalJob `protobuf:"bytes,11,opt,name=global_job,json=globalJob,proto3,oneof"` + GlobalJob *GlobalJob `protobuf:"bytes,11,opt,name=global_job,json=globalJob,proto3,oneof" json:"global_job,omitempty"` } func (*ServiceSpec_Replicated) isServiceSpec_Mode() {} @@ -319,9 +320,9 @@ func (m *ServiceSpec) GetGlobalJob() *GlobalJob { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ServiceSpec) 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 _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ServiceSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ServiceSpec_Replicated)(nil), (*ServiceSpec_Global)(nil), (*ServiceSpec_ReplicatedJob)(nil), @@ -329,108 +330,6 @@ func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _ServiceSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ServiceSpec) - // mode - switch x := m.Mode.(type) { - case *ServiceSpec_Replicated: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Replicated); err != nil { - return err - } - case *ServiceSpec_Global: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Global); err != nil { - return err - } - case *ServiceSpec_ReplicatedJob: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ReplicatedJob); err != nil { - return err - } - case *ServiceSpec_GlobalJob: - _ = b.EncodeVarint(11<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.GlobalJob); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ServiceSpec.Mode has unexpected type %T", x) - } - return nil -} - -func _ServiceSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ServiceSpec) - switch tag { - case 3: // mode.replicated - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ReplicatedService) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_Replicated{msg} - return true, err - case 4: // mode.global - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GlobalService) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_Global{msg} - return true, err - case 10: // mode.replicated_job - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ReplicatedJob) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_ReplicatedJob{msg} - return true, err - case 11: // mode.global_job - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GlobalJob) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_GlobalJob{msg} - return true, err - default: - return false, nil - } -} - -func _ServiceSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ServiceSpec) - // mode - switch x := m.Mode.(type) { - case *ServiceSpec_Replicated: - s := proto.Size(x.Replicated) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_Global: - s := proto.Size(x.Global) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_ReplicatedJob: - s := proto.Size(x.ReplicatedJob) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_GlobalJob: - s := proto.Size(x.GlobalJob) - 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 -} - // ReplicatedService sets the reconciliation target to certain number of replicas. type ReplicatedService struct { Replicas uint64 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` @@ -449,7 +348,7 @@ func (m *ReplicatedService) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ReplicatedService.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 } @@ -485,7 +384,7 @@ func (m *GlobalService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_GlobalService.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 } @@ -530,7 +429,7 @@ func (m *ReplicatedJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ReplicatedJob.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 } @@ -567,7 +466,7 @@ func (m *GlobalJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GlobalJob.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 } @@ -634,7 +533,7 @@ func (m *TaskSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TaskSpec.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 } @@ -660,13 +559,13 @@ type isTaskSpec_Runtime interface { } type TaskSpec_Attachment struct { - Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,proto3,oneof"` + Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,proto3,oneof" json:"attachment,omitempty"` } type TaskSpec_Container struct { - Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,proto3,oneof"` + Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,proto3,oneof" json:"container,omitempty"` } type TaskSpec_Generic struct { - Generic *GenericRuntimeSpec `protobuf:"bytes,10,opt,name=generic,proto3,oneof"` + Generic *GenericRuntimeSpec `protobuf:"bytes,10,opt,name=generic,proto3,oneof" json:"generic,omitempty"` } func (*TaskSpec_Attachment) isTaskSpec_Runtime() {} @@ -701,99 +600,15 @@ func (m *TaskSpec) GetGeneric() *GenericRuntimeSpec { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*TaskSpec) 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 _TaskSpec_OneofMarshaler, _TaskSpec_OneofUnmarshaler, _TaskSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TaskSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*TaskSpec_Attachment)(nil), (*TaskSpec_Container)(nil), (*TaskSpec_Generic)(nil), } } -func _TaskSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*TaskSpec) - // runtime - switch x := m.Runtime.(type) { - case *TaskSpec_Attachment: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Attachment); err != nil { - return err - } - case *TaskSpec_Container: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Container); err != nil { - return err - } - case *TaskSpec_Generic: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Generic); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("TaskSpec.Runtime has unexpected type %T", x) - } - return nil -} - -func _TaskSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*TaskSpec) - switch tag { - case 8: // runtime.attachment - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NetworkAttachmentSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Attachment{msg} - return true, err - case 1: // runtime.container - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ContainerSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Container{msg} - return true, err - case 10: // runtime.generic - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GenericRuntimeSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Generic{msg} - return true, err - default: - return false, nil - } -} - -func _TaskSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*TaskSpec) - // runtime - switch x := m.Runtime.(type) { - case *TaskSpec_Attachment: - s := proto.Size(x.Attachment) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *TaskSpec_Container: - s := proto.Size(x.Container) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *TaskSpec_Generic: - s := proto.Size(x.Generic) - 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 ResourceReference struct { ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ResourceType ResourceType `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=docker.swarmkit.v1.ResourceType" json:"resource_type,omitempty"` @@ -812,7 +627,7 @@ func (m *ResourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ResourceReference.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 } @@ -849,7 +664,7 @@ func (m *GenericRuntimeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GenericRuntimeSpec.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 } @@ -889,7 +704,7 @@ func (m *NetworkAttachmentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_NetworkAttachmentSpec.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 } @@ -1041,7 +856,7 @@ func (m *ContainerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ContainerSpec.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 } @@ -1082,7 +897,7 @@ func (m *ContainerSpec_PullOptions) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ContainerSpec_PullOptions.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 } @@ -1127,7 +942,7 @@ func (m *ContainerSpec_DNSConfig) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_ContainerSpec_DNSConfig.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 } @@ -1165,7 +980,7 @@ func (m *ContainerSpec_Ulimit) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ContainerSpec_Ulimit.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 } @@ -1206,7 +1021,7 @@ func (m *EndpointSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_EndpointSpec.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 } @@ -1269,7 +1084,7 @@ func (m *NetworkSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_NetworkSpec.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 } @@ -1295,7 +1110,7 @@ type isNetworkSpec_ConfigFrom interface { } type NetworkSpec_Network struct { - Network string `protobuf:"bytes,8,opt,name=network,proto3,oneof"` + Network string `protobuf:"bytes,8,opt,name=network,proto3,oneof" json:"network,omitempty"` } func (*NetworkSpec_Network) isNetworkSpec_ConfigFrom() {} @@ -1314,57 +1129,13 @@ func (m *NetworkSpec) GetNetwork() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*NetworkSpec) 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 _NetworkSpec_OneofMarshaler, _NetworkSpec_OneofUnmarshaler, _NetworkSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NetworkSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*NetworkSpec_Network)(nil), } } -func _NetworkSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*NetworkSpec) - // config_from - switch x := m.ConfigFrom.(type) { - case *NetworkSpec_Network: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Network) - case nil: - default: - return fmt.Errorf("NetworkSpec.ConfigFrom has unexpected type %T", x) - } - return nil -} - -func _NetworkSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*NetworkSpec) - switch tag { - case 8: // config_from.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.ConfigFrom = &NetworkSpec_Network{x} - return true, err - default: - return false, nil - } -} - -func _NetworkSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*NetworkSpec) - // config_from - switch x := m.ConfigFrom.(type) { - case *NetworkSpec_Network: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Network))) - n += len(x.Network) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // ClusterSpec specifies global cluster settings. type ClusterSpec struct { Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` @@ -1399,7 +1170,7 @@ func (m *ClusterSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ClusterSpec.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 } @@ -1446,7 +1217,7 @@ func (m *SecretSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecretSpec.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 } @@ -1493,7 +1264,7 @@ func (m *ConfigSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ConfigSpec.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 } @@ -2260,7 +2031,7 @@ func (m *ConfigSpec) CopyFrom(src interface{}) { func (m *NodeSpec) 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 } @@ -2268,40 +2039,47 @@ func (m *NodeSpec) Marshal() (dAtA []byte, err error) { } func (m *NodeSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n1, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.DesiredRole != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DesiredRole)) + if m.Availability != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) + i-- + dAtA[i] = 0x20 } if m.Membership != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Membership)) + i-- + dAtA[i] = 0x18 } - if m.Availability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) + if m.DesiredRole != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.DesiredRole)) + i-- + dAtA[i] = 0x10 } - return i, nil + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ServiceSpec) 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 } @@ -2309,138 +2087,185 @@ func (m *ServiceSpec) Marshal() (dAtA []byte, err error) { } func (m *ServiceSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n2, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Task.Size())) - n3, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 if m.Mode != nil { - nn4, err := m.Mode.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Mode.Size() + i -= size + if _, err := m.Mode.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn4 } - if m.Update != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Update.Size())) - n5, err := m.Update.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Rollback != nil { + { + size, err := m.Rollback.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x4a } if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Endpoint.Size())) - n6, err := m.Endpoint.MarshalTo(dAtA[i:]) + } + if len(m.Networks) > 0 { + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.Update != nil { + { + size, err := m.Update.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n6 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - if m.Rollback != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Rollback.Size())) - n7, err := m.Rollback.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x12 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n7 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ServiceSpec_Replicated) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_Replicated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Replicated != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Replicated.Size())) - n8, err := m.Replicated.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Replicated.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_Global) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_Global) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Global != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Global.Size())) - n9, err := m.Global.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Global.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ReplicatedJob != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.ReplicatedJob.Size())) - n10, err := m.ReplicatedJob.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ReplicatedJob.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_GlobalJob) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.GlobalJob != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.GlobalJob.Size())) - n11, err := m.GlobalJob.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.GlobalJob.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x5a } - return i, nil + return len(dAtA) - i, nil } func (m *ReplicatedService) 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 } @@ -2448,22 +2273,27 @@ func (m *ReplicatedService) Marshal() (dAtA []byte, err error) { } func (m *ReplicatedService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReplicatedService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Replicas != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Replicas)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *GlobalService) 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,17 +2301,22 @@ func (m *GlobalService) Marshal() (dAtA []byte, err error) { } func (m *GlobalService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ReplicatedJob) 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 } @@ -2489,27 +2324,32 @@ func (m *ReplicatedJob) Marshal() (dAtA []byte, err error) { } func (m *ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MaxConcurrent != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.MaxConcurrent)) - } if m.TotalCompletions != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.TotalCompletions)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.MaxConcurrent != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.MaxConcurrent)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *GlobalJob) 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 } @@ -2517,17 +2357,22 @@ func (m *GlobalJob) Marshal() (dAtA []byte, err error) { } func (m *GlobalJob) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec) 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 } @@ -2535,135 +2380,175 @@ func (m *TaskSpec) Marshal() (dAtA []byte, err error) { } func (m *TaskSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.ResourceReferences) > 0 { + for iNdEx := len(m.ResourceReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } if m.Runtime != nil { - nn12, err := m.Runtime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn12 - } - if m.Resources != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Resources.Size())) - n13, err := m.Resources.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.Restart != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Restart.Size())) - n14, err := m.Restart.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.Placement != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Placement.Size())) - n15, err := m.Placement.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.LogDriver != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.LogDriver.Size())) - n16, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { + { + size := m.Runtime.Size() + i -= size + if _, err := m.Runtime.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i += n } } if m.ForceUpdate != 0 { - dAtA[i] = 0x48 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.ForceUpdate)) + i-- + dAtA[i] = 0x48 } - if len(m.ResourceReferences) > 0 { - for _, msg := range m.ResourceReferences { - dAtA[i] = 0x5a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if len(m.Networks) > 0 { + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.LogDriver != nil { + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 } - return i, nil + if m.Placement != nil { + { + size, err := m.Placement.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Restart != nil { + { + size, err := m.Restart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil } func (m *TaskSpec_Container) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Container != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Container.Size())) - n17, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec_Attachment) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Attachment != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Attachment.Size())) - n18, err := m.Attachment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec_Generic) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Generic) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Generic != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Generic.Size())) - n19, err := m.Generic.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Generic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func (m *ResourceReference) 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 } @@ -2671,28 +2556,34 @@ func (m *ResourceReference) Marshal() (dAtA []byte, err error) { } func (m *ResourceReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) - } if m.ResourceType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.ResourceType)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ResourceID) > 0 { + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.ResourceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GenericRuntimeSpec) 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 } @@ -2700,33 +2591,41 @@ func (m *GenericRuntimeSpec) Marshal() (dAtA []byte, err error) { } func (m *GenericRuntimeSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericRuntimeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Payload != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Payload.Size())) - n20, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NetworkAttachmentSpec) 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 } @@ -2734,23 +2633,29 @@ func (m *NetworkAttachmentSpec) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachmentSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachmentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintSpecs(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec) 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 } @@ -2758,362 +2663,354 @@ func (m *ContainerSpec) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Image) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Image))) - i += copy(dAtA[i:], m.Image) - } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - i = encodeVarintSpecs(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.Command) > 0 { - for _, s := range m.Command { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.Ulimits) > 0 { + for iNdEx := len(m.Ulimits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ulimits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Args) > 0 { - for _, s := range m.Args { - 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 len(m.Env) > 0 { - for _, s := range m.Env { - 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) - } - } - if len(m.Dir) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Dir))) - i += copy(dAtA[i:], m.Dir) - } - if len(m.User) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Mounts) > 0 { - for _, msg := range m.Mounts { - dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.StopGracePeriod != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.StopGracePeriod.Size())) - n21, err := m.StopGracePeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.PullOptions != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.PullOptions.Size())) - n22, err := m.PullOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if len(m.Groups) > 0 { - for _, s := range m.Groups { - dAtA[i] = 0x5a - 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.Secrets) > 0 { - for _, msg := range m.Secrets { - dAtA[i] = 0x62 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.TTY { - dAtA[i] = 0x68 - i++ - if m.TTY { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if len(m.Hostname) > 0 { - dAtA[i] = 0x72 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hostname))) - i += copy(dAtA[i:], m.Hostname) - } - if m.DNSConfig != nil { - dAtA[i] = 0x7a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DNSConfig.Size())) - n23, err := m.DNSConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.Healthcheck != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Healthcheck.Size())) - n24, err := m.Healthcheck.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0x8a - i++ + i-- dAtA[i] = 0x1 - 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) + i-- + dAtA[i] = 0xea } } - if m.OpenStdin { - dAtA[i] = 0x90 - i++ - dAtA[i] = 0x1 - i++ - if m.OpenStdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.CapabilityDrop) > 0 { + for iNdEx := len(m.CapabilityDrop) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityDrop[iNdEx]) + copy(dAtA[i:], m.CapabilityDrop[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityDrop[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 } - i++ + } + if len(m.CapabilityAdd) > 0 { + for iNdEx := len(m.CapabilityAdd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityAdd[iNdEx]) + copy(dAtA[i:], m.CapabilityAdd[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityAdd[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + } + if len(m.Sysctls) > 0 { + for k := range m.Sysctls { + v := m.Sysctls[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintSpecs(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSpecs(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if m.PidsLimit != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.PidsLimit)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 + } + if m.Isolation != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Isolation)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc0 + } + if m.Init != nil { + { + size, err := m.Init.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.Privileges != nil { + { + size, err := m.Privileges.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(m.Configs) > 0 { + for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } + if len(m.StopSignal) > 0 { + i -= len(m.StopSignal) + copy(dAtA[i:], m.StopSignal) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.StopSignal))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 } if m.ReadOnly { - dAtA[i] = 0x98 - i++ - dAtA[i] = 0x1 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.StopSignal) > 0 { - dAtA[i] = 0xa2 - i++ + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.StopSignal))) - i += copy(dAtA[i:], m.StopSignal) + i-- + dAtA[i] = 0x98 } - if len(m.Configs) > 0 { - for _, msg := range m.Configs { - dAtA[i] = 0xaa - i++ + if m.OpenStdin { + i-- + if m.OpenStdin { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x8a + } + } + if m.Healthcheck != nil { + { + size, err := m.Healthcheck.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.DNSConfig != nil { + { + size, err := m.DNSConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Hostname) > 0 { + i -= len(m.Hostname) + copy(dAtA[i:], m.Hostname) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hostname))) + i-- + dAtA[i] = 0x72 + } + if m.TTY { + i-- + if m.TTY { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if len(m.Secrets) > 0 { + for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 } } - if m.Privileges != nil { - dAtA[i] = 0xb2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Privileges.Size())) - n25, err := m.Privileges.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Groups[iNdEx]) + copy(dAtA[i:], m.Groups[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Groups[iNdEx]))) + i-- + dAtA[i] = 0x5a } - i += n25 } - if m.Init != nil { - dAtA[i] = 0xba - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Init.Size())) - n26, err := m.Init.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PullOptions != nil { + { + size, err := m.PullOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x52 } - if m.Isolation != 0 { - dAtA[i] = 0xc0 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Isolation)) + if m.StopGracePeriod != nil { + { + size, err := m.StopGracePeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a } - if m.PidsLimit != 0 { - dAtA[i] = 0xc8 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.PidsLimit)) + if len(m.Mounts) > 0 { + 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 = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } } - if len(m.Sysctls) > 0 { - for k, _ := range m.Sysctls { - dAtA[i] = 0xd2 - i++ - dAtA[i] = 0x1 - i++ - v := m.Sysctls[k] - mapSize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - i = encodeVarintSpecs(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x3a + } + if len(m.Dir) > 0 { + i -= len(m.Dir) + copy(dAtA[i:], m.Dir) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Dir))) + i-- + dAtA[i] = 0x32 + } + 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 = encodeVarintSpecs(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + 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 = encodeVarintSpecs(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Command) > 0 { + for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Command[iNdEx]) + copy(dAtA[i:], m.Command[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Command[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSpecs(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.CapabilityAdd) > 0 { - for _, s := range m.CapabilityAdd { - dAtA[i] = 0xda - i++ - dAtA[i] = 0x1 - 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.Image) > 0 { + i -= len(m.Image) + copy(dAtA[i:], m.Image) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Image))) + i-- + dAtA[i] = 0xa } - if len(m.CapabilityDrop) > 0 { - for _, s := range m.CapabilityDrop { - dAtA[i] = 0xe2 - i++ - dAtA[i] = 0x1 - 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.Ulimits) > 0 { - for _, msg := range m.Ulimits { - dAtA[i] = 0xea - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_PullOptions) 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 } @@ -3121,25 +3018,31 @@ func (m *ContainerSpec_PullOptions) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_PullOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_PullOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.RegistryAuth) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4 - i++ + i -= len(m.RegistryAuth) + copy(dAtA[i:], m.RegistryAuth) i = encodeVarintSpecs(dAtA, i, uint64(len(m.RegistryAuth))) - i += copy(dAtA[i:], m.RegistryAuth) + i-- + dAtA[i] = 0x4 + i-- + dAtA[i] = 0x82 } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_DNSConfig) 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 } @@ -3147,62 +3050,49 @@ func (m *ContainerSpec_DNSConfig) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_DNSConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_DNSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Nameservers) > 0 { - for _, s := range m.Nameservers { - 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 len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Options[iNdEx]) + copy(dAtA[i:], m.Options[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Options[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.Search) > 0 { - for _, s := range m.Search { + for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Search[iNdEx]) + copy(dAtA[i:], m.Search[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Search[iNdEx]))) + i-- 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.Options) > 0 { - for _, s := range m.Options { - dAtA[i] = 0x1a - 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.Nameservers) > 0 { + for iNdEx := len(m.Nameservers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Nameservers[iNdEx]) + copy(dAtA[i:], m.Nameservers[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Nameservers[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_Ulimit) 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 } @@ -3210,33 +3100,39 @@ func (m *ContainerSpec_Ulimit) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_Ulimit) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_Ulimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.Hard != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Hard)) + i-- + dAtA[i] = 0x18 } if m.Soft != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Soft)) + i-- + dAtA[i] = 0x10 } - if m.Hard != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Hard)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSpec) 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 } @@ -3244,34 +3140,41 @@ func (m *EndpointSpec) Marshal() (dAtA []byte, err error) { } func (m *EndpointSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Mode != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Mode)) - } if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + if m.Mode != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *NetworkSpec) 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 } @@ -3279,100 +3182,119 @@ func (m *NetworkSpec) Marshal() (dAtA []byte, err error) { } func (m *NetworkSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n27, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 - if m.DriverConfig != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DriverConfig.Size())) - n28, err := m.DriverConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ConfigFrom != nil { + { + size := m.ConfigFrom.Size() + i -= size + if _, err := m.ConfigFrom.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n28 - } - if m.Ipv6Enabled { - dAtA[i] = 0x18 - i++ - if m.Ipv6Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Internal { - dAtA[i] = 0x20 - i++ - if m.Internal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IPAM != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.IPAM.Size())) - n29, err := m.IPAM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.Attachable { - dAtA[i] = 0x30 - i++ - if m.Attachable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ } if m.Ingress { - dAtA[i] = 0x38 - i++ + i-- if m.Ingress { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } - if m.ConfigFrom != nil { - nn30, err := m.ConfigFrom.MarshalTo(dAtA[i:]) + if m.Attachable { + i-- + if m.Attachable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IPAM != nil { + { + size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Internal { + i-- + if m.Internal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Ipv6Enabled { + i-- + if m.Ipv6Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.DriverConfig != nil { + { + size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += nn30 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *NetworkSpec_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x42 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkSpec_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Network) + copy(dAtA[i:], m.Network) i = encodeVarintSpecs(dAtA, i, uint64(len(m.Network))) - i += copy(dAtA[i:], m.Network) - return i, nil + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil } func (m *ClusterSpec) 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,81 +3302,102 @@ func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { } func (m *ClusterSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n31, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.EncryptionConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n31 - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.AcceptancePolicy.Size())) - n32, err := m.AcceptancePolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n32 - dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Orchestration.Size())) - n33, err := m.Orchestration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Raft.Size())) - n34, err := m.Raft.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n34 - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Dispatcher.Size())) - n35, err := m.Dispatcher.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.CAConfig.Size())) - n36, err := m.CAConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.TaskDefaults.Size())) - n37, err := m.TaskDefaults.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.EncryptionConfig.Size())) - n38, err := m.EncryptionConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.TaskDefaults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n38 - return i, nil + i-- + dAtA[i] = 0x3a + { + size, err := m.CAConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size, err := m.Dispatcher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.Raft.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Orchestration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.AcceptancePolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SecretSpec) 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 } @@ -3462,51 +3405,63 @@ func (m *SecretSpec) Marshal() (dAtA []byte, err error) { } func (m *SecretSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n39, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 - if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + if m.Driver != nil { + { + size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.Templating != nil { + { + size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Templating.Size())) - n40, err := m.Templating.MarshalTo(dAtA[i:]) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n40 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - if m.Driver != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Driver.Size())) - n41, err := m.Driver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n41 - } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ConfigSpec) 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 } @@ -3514,45 +3469,57 @@ func (m *ConfigSpec) Marshal() (dAtA []byte, err error) { } func (m *ConfigSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n42, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 - if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if m.Templating != nil { + { + size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Templating.Size())) - n43, err := m.Templating.MarshalTo(dAtA[i:]) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n43 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintSpecs(dAtA []byte, offset int, v uint64) int { + offset -= sovSpecs(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 *NodeSpec) Size() (n int) { if m == nil { @@ -4165,14 +4132,7 @@ func (m *ConfigSpec) Size() (n int) { } func sovSpecs(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSpecs(x uint64) (n int) { return sovSpecs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4182,7 +4142,7 @@ func (this *NodeSpec) String() string { return "nil" } s := strings.Join([]string{`&NodeSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `DesiredRole:` + fmt.Sprintf("%v", this.DesiredRole) + `,`, `Membership:` + fmt.Sprintf("%v", this.Membership) + `,`, `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`, @@ -4194,13 +4154,18 @@ func (this *ServiceSpec) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&ServiceSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Task:` + strings.Replace(strings.Replace(this.Task.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "UpdateConfig", "UpdateConfig", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "EndpointSpec", "EndpointSpec", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "EndpointSpec", "EndpointSpec", 1) + `,`, `Rollback:` + strings.Replace(fmt.Sprintf("%v", this.Rollback), "UpdateConfig", "UpdateConfig", 1) + `,`, `}`, }, "") @@ -4289,15 +4254,25 @@ func (this *TaskSpec) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," + } + repeatedStringForNetworks += "}" + repeatedStringForResourceReferences := "[]ResourceReference{" + for _, f := range this.ResourceReferences { + repeatedStringForResourceReferences += strings.Replace(strings.Replace(f.String(), "ResourceReference", "ResourceReference", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceReferences += "}" s := strings.Join([]string{`&TaskSpec{`, `Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`, `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "ResourceRequirements", 1) + `,`, `Restart:` + strings.Replace(fmt.Sprintf("%v", this.Restart), "RestartPolicy", "RestartPolicy", 1) + `,`, `Placement:` + strings.Replace(fmt.Sprintf("%v", this.Placement), "Placement", "Placement", 1) + `,`, `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `ForceUpdate:` + fmt.Sprintf("%v", this.ForceUpdate) + `,`, - `ResourceReferences:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ResourceReferences), "ResourceReference", "ResourceReference", 1), `&`, ``, 1) + `,`, + `ResourceReferences:` + repeatedStringForResourceReferences + `,`, `}`, }, "") return s @@ -4368,6 +4343,26 @@ func (this *ContainerSpec) String() string { if this == nil { return "nil" } + repeatedStringForMounts := "[]Mount{" + for _, f := range this.Mounts { + repeatedStringForMounts += fmt.Sprintf("%v", f) + "," + } + repeatedStringForMounts += "}" + repeatedStringForSecrets := "[]*SecretReference{" + for _, f := range this.Secrets { + repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "SecretReference", "SecretReference", 1) + "," + } + repeatedStringForSecrets += "}" + repeatedStringForConfigs := "[]*ConfigReference{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "ConfigReference", "ConfigReference", 1) + "," + } + repeatedStringForConfigs += "}" + repeatedStringForUlimits := "[]*ContainerSpec_Ulimit{" + for _, f := range this.Ulimits { + repeatedStringForUlimits += strings.Replace(fmt.Sprintf("%v", f), "ContainerSpec_Ulimit", "ContainerSpec_Ulimit", 1) + "," + } + repeatedStringForUlimits += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -4396,11 +4391,11 @@ func (this *ContainerSpec) String() string { `Env:` + fmt.Sprintf("%v", this.Env) + `,`, `Dir:` + fmt.Sprintf("%v", this.Dir) + `,`, `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Mounts:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1), `&`, ``, 1) + `,`, + `Mounts:` + repeatedStringForMounts + `,`, `StopGracePeriod:` + strings.Replace(fmt.Sprintf("%v", this.StopGracePeriod), "Duration", "types.Duration", 1) + `,`, `PullOptions:` + strings.Replace(fmt.Sprintf("%v", this.PullOptions), "ContainerSpec_PullOptions", "ContainerSpec_PullOptions", 1) + `,`, `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "SecretReference", "SecretReference", 1) + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, `TTY:` + fmt.Sprintf("%v", this.TTY) + `,`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, `DNSConfig:` + strings.Replace(fmt.Sprintf("%v", this.DNSConfig), "ContainerSpec_DNSConfig", "ContainerSpec_DNSConfig", 1) + `,`, @@ -4409,7 +4404,7 @@ func (this *ContainerSpec) String() string { `OpenStdin:` + fmt.Sprintf("%v", this.OpenStdin) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `StopSignal:` + fmt.Sprintf("%v", this.StopSignal) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "ConfigReference", "ConfigReference", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `Privileges:` + strings.Replace(fmt.Sprintf("%v", this.Privileges), "Privileges", "Privileges", 1) + `,`, `Init:` + strings.Replace(fmt.Sprintf("%v", this.Init), "BoolValue", "types.BoolValue", 1) + `,`, `Isolation:` + fmt.Sprintf("%v", this.Isolation) + `,`, @@ -4417,7 +4412,7 @@ func (this *ContainerSpec) String() string { `Sysctls:` + mapStringForSysctls + `,`, `CapabilityAdd:` + fmt.Sprintf("%v", this.CapabilityAdd) + `,`, `CapabilityDrop:` + fmt.Sprintf("%v", this.CapabilityDrop) + `,`, - `Ulimits:` + strings.Replace(fmt.Sprintf("%v", this.Ulimits), "ContainerSpec_Ulimit", "ContainerSpec_Ulimit", 1) + `,`, + `Ulimits:` + repeatedStringForUlimits + `,`, `}`, }, "") return s @@ -4460,9 +4455,14 @@ func (this *EndpointSpec) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&EndpointSpec{`, `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `}`, }, "") return s @@ -4472,7 +4472,7 @@ func (this *NetworkSpec) String() string { return "nil" } s := strings.Join([]string{`&NetworkSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `DriverConfig:` + strings.Replace(fmt.Sprintf("%v", this.DriverConfig), "Driver", "Driver", 1) + `,`, `Ipv6Enabled:` + fmt.Sprintf("%v", this.Ipv6Enabled) + `,`, `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, @@ -4499,14 +4499,14 @@ func (this *ClusterSpec) String() string { return "nil" } s := strings.Join([]string{`&ClusterSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `AcceptancePolicy:` + strings.Replace(strings.Replace(this.AcceptancePolicy.String(), "AcceptancePolicy", "AcceptancePolicy", 1), `&`, ``, 1) + `,`, - `Orchestration:` + strings.Replace(strings.Replace(this.Orchestration.String(), "OrchestrationConfig", "OrchestrationConfig", 1), `&`, ``, 1) + `,`, - `Raft:` + strings.Replace(strings.Replace(this.Raft.String(), "RaftConfig", "RaftConfig", 1), `&`, ``, 1) + `,`, - `Dispatcher:` + strings.Replace(strings.Replace(this.Dispatcher.String(), "DispatcherConfig", "DispatcherConfig", 1), `&`, ``, 1) + `,`, - `CAConfig:` + strings.Replace(strings.Replace(this.CAConfig.String(), "CAConfig", "CAConfig", 1), `&`, ``, 1) + `,`, - `TaskDefaults:` + strings.Replace(strings.Replace(this.TaskDefaults.String(), "TaskDefaults", "TaskDefaults", 1), `&`, ``, 1) + `,`, - `EncryptionConfig:` + strings.Replace(strings.Replace(this.EncryptionConfig.String(), "EncryptionConfig", "EncryptionConfig", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `AcceptancePolicy:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AcceptancePolicy), "AcceptancePolicy", "AcceptancePolicy", 1), `&`, ``, 1) + `,`, + `Orchestration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Orchestration), "OrchestrationConfig", "OrchestrationConfig", 1), `&`, ``, 1) + `,`, + `Raft:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Raft), "RaftConfig", "RaftConfig", 1), `&`, ``, 1) + `,`, + `Dispatcher:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Dispatcher), "DispatcherConfig", "DispatcherConfig", 1), `&`, ``, 1) + `,`, + `CAConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CAConfig), "CAConfig", "CAConfig", 1), `&`, ``, 1) + `,`, + `TaskDefaults:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.TaskDefaults), "TaskDefaults", "TaskDefaults", 1), `&`, ``, 1) + `,`, + `EncryptionConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EncryptionConfig), "EncryptionConfig", "EncryptionConfig", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4516,7 +4516,7 @@ func (this *SecretSpec) String() string { return "nil" } s := strings.Join([]string{`&SecretSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, @@ -4529,7 +4529,7 @@ func (this *ConfigSpec) String() string { return "nil" } s := strings.Join([]string{`&ConfigSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, `}`, @@ -4669,10 +4669,7 @@ func (m *NodeSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5070,10 +5067,7 @@ func (m *ServiceSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5142,10 +5136,7 @@ func (m *ReplicatedService) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5195,10 +5186,7 @@ func (m *GlobalService) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5286,10 +5274,7 @@ func (m *ReplicatedJob) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5339,10 +5324,7 @@ func (m *GlobalJob) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5728,10 +5710,7 @@ func (m *TaskSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5832,10 +5811,7 @@ func (m *ResourceReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5953,10 +5929,7 @@ func (m *GenericRuntimeSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -6038,10 +6011,7 @@ func (m *NetworkAttachmentSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -6233,7 +6203,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > postIndex { @@ -7064,7 +7034,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > postIndex { @@ -7179,10 +7149,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7264,10 +7231,7 @@ func (m *ContainerSpec_PullOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7413,10 +7377,7 @@ func (m *ContainerSpec_DNSConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7536,10 +7497,7 @@ func (m *ContainerSpec_Ulimit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7642,10 +7600,7 @@ func (m *EndpointSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7912,10 +7867,7 @@ func (m *NetworkSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8229,10 +8181,7 @@ func (m *ClusterSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8421,10 +8370,7 @@ func (m *SecretSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8577,10 +8523,7 @@ func (m *ConfigSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8598,6 +8541,7 @@ func (m *ConfigSpec) Unmarshal(dAtA []byte) error { func skipSpecs(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 { @@ -8629,10 +8573,8 @@ func skipSpecs(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 { @@ -8653,55 +8595,30 @@ func skipSpecs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSpecs } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSpecs - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpecs - } - 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 := skipSpecs(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSpecs - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSpecs + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSpecs + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSpecs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpecs = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSpecs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSpecs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSpecs = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/types.pb.go b/vendor/github.com/docker/swarmkit/api/types.pb.go index 69f052cefa..d941916ff6 100644 --- a/vendor/github.com/docker/swarmkit/api/types.pb.go +++ b/vendor/github.com/docker/swarmkit/api/types.pb.go @@ -14,6 +14,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" os "os" reflect "reflect" strings "strings" @@ -30,7 +31,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 ResourceType int32 @@ -678,7 +679,7 @@ func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Version.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 } @@ -715,7 +716,7 @@ func (m *IndexEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IndexEntry.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 } @@ -757,7 +758,7 @@ func (m *Annotations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_Annotations.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 } @@ -798,7 +799,7 @@ func (m *NamedGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_NamedGenericResource.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 } @@ -839,7 +840,7 @@ func (m *DiscreteGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_DiscreteGenericResource.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 } @@ -880,7 +881,7 @@ func (m *GenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GenericResource.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 } @@ -906,10 +907,10 @@ type isGenericResource_Resource interface { } type GenericResource_NamedResourceSpec struct { - NamedResourceSpec *NamedGenericResource `protobuf:"bytes,1,opt,name=named_resource_spec,json=namedResourceSpec,proto3,oneof"` + NamedResourceSpec *NamedGenericResource `protobuf:"bytes,1,opt,name=named_resource_spec,json=namedResourceSpec,proto3,oneof" json:"named_resource_spec,omitempty"` } type GenericResource_DiscreteResourceSpec struct { - DiscreteResourceSpec *DiscreteGenericResource `protobuf:"bytes,2,opt,name=discrete_resource_spec,json=discreteResourceSpec,proto3,oneof"` + DiscreteResourceSpec *DiscreteGenericResource `protobuf:"bytes,2,opt,name=discrete_resource_spec,json=discreteResourceSpec,proto3,oneof" json:"discrete_resource_spec,omitempty"` } func (*GenericResource_NamedResourceSpec) isGenericResource_Resource() {} @@ -936,80 +937,14 @@ func (m *GenericResource) GetDiscreteResourceSpec() *DiscreteGenericResource { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*GenericResource) 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 _GenericResource_OneofMarshaler, _GenericResource_OneofUnmarshaler, _GenericResource_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GenericResource) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*GenericResource_NamedResourceSpec)(nil), (*GenericResource_DiscreteResourceSpec)(nil), } } -func _GenericResource_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*GenericResource) - // resource - switch x := m.Resource.(type) { - case *GenericResource_NamedResourceSpec: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NamedResourceSpec); err != nil { - return err - } - case *GenericResource_DiscreteResourceSpec: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.DiscreteResourceSpec); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("GenericResource.Resource has unexpected type %T", x) - } - return nil -} - -func _GenericResource_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*GenericResource) - switch tag { - case 1: // resource.named_resource_spec - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NamedGenericResource) - err := b.DecodeMessage(msg) - m.Resource = &GenericResource_NamedResourceSpec{msg} - return true, err - case 2: // resource.discrete_resource_spec - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DiscreteGenericResource) - err := b.DecodeMessage(msg) - m.Resource = &GenericResource_DiscreteResourceSpec{msg} - return true, err - default: - return false, nil - } -} - -func _GenericResource_OneofSizer(msg proto.Message) (n int) { - m := msg.(*GenericResource) - // resource - switch x := m.Resource.(type) { - case *GenericResource_NamedResourceSpec: - s := proto.Size(x.NamedResourceSpec) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *GenericResource_DiscreteResourceSpec: - s := proto.Size(x.DiscreteResourceSpec) - 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 Resources struct { // Amount of CPUs (e.g. 2000000000 = 2 CPU cores) NanoCPUs int64 `protobuf:"varint,1,opt,name=nano_cpus,json=nanoCpus,proto3" json:"nano_cpus,omitempty"` @@ -1032,7 +967,7 @@ func (m *Resources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resources.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 } @@ -1078,7 +1013,7 @@ func (m *ResourceRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ResourceRequirements.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 } @@ -1117,7 +1052,7 @@ func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Platform.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 } @@ -1159,7 +1094,7 @@ func (m *PluginDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_PluginDescription.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 } @@ -1200,7 +1135,7 @@ func (m *EngineDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_EngineDescription.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 } @@ -1248,7 +1183,7 @@ func (m *NodeDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_NodeDescription.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 } @@ -1288,7 +1223,7 @@ func (m *NodeTLSInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_NodeTLSInfo.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 } @@ -1326,7 +1261,7 @@ func (m *RaftMemberStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_RaftMemberStatus.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 } @@ -1365,7 +1300,7 @@ func (m *NodeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NodeStatus.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 } @@ -1404,7 +1339,7 @@ func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Image.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 } @@ -1468,7 +1403,7 @@ func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Mount.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 } @@ -1508,7 +1443,7 @@ func (m *Mount_BindOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_Mount_BindOptions.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 } @@ -1553,7 +1488,7 @@ func (m *Mount_VolumeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Mount_VolumeOptions.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 } @@ -1601,7 +1536,7 @@ func (m *Mount_TmpfsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Mount_TmpfsOptions.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 } @@ -1647,7 +1582,7 @@ func (m *RestartPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RestartPolicy.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 } @@ -1715,7 +1650,7 @@ func (m *UpdateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UpdateConfig.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 } @@ -1767,7 +1702,7 @@ func (m *UpdateStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UpdateStatus.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 } @@ -1806,7 +1741,7 @@ func (m *ContainerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ContainerStatus.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 } @@ -1844,7 +1779,7 @@ func (m *PortStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PortStatus.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 } @@ -1921,7 +1856,7 @@ func (m *TaskStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TaskStatus.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 } @@ -1947,7 +1882,7 @@ type isTaskStatus_RuntimeStatus interface { } type TaskStatus_Container struct { - Container *ContainerStatus `protobuf:"bytes,5,opt,name=container,proto3,oneof"` + Container *ContainerStatus `protobuf:"bytes,5,opt,name=container,proto3,oneof" json:"container,omitempty"` } func (*TaskStatus_Container) isTaskStatus_RuntimeStatus() {} @@ -1966,61 +1901,13 @@ func (m *TaskStatus) GetContainer() *ContainerStatus { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*TaskStatus) 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 _TaskStatus_OneofMarshaler, _TaskStatus_OneofUnmarshaler, _TaskStatus_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TaskStatus) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*TaskStatus_Container)(nil), } } -func _TaskStatus_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*TaskStatus) - // runtime_status - switch x := m.RuntimeStatus.(type) { - case *TaskStatus_Container: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Container); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("TaskStatus.RuntimeStatus has unexpected type %T", x) - } - return nil -} - -func _TaskStatus_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*TaskStatus) - switch tag { - case 5: // runtime_status.container - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ContainerStatus) - err := b.DecodeMessage(msg) - m.RuntimeStatus = &TaskStatus_Container{msg} - return true, err - default: - return false, nil - } -} - -func _TaskStatus_OneofSizer(msg proto.Message) (n int) { - m := msg.(*TaskStatus) - // runtime_status - switch x := m.RuntimeStatus.(type) { - case *TaskStatus_Container: - s := proto.Size(x.Container) - 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 -} - // NetworkAttachmentConfig specifies how a service should be attached to a particular network. // // For now, this is a simple struct, but this can include future information @@ -2053,7 +1940,7 @@ func (m *NetworkAttachmentConfig) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_NetworkAttachmentConfig.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 } @@ -2102,7 +1989,7 @@ func (m *IPAMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IPAMConfig.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 } @@ -2156,7 +2043,7 @@ func (m *PortConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PortConfig.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 } @@ -2197,7 +2084,7 @@ func (m *Driver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Driver.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 } @@ -2234,7 +2121,7 @@ func (m *IPAMOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_IPAMOptions.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 } @@ -2272,7 +2159,7 @@ func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Peer.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 } @@ -2311,7 +2198,7 @@ func (m *WeightedPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WeightedPeer.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 } @@ -2351,7 +2238,7 @@ func (m *IssuanceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_IssuanceStatus.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 } @@ -2387,7 +2274,7 @@ func (m *AcceptancePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_AcceptancePolicy.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 } @@ -2429,7 +2316,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Marshal(b []byte, determinist return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy.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 } @@ -2470,7 +2357,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Marshal(b []byte, dete return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret.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 } @@ -2514,7 +2401,7 @@ func (m *ExternalCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExternalCA.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 } @@ -2567,7 +2454,7 @@ func (m *CAConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CAConfig.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 } @@ -2606,7 +2493,7 @@ func (m *OrchestrationConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_OrchestrationConfig.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 } @@ -2648,7 +2535,7 @@ func (m *TaskDefaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TaskDefaults.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 } @@ -2688,7 +2575,7 @@ func (m *DispatcherConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_DispatcherConfig.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 } @@ -2738,7 +2625,7 @@ func (m *RaftConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RaftConfig.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 } @@ -2777,7 +2664,7 @@ func (m *EncryptionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_EncryptionConfig.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 } @@ -2813,7 +2700,7 @@ func (m *SpreadOver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpreadOver.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 } @@ -2851,7 +2738,7 @@ func (m *PlacementPreference) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PlacementPreference.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 } @@ -2877,7 +2764,7 @@ type isPlacementPreference_Preference interface { } type PlacementPreference_Spread struct { - Spread *SpreadOver `protobuf:"bytes,1,opt,name=spread,proto3,oneof"` + Spread *SpreadOver `protobuf:"bytes,1,opt,name=spread,proto3,oneof" json:"spread,omitempty"` } func (*PlacementPreference_Spread) isPlacementPreference_Preference() {} @@ -2896,61 +2783,13 @@ func (m *PlacementPreference) GetSpread() *SpreadOver { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*PlacementPreference) 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 _PlacementPreference_OneofMarshaler, _PlacementPreference_OneofUnmarshaler, _PlacementPreference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*PlacementPreference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*PlacementPreference_Spread)(nil), } } -func _PlacementPreference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*PlacementPreference) - // Preference - switch x := m.Preference.(type) { - case *PlacementPreference_Spread: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Spread); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("PlacementPreference.Preference has unexpected type %T", x) - } - return nil -} - -func _PlacementPreference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*PlacementPreference) - switch tag { - case 1: // Preference.spread - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SpreadOver) - err := b.DecodeMessage(msg) - m.Preference = &PlacementPreference_Spread{msg} - return true, err - default: - return false, nil - } -} - -func _PlacementPreference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*PlacementPreference) - // Preference - switch x := m.Preference.(type) { - case *PlacementPreference_Spread: - s := proto.Size(x.Spread) - 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 -} - // Placement specifies task distribution constraints. type Placement struct { // Constraints specifies a set of requirements a node should meet for a task. @@ -2980,7 +2819,7 @@ func (m *Placement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Placement.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 } @@ -3020,7 +2859,7 @@ func (m *JoinTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JoinTokens.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 } @@ -3069,7 +2908,7 @@ func (m *RootCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RootCA.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 } @@ -3110,7 +2949,7 @@ func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_Certificate.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 } @@ -3154,7 +2993,7 @@ func (m *EncryptionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_EncryptionKey.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 } @@ -3199,7 +3038,7 @@ func (m *ManagerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ManagerStatus.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 } @@ -3243,7 +3082,7 @@ func (m *FileTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileTarget.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 } @@ -3282,7 +3121,7 @@ func (m *RuntimeTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RuntimeTarget.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 } @@ -3330,7 +3169,7 @@ func (m *SecretReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_SecretReference.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 } @@ -3356,7 +3195,7 @@ type isSecretReference_Target interface { } type SecretReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof"` + File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` } func (*SecretReference_File) isSecretReference_Target() {} @@ -3375,61 +3214,13 @@ func (m *SecretReference) GetFile() *FileTarget { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SecretReference) 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 _SecretReference_OneofMarshaler, _SecretReference_OneofUnmarshaler, _SecretReference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SecretReference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SecretReference_File)(nil), } } -func _SecretReference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SecretReference) - // target - switch x := m.Target.(type) { - case *SecretReference_File: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.File); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("SecretReference.Target has unexpected type %T", x) - } - return nil -} - -func _SecretReference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SecretReference) - switch tag { - case 3: // target.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileTarget) - err := b.DecodeMessage(msg) - m.Target = &SecretReference_File{msg} - return true, err - default: - return false, nil - } -} - -func _SecretReference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SecretReference) - // target - switch x := m.Target.(type) { - case *SecretReference_File: - s := proto.Size(x.File) - 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 -} - // ConfigReference is the linkage between a service and a config that it uses. type ConfigReference struct { // ConfigID represents the ID of the specific Config that we're @@ -3459,7 +3250,7 @@ func (m *ConfigReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ConfigReference.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 } @@ -3485,10 +3276,10 @@ type isConfigReference_Target interface { } type ConfigReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof"` + File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` } type ConfigReference_Runtime struct { - Runtime *RuntimeTarget `protobuf:"bytes,4,opt,name=runtime,proto3,oneof"` + Runtime *RuntimeTarget `protobuf:"bytes,4,opt,name=runtime,proto3,oneof" json:"runtime,omitempty"` } func (*ConfigReference_File) isConfigReference_Target() {} @@ -3515,80 +3306,14 @@ func (m *ConfigReference) GetRuntime() *RuntimeTarget { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ConfigReference) 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 _ConfigReference_OneofMarshaler, _ConfigReference_OneofUnmarshaler, _ConfigReference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ConfigReference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ConfigReference_File)(nil), (*ConfigReference_Runtime)(nil), } } -func _ConfigReference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ConfigReference) - // target - switch x := m.Target.(type) { - case *ConfigReference_File: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.File); err != nil { - return err - } - case *ConfigReference_Runtime: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Runtime); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ConfigReference.Target has unexpected type %T", x) - } - return nil -} - -func _ConfigReference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ConfigReference) - switch tag { - case 3: // target.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileTarget) - err := b.DecodeMessage(msg) - m.Target = &ConfigReference_File{msg} - return true, err - case 4: // target.runtime - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RuntimeTarget) - err := b.DecodeMessage(msg) - m.Target = &ConfigReference_Runtime{msg} - return true, err - default: - return false, nil - } -} - -func _ConfigReference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ConfigReference) - // target - switch x := m.Target.(type) { - case *ConfigReference_File: - s := proto.Size(x.File) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ConfigReference_Runtime: - s := proto.Size(x.Runtime) - 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 -} - // BlacklistedCertificate is a record for a blacklisted certificate. It does not // contain the certificate's CN, because these records are indexed by CN. type BlacklistedCertificate struct { @@ -3611,7 +3336,7 @@ func (m *BlacklistedCertificate) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_BlacklistedCertificate.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 } @@ -3669,7 +3394,7 @@ func (m *HealthConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_HealthConfig.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 } @@ -3707,7 +3432,7 @@ func (m *MaybeEncryptedRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_MaybeEncryptedRecord.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 } @@ -3746,7 +3471,7 @@ func (m *RootRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_RootRotation.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 } @@ -3784,7 +3509,7 @@ func (m *Privileges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Privileges.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 } @@ -3825,7 +3550,7 @@ func (m *Privileges_CredentialSpec) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_Privileges_CredentialSpec.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 } @@ -3851,13 +3576,13 @@ type isPrivileges_CredentialSpec_Source interface { } type Privileges_CredentialSpec_File struct { - File string `protobuf:"bytes,1,opt,name=file,proto3,oneof"` + File string `protobuf:"bytes,1,opt,name=file,proto3,oneof" json:"file,omitempty"` } type Privileges_CredentialSpec_Registry struct { - Registry string `protobuf:"bytes,2,opt,name=registry,proto3,oneof"` + Registry string `protobuf:"bytes,2,opt,name=registry,proto3,oneof" json:"registry,omitempty"` } type Privileges_CredentialSpec_Config struct { - Config string `protobuf:"bytes,3,opt,name=config,proto3,oneof"` + Config string `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Privileges_CredentialSpec_File) isPrivileges_CredentialSpec_Source() {} @@ -3892,87 +3617,15 @@ func (m *Privileges_CredentialSpec) GetConfig() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Privileges_CredentialSpec) 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 _Privileges_CredentialSpec_OneofMarshaler, _Privileges_CredentialSpec_OneofUnmarshaler, _Privileges_CredentialSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Privileges_CredentialSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Privileges_CredentialSpec_File)(nil), (*Privileges_CredentialSpec_Registry)(nil), (*Privileges_CredentialSpec_Config)(nil), } } -func _Privileges_CredentialSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Privileges_CredentialSpec) - // source - switch x := m.Source.(type) { - case *Privileges_CredentialSpec_File: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.File) - case *Privileges_CredentialSpec_Registry: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Registry) - case *Privileges_CredentialSpec_Config: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Config) - case nil: - default: - return fmt.Errorf("Privileges_CredentialSpec.Source has unexpected type %T", x) - } - return nil -} - -func _Privileges_CredentialSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Privileges_CredentialSpec) - switch tag { - case 1: // source.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_File{x} - return true, err - case 2: // source.registry - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_Registry{x} - return true, err - case 3: // source.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_Config{x} - return true, err - default: - return false, nil - } -} - -func _Privileges_CredentialSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Privileges_CredentialSpec) - // source - switch x := m.Source.(type) { - case *Privileges_CredentialSpec_File: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.File))) - n += len(x.File) - case *Privileges_CredentialSpec_Registry: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Registry))) - n += len(x.Registry) - case *Privileges_CredentialSpec_Config: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Config))) - n += len(x.Config) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // SELinuxContext contains the SELinux labels for the container. type Privileges_SELinuxContext struct { Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"` @@ -3995,7 +3648,7 @@ func (m *Privileges_SELinuxContext) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_Privileges_SELinuxContext.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 } @@ -4042,7 +3695,7 @@ func (m *JobStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JobStatus.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 } @@ -5889,7 +5542,7 @@ func (m *JobStatus) CopyFrom(src interface{}) { func (m *Version) 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 } @@ -5897,22 +5550,27 @@ func (m *Version) Marshal() (dAtA []byte, err error) { } func (m *Version) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Index != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *IndexEntry) 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 } @@ -5920,29 +5578,36 @@ func (m *IndexEntry) Marshal() (dAtA []byte, err error) { } func (m *IndexEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } if len(m.Val) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Val) + copy(dAtA[i:], m.Val) i = encodeVarintTypes(dAtA, i, uint64(len(m.Val))) - i += copy(dAtA[i:], m.Val) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Annotations) 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 } @@ -5950,52 +5615,62 @@ func (m *Annotations) Marshal() (dAtA []byte, err error) { } func (m *Annotations) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Annotations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.Indices) > 0 { + for iNdEx := len(m.Indices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Indices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.Indices) > 0 { - for _, msg := range m.Indices { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NamedGenericResource) 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 } @@ -6003,29 +5678,36 @@ func (m *NamedGenericResource) Marshal() (dAtA []byte, err error) { } func (m *NamedGenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NamedGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *DiscreteGenericResource) 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 } @@ -6033,28 +5715,34 @@ func (m *DiscreteGenericResource) Marshal() (dAtA []byte, err error) { } func (m *DiscreteGenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DiscreteGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Value != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GenericResource) 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 } @@ -6062,52 +5750,73 @@ func (m *GenericResource) Marshal() (dAtA []byte, err error) { } func (m *GenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - nn1, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Resource.Size() + i -= size + if _, err := m.Resource.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *GenericResource_NamedResourceSpec) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource_NamedResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NamedResourceSpec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NamedResourceSpec.Size())) - n2, err := m.NamedResourceSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NamedResourceSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GenericResource_DiscreteResourceSpec) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource_DiscreteResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DiscreteResourceSpec != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.DiscreteResourceSpec.Size())) - n3, err := m.DiscreteResourceSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DiscreteResourceSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Resources) 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 } @@ -6115,39 +5824,46 @@ func (m *Resources) Marshal() (dAtA []byte, err error) { } func (m *Resources) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.NanoCPUs != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NanoCPUs)) - } - if m.MemoryBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MemoryBytes)) - } if len(m.Generic) > 0 { - for _, msg := range m.Generic { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Generic) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Generic[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if m.MemoryBytes != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MemoryBytes)) + i-- + dAtA[i] = 0x10 + } + if m.NanoCPUs != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.NanoCPUs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *ResourceRequirements) 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 } @@ -6155,57 +5871,70 @@ func (m *ResourceRequirements) Marshal() (dAtA []byte, err error) { } func (m *ResourceRequirements) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Limits != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Limits.Size())) - n4, err := m.Limits.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.MemorySwappiness != nil { + { + size, err := m.MemorySwappiness.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n4 - } - if m.Reservations != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reservations.Size())) - n5, err := m.Reservations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + i-- + dAtA[i] = 0x22 } if m.SwapBytes != nil { + { + size, err := m.SwapBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SwapBytes.Size())) - n6, err := m.SwapBytes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 } - if m.MemorySwappiness != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MemorySwappiness.Size())) - n7, err := m.MemorySwappiness.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Reservations != nil { + { + size, err := m.Reservations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Limits != nil { + { + size, err := m.Limits.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + 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 } @@ -6213,29 +5942,36 @@ 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 = encodeVarintTypes(dAtA, i, uint64(len(m.Architecture))) - i += copy(dAtA[i:], m.Architecture) - } if len(m.OS) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.OS) + copy(dAtA[i:], m.OS) i = encodeVarintTypes(dAtA, i, uint64(len(m.OS))) - i += copy(dAtA[i:], m.OS) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Architecture) > 0 { + i -= len(m.Architecture) + copy(dAtA[i:], m.Architecture) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Architecture))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PluginDescription) 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 } @@ -6243,29 +5979,36 @@ func (m *PluginDescription) Marshal() (dAtA []byte, err error) { } func (m *PluginDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PluginDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Type) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - } if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *EngineDescription) 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 } @@ -6273,52 +6016,62 @@ func (m *EngineDescription) Marshal() (dAtA []byte, err error) { } func (m *EngineDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EngineDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.EngineVersion) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.EngineVersion))) - i += copy(dAtA[i:], m.EngineVersion) + if len(m.Plugins) > 0 { + for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Plugins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.Plugins) > 0 { - for _, msg := range m.Plugins { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.EngineVersion) > 0 { + i -= len(m.EngineVersion) + copy(dAtA[i:], m.EngineVersion) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EngineVersion))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NodeDescription) 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 } @@ -6326,73 +6079,87 @@ func (m *NodeDescription) Marshal() (dAtA []byte, err error) { } func (m *NodeDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Hostname) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hostname))) - i += copy(dAtA[i:], m.Hostname) - } - if m.Platform != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Platform.Size())) - n8, err := m.Platform.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Resources != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Resources.Size())) - n9, err := m.Resources.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.Engine != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Engine.Size())) - n10, err := m.Engine.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.TLSInfo != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TLSInfo.Size())) - n11, err := m.TLSInfo.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } if m.FIPS { - dAtA[i] = 0x30 - i++ + i-- if m.FIPS { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - return i, nil + if m.TLSInfo != nil { + { + size, err := m.TLSInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Engine != nil { + { + size, err := m.Engine.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Platform != nil { + { + size, err := m.Platform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Hostname) > 0 { + i -= len(m.Hostname) + copy(dAtA[i:], m.Hostname) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hostname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NodeTLSInfo) 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 } @@ -6400,35 +6167,43 @@ func (m *NodeTLSInfo) Marshal() (dAtA []byte, err error) { } func (m *NodeTLSInfo) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeTLSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.TrustRoot) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.TrustRoot))) - i += copy(dAtA[i:], m.TrustRoot) + if len(m.CertIssuerPublicKey) > 0 { + i -= len(m.CertIssuerPublicKey) + copy(dAtA[i:], m.CertIssuerPublicKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerPublicKey))) + i-- + dAtA[i] = 0x1a } if len(m.CertIssuerSubject) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.CertIssuerSubject) + copy(dAtA[i:], m.CertIssuerSubject) i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerSubject))) - i += copy(dAtA[i:], m.CertIssuerSubject) + i-- + dAtA[i] = 0x12 } - if len(m.CertIssuerPublicKey) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerPublicKey))) - i += copy(dAtA[i:], m.CertIssuerPublicKey) + if len(m.TrustRoot) > 0 { + i -= len(m.TrustRoot) + copy(dAtA[i:], m.TrustRoot) + i = encodeVarintTypes(dAtA, i, uint64(len(m.TrustRoot))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RaftMemberStatus) 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 } @@ -6436,38 +6211,44 @@ func (m *RaftMemberStatus) Marshal() (dAtA []byte, err error) { } func (m *RaftMemberStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftMemberStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.Reachability != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + i-- + dAtA[i] = 0x10 + } if m.Leader { - dAtA[i] = 0x8 - i++ + i-- if m.Leader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if m.Reachability != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) - } - if len(m.Message) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - } - return i, nil + return len(dAtA) - i, nil } func (m *NodeStatus) 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 } @@ -6475,34 +6256,41 @@ func (m *NodeStatus) Marshal() (dAtA []byte, err error) { } func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x1a } if len(m.Message) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Message) + copy(dAtA[i:], m.Message) i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) + i-- + dAtA[i] = 0x12 } - if len(m.Addr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Image) 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 } @@ -6510,23 +6298,29 @@ func (m *Image) Marshal() (dAtA []byte, err error) { } func (m *Image) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Reference) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Reference) + copy(dAtA[i:], m.Reference) i = encodeVarintTypes(dAtA, i, uint64(len(m.Reference))) - i += copy(dAtA[i:], m.Reference) + i-- + dAtA[i] = 0xa } - return i, nil + 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 } @@ -6534,79 +6328,92 @@ 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.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + if m.Consistency != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Consistency)) + i-- + dAtA[i] = 0x40 } - if len(m.Source) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) + if m.TmpfsOptions != nil { + { + size, err := m.TmpfsOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if len(m.Target) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i += copy(dAtA[i:], m.Target) + if m.VolumeOptions != nil { + { + size, err := m.VolumeOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.BindOptions != nil { + { + size, err := m.BindOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } if m.ReadOnly { - dAtA[i] = 0x20 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.BindOptions != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.BindOptions.Size())) - n12, err := m.BindOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0x1a } - if m.VolumeOptions != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.VolumeOptions.Size())) - n13, err := m.VolumeOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x12 } - if m.TmpfsOptions != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TmpfsOptions.Size())) - n14, err := m.TmpfsOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 + if m.Type != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - if m.Consistency != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Consistency)) - } - return i, nil + return len(dAtA) - i, nil } func (m *Mount_BindOptions) 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 } @@ -6614,32 +6421,37 @@ func (m *Mount_BindOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_BindOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_BindOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Propagation != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Propagation)) - } if m.NonRecursive { - dAtA[i] = 0x10 - i++ + i-- if m.NonRecursive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Propagation != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Propagation)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *Mount_VolumeOptions) 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 } @@ -6647,54 +6459,63 @@ func (m *Mount_VolumeOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_VolumeOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_VolumeOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.DriverConfig != nil { + { + size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTypes(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } if m.NoCopy { - dAtA[i] = 0x8 - i++ + i-- if m.NoCopy { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if m.DriverConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.DriverConfig.Size())) - n15, err := m.DriverConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - return i, nil + return len(dAtA) - i, nil } func (m *Mount_TmpfsOptions) 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 } @@ -6702,33 +6523,39 @@ func (m *Mount_TmpfsOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_TmpfsOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_TmpfsOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SizeBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SizeBytes)) + if len(m.Options) > 0 { + i -= len(m.Options) + copy(dAtA[i:], m.Options) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Options))) + i-- + dAtA[i] = 0x1a } if m.Mode != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if len(m.Options) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Options))) - i += copy(dAtA[i:], m.Options) + if m.SizeBytes != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SizeBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RestartPolicy) 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 } @@ -6736,47 +6563,56 @@ func (m *RestartPolicy) Marshal() (dAtA []byte, err error) { } func (m *RestartPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RestartPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Condition != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Condition)) - } - if m.Delay != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Delay.Size())) - n16, err := m.Delay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Window != nil { + { + size, err := m.Window.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0x22 } if m.MaxAttempts != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxAttempts)) + i-- + dAtA[i] = 0x18 } - if m.Window != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Window.Size())) - n17, err := m.Window.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Delay != nil { + { + size, err := m.Delay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Condition != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Condition)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateConfig) 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 } @@ -6784,56 +6620,63 @@ func (m *UpdateConfig) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Parallelism != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Parallelism)) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay))) - n18, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Delay, dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - if m.FailureAction != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.FailureAction)) - } - if m.Monitor != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Monitor.Size())) - n19, err := m.Monitor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 + if m.Order != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Order)) + i-- + dAtA[i] = 0x30 } if m.MaxFailureRatio != 0 { - dAtA[i] = 0x2d - i++ + i -= 4 encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.MaxFailureRatio)))) - i += 4 + i-- + dAtA[i] = 0x2d } - if m.Order != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Order)) + if m.Monitor != nil { + { + size, err := m.Monitor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return i, nil + if m.FailureAction != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.FailureAction)) + i-- + dAtA[i] = 0x18 + } + n18, err18 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Delay, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintTypes(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x12 + if m.Parallelism != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Parallelism)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateStatus) 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 } @@ -6841,48 +6684,58 @@ func (m *UpdateStatus) Marshal() (dAtA []byte, err error) { } func (m *UpdateStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } - if m.StartedAt != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.StartedAt.Size())) - n20, err := m.StartedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 } if m.CompletedAt != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CompletedAt.Size())) - n21, err := m.CompletedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CompletedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x1a } - if len(m.Message) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) + if m.StartedAt != nil { + { + size, err := m.StartedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *ContainerStatus) 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 } @@ -6890,33 +6743,39 @@ func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { } func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.ExitCode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x18 } if m.PID != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.PID)) + i-- + dAtA[i] = 0x10 } - if m.ExitCode != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ExitCode)) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PortStatus) 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 } @@ -6924,29 +6783,36 @@ func (m *PortStatus) Marshal() (dAtA []byte, err error) { } func (m *PortStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *TaskStatus) 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 } @@ -6954,91 +6820,114 @@ func (m *TaskStatus) Marshal() (dAtA []byte, err error) { } func (m *TaskStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Timestamp != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp.Size())) - n22, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AppliedAt != nil { + { + size, err := m.AppliedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n22 - } - if m.State != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } - if len(m.Message) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - } - if len(m.Err) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i += copy(dAtA[i:], m.Err) - } - if m.RuntimeStatus != nil { - nn23, err := m.RuntimeStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn23 - } - if m.PortStatus != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PortStatus.Size())) - n24, err := m.PortStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 + i-- + dAtA[i] = 0x42 } if len(m.AppliedBy) > 0 { - dAtA[i] = 0x3a - i++ + i -= len(m.AppliedBy) + copy(dAtA[i:], m.AppliedBy) i = encodeVarintTypes(dAtA, i, uint64(len(m.AppliedBy))) - i += copy(dAtA[i:], m.AppliedBy) + i-- + dAtA[i] = 0x3a } - if m.AppliedAt != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.AppliedAt.Size())) - n25, err := m.AppliedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PortStatus != nil { + { + size, err := m.PortStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0x32 } - return i, nil + if m.RuntimeStatus != nil { + { + size := m.RuntimeStatus.Size() + i -= size + if _, err := m.RuntimeStatus.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Err) > 0 { + i -= len(m.Err) + copy(dAtA[i:], m.Err) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) + i-- + dAtA[i] = 0x22 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x10 + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *TaskStatus_Container) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskStatus_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Container != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Container.Size())) - n26, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *NetworkAttachmentConfig) 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 } @@ -7046,70 +6935,66 @@ func (m *NetworkAttachmentConfig) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachmentConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachmentConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Target) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i += copy(dAtA[i:], m.Target) - } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { + if len(m.DriverAttachmentOpts) > 0 { + for k := range m.DriverAttachmentOpts { + v := m.DriverAttachmentOpts[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTypes(dAtA, i, uint64(len(v))) + i-- 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) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } if len(m.Addresses) > 0 { - for _, s := range m.Addresses { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- dAtA[i] = 0x1a - 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.DriverAttachmentOpts) > 0 { - for k, _ := range m.DriverAttachmentOpts { - dAtA[i] = 0x22 - i++ - v := m.DriverAttachmentOpts[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - return i, nil + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IPAMConfig) 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 } @@ -7117,57 +7002,67 @@ func (m *IPAMConfig) Marshal() (dAtA []byte, err error) { } func (m *IPAMConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Family != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Family)) - } - if len(m.Subnet) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subnet))) - i += copy(dAtA[i:], m.Subnet) - } - if len(m.Range) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Range))) - i += copy(dAtA[i:], m.Range) - } - if len(m.Gateway) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Gateway))) - i += copy(dAtA[i:], m.Gateway) - } if len(m.Reserved) > 0 { - for k, _ := range m.Reserved { - dAtA[i] = 0x2a - i++ + for k := range m.Reserved { v := m.Reserved[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - return i, nil + if len(m.Gateway) > 0 { + i -= len(m.Gateway) + copy(dAtA[i:], m.Gateway) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Gateway))) + i-- + dAtA[i] = 0x22 + } + if len(m.Range) > 0 { + i -= len(m.Range) + copy(dAtA[i:], m.Range) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Range))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subnet) > 0 { + i -= len(m.Subnet) + copy(dAtA[i:], m.Subnet) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Subnet))) + i-- + dAtA[i] = 0x12 + } + if m.Family != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Family)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *PortConfig) 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 } @@ -7175,43 +7070,49 @@ func (m *PortConfig) Marshal() (dAtA []byte, err error) { } func (m *PortConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Protocol != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - } - if m.TargetPort != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TargetPort)) + if m.PublishMode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.PublishMode)) + i-- + dAtA[i] = 0x28 } if m.PublishedPort != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.PublishedPort)) + i-- + dAtA[i] = 0x20 } - if m.PublishMode != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PublishMode)) + if m.TargetPort != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TargetPort)) + i-- + dAtA[i] = 0x18 } - return i, nil + if m.Protocol != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Driver) 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 } @@ -7219,40 +7120,48 @@ func (m *Driver) Marshal() (dAtA []byte, err error) { } func (m *Driver) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Driver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x12 - i++ + for k := range m.Options { v := m.Options[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IPAMOptions) 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 } @@ -7260,39 +7169,48 @@ func (m *IPAMOptions) Marshal() (dAtA []byte, err error) { } func (m *IPAMOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAMOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Driver != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Driver.Size())) - n27, err := m.Driver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 - } if len(m.Configs) > 0 { - for _, msg := range m.Configs { + for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Driver != nil { + { + size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Peer) 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 } @@ -7300,29 +7218,36 @@ func (m *Peer) Marshal() (dAtA []byte, err error) { } func (m *Peer) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Peer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *WeightedPeer) 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 } @@ -7330,32 +7255,39 @@ func (m *WeightedPeer) Marshal() (dAtA []byte, err error) { } func (m *WeightedPeer) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WeightedPeer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Peer != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Peer.Size())) - n28, err := m.Peer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n28 - } if m.Weight != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Peer != nil { + { + size, err := m.Peer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IssuanceStatus) 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 } @@ -7363,28 +7295,34 @@ func (m *IssuanceStatus) Marshal() (dAtA []byte, err error) { } func (m *IssuanceStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssuanceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } if len(m.Err) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Err) + copy(dAtA[i:], m.Err) i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i += copy(dAtA[i:], m.Err) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *AcceptancePolicy) 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 } @@ -7392,29 +7330,36 @@ func (m *AcceptancePolicy) Marshal() (dAtA []byte, err error) { } func (m *AcceptancePolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Policies) > 0 { - for _, msg := range m.Policies { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Policies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Policies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *AcceptancePolicy_RoleAdmissionPolicy) 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 } @@ -7422,42 +7367,49 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) Marshal() (dAtA []byte, err error } func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + if m.Secret != nil { + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.Autoaccept { - dAtA[i] = 0x10 - i++ + i-- if m.Autoaccept { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Secret != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Secret.Size())) - n29, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 + if m.Role != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) 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 } @@ -7465,29 +7417,36 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Marshal() (dAtA []byte, er } func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if len(m.Alg) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Alg) + copy(dAtA[i:], m.Alg) i = encodeVarintTypes(dAtA, i, uint64(len(m.Alg))) - i += copy(dAtA[i:], m.Alg) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ExternalCA) 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 } @@ -7495,51 +7454,60 @@ func (m *ExternalCA) Marshal() (dAtA []byte, err error) { } func (m *ExternalCA) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExternalCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Protocol != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - } - if len(m.URL) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.URL))) - i += copy(dAtA[i:], m.URL) + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0x22 } if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x1a - i++ + for k := range m.Options { v := m.Options[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.CACert) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) + if len(m.URL) > 0 { + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintTypes(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Protocol != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *CAConfig) 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 } @@ -7547,56 +7515,67 @@ func (m *CAConfig) Marshal() (dAtA []byte, err error) { } func (m *CAConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CAConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.NodeCertExpiry != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NodeCertExpiry.Size())) - n30, err := m.NodeCertExpiry.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n30 + if m.ForceRotate != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ForceRotate)) + i-- + dAtA[i] = 0x28 + } + if len(m.SigningCAKey) > 0 { + i -= len(m.SigningCAKey) + copy(dAtA[i:], m.SigningCAKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCAKey))) + i-- + dAtA[i] = 0x22 + } + if len(m.SigningCACert) > 0 { + i -= len(m.SigningCACert) + copy(dAtA[i:], m.SigningCACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCACert))) + i-- + dAtA[i] = 0x1a } if len(m.ExternalCAs) > 0 { - for _, msg := range m.ExternalCAs { + for iNdEx := len(m.ExternalCAs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExternalCAs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.NodeCertExpiry != nil { + { + size, err := m.NodeCertExpiry.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if len(m.SigningCACert) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCACert))) - i += copy(dAtA[i:], m.SigningCACert) - } - if len(m.SigningCAKey) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCAKey))) - i += copy(dAtA[i:], m.SigningCAKey) - } - if m.ForceRotate != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ForceRotate)) - } - return i, nil + return len(dAtA) - i, nil } func (m *OrchestrationConfig) 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 } @@ -7604,22 +7583,27 @@ func (m *OrchestrationConfig) Marshal() (dAtA []byte, err error) { } func (m *OrchestrationConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OrchestrationConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.TaskHistoryRetentionLimit != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.TaskHistoryRetentionLimit)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *TaskDefaults) 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 } @@ -7627,27 +7611,34 @@ func (m *TaskDefaults) Marshal() (dAtA []byte, err error) { } func (m *TaskDefaults) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskDefaults) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.LogDriver != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LogDriver.Size())) - n31, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n31 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DispatcherConfig) 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 } @@ -7655,27 +7646,34 @@ func (m *DispatcherConfig) Marshal() (dAtA []byte, err error) { } func (m *DispatcherConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DispatcherConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.HeartbeatPeriod != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.HeartbeatPeriod.Size())) - n32, err := m.HeartbeatPeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HeartbeatPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n32 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RaftConfig) 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 } @@ -7683,42 +7681,47 @@ func (m *RaftConfig) Marshal() (dAtA []byte, err error) { } func (m *RaftConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SnapshotInterval != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SnapshotInterval)) - } - if m.KeepOldSnapshots != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.KeepOldSnapshots)) - } - if m.LogEntriesForSlowFollowers != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LogEntriesForSlowFollowers)) + if m.ElectionTick != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ElectionTick)) + i-- + dAtA[i] = 0x28 } if m.HeartbeatTick != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.HeartbeatTick)) + i-- + dAtA[i] = 0x20 } - if m.ElectionTick != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ElectionTick)) + if m.LogEntriesForSlowFollowers != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LogEntriesForSlowFollowers)) + i-- + dAtA[i] = 0x18 } - return i, nil + if m.KeepOldSnapshots != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.KeepOldSnapshots)) + i-- + dAtA[i] = 0x10 + } + if m.SnapshotInterval != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SnapshotInterval)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EncryptionConfig) 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 } @@ -7726,27 +7729,32 @@ func (m *EncryptionConfig) Marshal() (dAtA []byte, err error) { } func (m *EncryptionConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EncryptionConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.AutoLockManagers { - dAtA[i] = 0x8 - i++ + i-- if m.AutoLockManagers { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *SpreadOver) 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 } @@ -7754,23 +7762,29 @@ func (m *SpreadOver) Marshal() (dAtA []byte, err error) { } func (m *SpreadOver) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpreadOver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SpreadDescriptor) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SpreadDescriptor) + copy(dAtA[i:], m.SpreadDescriptor) i = encodeVarintTypes(dAtA, i, uint64(len(m.SpreadDescriptor))) - i += copy(dAtA[i:], m.SpreadDescriptor) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PlacementPreference) 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 } @@ -7778,38 +7792,52 @@ func (m *PlacementPreference) Marshal() (dAtA []byte, err error) { } func (m *PlacementPreference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlacementPreference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Preference != nil { - nn33, err := m.Preference.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Preference.Size() + i -= size + if _, err := m.Preference.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn33 } - return i, nil + return len(dAtA) - i, nil } func (m *PlacementPreference_Spread) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlacementPreference_Spread) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Spread != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Spread.Size())) - n34, err := m.Spread.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spread.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n34 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Placement) 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 } @@ -7817,61 +7845,64 @@ func (m *Placement) Marshal() (dAtA []byte, err error) { } func (m *Placement) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Placement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Constraints) > 0 { - for _, s := range m.Constraints { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.MaxReplicas != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MaxReplicas)) + i-- + dAtA[i] = 0x20 + } + if len(m.Platforms) > 0 { + 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 = encodeVarintTypes(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x1a } } if len(m.Preferences) > 0 { - for _, msg := range m.Preferences { + for iNdEx := len(m.Preferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Preferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Platforms) > 0 { - for _, msg := range m.Platforms { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.Constraints) > 0 { + for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Constraints[iNdEx]) + copy(dAtA[i:], m.Constraints[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Constraints[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.MaxReplicas != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MaxReplicas)) - } - return i, nil + return len(dAtA) - i, nil } func (m *JoinTokens) 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 } @@ -7879,29 +7910,36 @@ func (m *JoinTokens) Marshal() (dAtA []byte, err error) { } func (m *JoinTokens) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Worker) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Worker))) - i += copy(dAtA[i:], m.Worker) - } if len(m.Manager) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Manager) + copy(dAtA[i:], m.Manager) i = encodeVarintTypes(dAtA, i, uint64(len(m.Manager))) - i += copy(dAtA[i:], m.Manager) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Worker) > 0 { + i -= len(m.Worker) + copy(dAtA[i:], m.Worker) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Worker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RootCA) 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 } @@ -7909,58 +7947,70 @@ func (m *RootCA) Marshal() (dAtA []byte, err error) { } func (m *RootCA) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RootCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.CAKey) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i += copy(dAtA[i:], m.CAKey) + if m.LastForcedRotation != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LastForcedRotation)) + i-- + dAtA[i] = 0x30 } - if len(m.CACert) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) - } - if len(m.CACertHash) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACertHash))) - i += copy(dAtA[i:], m.CACertHash) - } - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.JoinTokens.Size())) - n35, err := m.JoinTokens.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 if m.RootRotation != nil { + { + size, err := m.RootRotation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.RootRotation.Size())) - n36, err := m.RootRotation.MarshalTo(dAtA[i:]) + } + { + size, err := m.JoinTokens.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n36 + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - if m.LastForcedRotation != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LastForcedRotation)) + i-- + dAtA[i] = 0x22 + if len(m.CACertHash) > 0 { + i -= len(m.CACertHash) + copy(dAtA[i:], m.CACertHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACertHash))) + i-- + dAtA[i] = 0x1a } - return i, nil + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0x12 + } + if len(m.CAKey) > 0 { + i -= len(m.CAKey) + copy(dAtA[i:], m.CAKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Certificate) 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 } @@ -7968,48 +8018,58 @@ func (m *Certificate) Marshal() (dAtA []byte, err error) { } func (m *Certificate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Certificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) - } - if len(m.CSR) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CSR))) - i += copy(dAtA[i:], m.CSR) - } - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Status.Size())) - n37, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 - if len(m.Certificate) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificate))) - i += copy(dAtA[i:], m.Certificate) - } if len(m.CN) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.CN) + copy(dAtA[i:], m.CN) i = encodeVarintTypes(dAtA, i, uint64(len(m.CN))) - i += copy(dAtA[i:], m.CN) + i-- + dAtA[i] = 0x2a } - return i, nil + if len(m.Certificate) > 0 { + i -= len(m.Certificate) + copy(dAtA[i:], m.Certificate) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificate))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.CSR) > 0 { + i -= len(m.CSR) + copy(dAtA[i:], m.CSR) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CSR))) + i-- + dAtA[i] = 0x12 + } + if m.Role != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EncryptionKey) 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 } @@ -8017,39 +8077,46 @@ func (m *EncryptionKey) Marshal() (dAtA []byte, err error) { } func (m *EncryptionKey) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EncryptionKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Subsystem) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subsystem))) - i += copy(dAtA[i:], m.Subsystem) - } - if m.Algorithm != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + if m.LamportTime != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LamportTime)) + i-- + dAtA[i] = 0x20 } if len(m.Key) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Key) + copy(dAtA[i:], m.Key) i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + i-- + dAtA[i] = 0x1a } - if m.LamportTime != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LamportTime)) + if m.Algorithm != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Subsystem) > 0 { + i -= len(m.Subsystem) + copy(dAtA[i:], m.Subsystem) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Subsystem))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ManagerStatus) 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 } @@ -8057,43 +8124,49 @@ func (m *ManagerStatus) Marshal() (dAtA []byte, err error) { } func (m *ManagerStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ManagerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.RaftID)) - } - if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.Reachability != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + i-- + dAtA[i] = 0x20 } if m.Leader { - dAtA[i] = 0x18 - i++ + i-- if m.Leader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.Reachability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.RaftID != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *FileTarget) 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 } @@ -8101,40 +8174,48 @@ func (m *FileTarget) Marshal() (dAtA []byte, err error) { } func (m *FileTarget) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.UID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.UID))) - i += copy(dAtA[i:], m.UID) + if m.Mode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x20 } if len(m.GID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.GID) + copy(dAtA[i:], m.GID) i = encodeVarintTypes(dAtA, i, uint64(len(m.GID))) - i += copy(dAtA[i:], m.GID) + i-- + dAtA[i] = 0x1a } - if m.Mode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + if len(m.UID) > 0 { + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.UID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RuntimeTarget) 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 } @@ -8142,17 +8223,22 @@ func (m *RuntimeTarget) Marshal() (dAtA []byte, err error) { } func (m *RuntimeTarget) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuntimeTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *SecretReference) 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 } @@ -8160,50 +8246,66 @@ func (m *SecretReference) Marshal() (dAtA []byte, err error) { } func (m *SecretReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + if m.Target != nil { + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if len(m.SecretName) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SecretName) + copy(dAtA[i:], m.SecretName) i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretName))) - i += copy(dAtA[i:], m.SecretName) + i-- + dAtA[i] = 0x12 } - if m.Target != nil { - nn38, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn38 + if len(m.SecretID) > 0 { + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SecretReference_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.File != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.File.Size())) - n39, 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 = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n39 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference) 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 } @@ -8211,64 +8313,87 @@ func (m *ConfigReference) Marshal() (dAtA []byte, err error) { } func (m *ConfigReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + if m.Target != nil { + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if len(m.ConfigName) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ConfigName) + copy(dAtA[i:], m.ConfigName) i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigName))) - i += copy(dAtA[i:], m.ConfigName) + i-- + dAtA[i] = 0x12 } - if m.Target != nil { - nn40, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn40 + if len(m.ConfigID) > 0 { + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.File != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.File.Size())) - n41, 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 = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n41 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference_Runtime) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Runtime != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Runtime.Size())) - n42, err := m.Runtime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n42 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *BlacklistedCertificate) 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 } @@ -8276,27 +8401,34 @@ func (m *BlacklistedCertificate) Marshal() (dAtA []byte, err error) { } func (m *BlacklistedCertificate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlacklistedCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Expiry != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Expiry.Size())) - n43, err := m.Expiry.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Expiry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n43 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HealthConfig) 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 } @@ -8304,67 +8436,72 @@ func (m *HealthConfig) Marshal() (dAtA []byte, err error) { } func (m *HealthConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Test) > 0 { - for _, s := range m.Test { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.StartPeriod != nil { + { + size, err := m.StartPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - } - if m.Interval != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Interval.Size())) - n44, err := m.Interval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n44 - } - if m.Timeout != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Timeout.Size())) - n45, err := m.Timeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n45 + i-- + dAtA[i] = 0x2a } if m.Retries != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Retries)) + i-- + dAtA[i] = 0x20 } - if m.StartPeriod != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.StartPeriod.Size())) - n46, err := m.StartPeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Timeout != nil { + { + size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n46 + i-- + dAtA[i] = 0x1a } - return i, nil + if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Test) > 0 { + for iNdEx := len(m.Test) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Test[iNdEx]) + copy(dAtA[i:], m.Test[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Test[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *MaybeEncryptedRecord) 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 } @@ -8372,34 +8509,41 @@ func (m *MaybeEncryptedRecord) Marshal() (dAtA []byte, err error) { } func (m *MaybeEncryptedRecord) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MaybeEncryptedRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Algorithm != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x1a } if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0x12 } - if len(m.Nonce) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce))) - i += copy(dAtA[i:], m.Nonce) + if m.Algorithm != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RootRotation) 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 } @@ -8407,35 +8551,43 @@ func (m *RootRotation) Marshal() (dAtA []byte, err error) { } func (m *RootRotation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RootRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.CACert) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) + if len(m.CrossSignedCACert) > 0 { + i -= len(m.CrossSignedCACert) + copy(dAtA[i:], m.CrossSignedCACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CrossSignedCACert))) + i-- + dAtA[i] = 0x1a } if len(m.CAKey) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.CAKey) + copy(dAtA[i:], m.CAKey) i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i += copy(dAtA[i:], m.CAKey) + i-- + dAtA[i] = 0x12 } - if len(m.CrossSignedCACert) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CrossSignedCACert))) - i += copy(dAtA[i:], m.CrossSignedCACert) + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Privileges) 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 } @@ -8443,37 +8595,46 @@ func (m *Privileges) Marshal() (dAtA []byte, err error) { } func (m *Privileges) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.CredentialSpec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CredentialSpec.Size())) - n47, err := m.CredentialSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n47 - } if m.SELinuxContext != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SELinuxContext.Size())) - n48, err := m.SELinuxContext.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SELinuxContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n48 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.CredentialSpec != nil { + { + size, err := m.CredentialSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec) 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 } @@ -8481,48 +8642,73 @@ func (m *Privileges_CredentialSpec) Marshal() (dAtA []byte, err error) { } func (m *Privileges_CredentialSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Source != nil { - nn49, err := m.Source.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Source.Size() + i -= size + if _, err := m.Source.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn49 } - return i, nil + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.File) + copy(dAtA[i:], m.File) i = encodeVarintTypes(dAtA, i, uint64(len(m.File))) - i += copy(dAtA[i:], m.File) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_Registry) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_Registry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Registry) + copy(dAtA[i:], m.Registry) i = encodeVarintTypes(dAtA, i, uint64(len(m.Registry))) - i += copy(dAtA[i:], m.Registry) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Config) + copy(dAtA[i:], m.Config) i = encodeVarintTypes(dAtA, i, uint64(len(m.Config))) - i += copy(dAtA[i:], m.Config) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *Privileges_SELinuxContext) 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 } @@ -8530,51 +8716,60 @@ func (m *Privileges_SELinuxContext) Marshal() (dAtA []byte, err error) { } func (m *Privileges_SELinuxContext) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_SELinuxContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.Level) > 0 { + i -= len(m.Level) + copy(dAtA[i:], m.Level) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Level))) + i-- + dAtA[i] = 0x2a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + } + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0x1a + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintTypes(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x12 + } if m.Disable { - dAtA[i] = 0x8 - i++ + i-- if m.Disable { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if len(m.User) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Role) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - if len(m.Type) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - } - if len(m.Level) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Level))) - i += copy(dAtA[i:], m.Level) - } - return i, nil + return len(dAtA) - i, nil } func (m *JobStatus) 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 } @@ -8582,39 +8777,50 @@ func (m *JobStatus) Marshal() (dAtA []byte, err error) { } func (m *JobStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JobStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.JobIteration.Size())) - n50, err := m.JobIteration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n50 if m.LastExecution != nil { + { + size, err := m.LastExecution.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LastExecution.Size())) - n51, err := m.LastExecution.MarshalTo(dAtA[i:]) + } + { + size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n51 + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(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 *Version) Size() (n int) { if m == nil { @@ -10051,14 +10257,7 @@ func (m *JobStatus) Size() (n int) { } func sovTypes(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -10088,6 +10287,11 @@ func (this *Annotations) String() string { if this == nil { return "nil" } + repeatedStringForIndices := "[]IndexEntry{" + for _, f := range this.Indices { + repeatedStringForIndices += strings.Replace(strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1), `&`, ``, 1) + "," + } + repeatedStringForIndices += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -10101,7 +10305,7 @@ func (this *Annotations) String() string { s := strings.Join([]string{`&Annotations{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Labels:` + mapStringForLabels + `,`, - `Indices:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Indices), "IndexEntry", "IndexEntry", 1), `&`, ``, 1) + `,`, + `Indices:` + repeatedStringForIndices + `,`, `}`, }, "") return s @@ -10162,10 +10366,15 @@ func (this *Resources) String() string { if this == nil { return "nil" } + repeatedStringForGeneric := "[]*GenericResource{" + for _, f := range this.Generic { + repeatedStringForGeneric += strings.Replace(f.String(), "GenericResource", "GenericResource", 1) + "," + } + repeatedStringForGeneric += "}" s := strings.Join([]string{`&Resources{`, `NanoCPUs:` + fmt.Sprintf("%v", this.NanoCPUs) + `,`, `MemoryBytes:` + fmt.Sprintf("%v", this.MemoryBytes) + `,`, - `Generic:` + strings.Replace(fmt.Sprintf("%v", this.Generic), "GenericResource", "GenericResource", 1) + `,`, + `Generic:` + repeatedStringForGeneric + `,`, `}`, }, "") return s @@ -10175,8 +10384,8 @@ func (this *ResourceRequirements) String() string { return "nil" } s := strings.Join([]string{`&ResourceRequirements{`, - `Limits:` + strings.Replace(fmt.Sprintf("%v", this.Limits), "Resources", "Resources", 1) + `,`, - `Reservations:` + strings.Replace(fmt.Sprintf("%v", this.Reservations), "Resources", "Resources", 1) + `,`, + `Limits:` + strings.Replace(this.Limits.String(), "Resources", "Resources", 1) + `,`, + `Reservations:` + strings.Replace(this.Reservations.String(), "Resources", "Resources", 1) + `,`, `SwapBytes:` + strings.Replace(fmt.Sprintf("%v", this.SwapBytes), "Int64Value", "types.Int64Value", 1) + `,`, `MemorySwappiness:` + strings.Replace(fmt.Sprintf("%v", this.MemorySwappiness), "Int64Value", "types.Int64Value", 1) + `,`, `}`, @@ -10209,6 +10418,11 @@ func (this *EngineDescription) String() string { if this == nil { return "nil" } + repeatedStringForPlugins := "[]PluginDescription{" + for _, f := range this.Plugins { + repeatedStringForPlugins += strings.Replace(strings.Replace(f.String(), "PluginDescription", "PluginDescription", 1), `&`, ``, 1) + "," + } + repeatedStringForPlugins += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -10222,7 +10436,7 @@ func (this *EngineDescription) String() string { s := strings.Join([]string{`&EngineDescription{`, `EngineVersion:` + fmt.Sprintf("%v", this.EngineVersion) + `,`, `Labels:` + mapStringForLabels + `,`, - `Plugins:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Plugins), "PluginDescription", "PluginDescription", 1), `&`, ``, 1) + `,`, + `Plugins:` + repeatedStringForPlugins + `,`, `}`, }, "") return s @@ -10233,10 +10447,10 @@ func (this *NodeDescription) String() string { } s := strings.Join([]string{`&NodeDescription{`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `Platform:` + strings.Replace(fmt.Sprintf("%v", this.Platform), "Platform", "Platform", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resources", "Resources", 1) + `,`, - `Engine:` + strings.Replace(fmt.Sprintf("%v", this.Engine), "EngineDescription", "EngineDescription", 1) + `,`, - `TLSInfo:` + strings.Replace(fmt.Sprintf("%v", this.TLSInfo), "NodeTLSInfo", "NodeTLSInfo", 1) + `,`, + `Platform:` + strings.Replace(this.Platform.String(), "Platform", "Platform", 1) + `,`, + `Resources:` + strings.Replace(this.Resources.String(), "Resources", "Resources", 1) + `,`, + `Engine:` + strings.Replace(this.Engine.String(), "EngineDescription", "EngineDescription", 1) + `,`, + `TLSInfo:` + strings.Replace(this.TLSInfo.String(), "NodeTLSInfo", "NodeTLSInfo", 1) + `,`, `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, `}`, }, "") @@ -10333,7 +10547,7 @@ func (this *Mount_VolumeOptions) String() string { s := strings.Join([]string{`&Mount_VolumeOptions{`, `NoCopy:` + fmt.Sprintf("%v", this.NoCopy) + `,`, `Labels:` + mapStringForLabels + `,`, - `DriverConfig:` + strings.Replace(fmt.Sprintf("%v", this.DriverConfig), "Driver", "Driver", 1) + `,`, + `DriverConfig:` + strings.Replace(this.DriverConfig.String(), "Driver", "Driver", 1) + `,`, `}`, }, "") return s @@ -10369,7 +10583,7 @@ func (this *UpdateConfig) String() string { } s := strings.Join([]string{`&UpdateConfig{`, `Parallelism:` + fmt.Sprintf("%v", this.Parallelism) + `,`, - `Delay:` + strings.Replace(strings.Replace(this.Delay.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Delay:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Delay), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `FailureAction:` + fmt.Sprintf("%v", this.FailureAction) + `,`, `Monitor:` + strings.Replace(fmt.Sprintf("%v", this.Monitor), "Duration", "types.Duration", 1) + `,`, `MaxFailureRatio:` + fmt.Sprintf("%v", this.MaxFailureRatio) + `,`, @@ -10407,8 +10621,13 @@ func (this *PortStatus) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(f.String(), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&PortStatus{`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `}`, }, "") return s @@ -10423,7 +10642,7 @@ func (this *TaskStatus) String() string { `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Err:` + fmt.Sprintf("%v", this.Err) + `,`, `RuntimeStatus:` + fmt.Sprintf("%v", this.RuntimeStatus) + `,`, - `PortStatus:` + strings.Replace(fmt.Sprintf("%v", this.PortStatus), "PortStatus", "PortStatus", 1) + `,`, + `PortStatus:` + strings.Replace(this.PortStatus.String(), "PortStatus", "PortStatus", 1) + `,`, `AppliedBy:` + fmt.Sprintf("%v", this.AppliedBy) + `,`, `AppliedAt:` + strings.Replace(fmt.Sprintf("%v", this.AppliedAt), "Timestamp", "types.Timestamp", 1) + `,`, `}`, @@ -10526,9 +10745,14 @@ func (this *IPAMOptions) String() string { if this == nil { return "nil" } + repeatedStringForConfigs := "[]*IPAMConfig{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(f.String(), "IPAMConfig", "IPAMConfig", 1) + "," + } + repeatedStringForConfigs += "}" s := strings.Join([]string{`&IPAMOptions{`, - `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "IPAMConfig", "IPAMConfig", 1) + `,`, + `Driver:` + strings.Replace(this.Driver.String(), "Driver", "Driver", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -10549,7 +10773,7 @@ func (this *WeightedPeer) String() string { return "nil" } s := strings.Join([]string{`&WeightedPeer{`, - `Peer:` + strings.Replace(fmt.Sprintf("%v", this.Peer), "Peer", "Peer", 1) + `,`, + `Peer:` + strings.Replace(this.Peer.String(), "Peer", "Peer", 1) + `,`, `Weight:` + fmt.Sprintf("%v", this.Weight) + `,`, `}`, }, "") @@ -10570,8 +10794,13 @@ func (this *AcceptancePolicy) String() string { if this == nil { return "nil" } + repeatedStringForPolicies := "[]*AcceptancePolicy_RoleAdmissionPolicy{" + for _, f := range this.Policies { + repeatedStringForPolicies += strings.Replace(fmt.Sprintf("%v", f), "AcceptancePolicy_RoleAdmissionPolicy", "AcceptancePolicy_RoleAdmissionPolicy", 1) + "," + } + repeatedStringForPolicies += "}" s := strings.Join([]string{`&AcceptancePolicy{`, - `Policies:` + strings.Replace(fmt.Sprintf("%v", this.Policies), "AcceptancePolicy_RoleAdmissionPolicy", "AcceptancePolicy_RoleAdmissionPolicy", 1) + `,`, + `Policies:` + repeatedStringForPolicies + `,`, `}`, }, "") return s @@ -10626,9 +10855,14 @@ func (this *CAConfig) String() string { if this == nil { return "nil" } + repeatedStringForExternalCAs := "[]*ExternalCA{" + for _, f := range this.ExternalCAs { + repeatedStringForExternalCAs += strings.Replace(f.String(), "ExternalCA", "ExternalCA", 1) + "," + } + repeatedStringForExternalCAs += "}" s := strings.Join([]string{`&CAConfig{`, `NodeCertExpiry:` + strings.Replace(fmt.Sprintf("%v", this.NodeCertExpiry), "Duration", "types.Duration", 1) + `,`, - `ExternalCAs:` + strings.Replace(fmt.Sprintf("%v", this.ExternalCAs), "ExternalCA", "ExternalCA", 1) + `,`, + `ExternalCAs:` + repeatedStringForExternalCAs + `,`, `SigningCACert:` + fmt.Sprintf("%v", this.SigningCACert) + `,`, `SigningCAKey:` + fmt.Sprintf("%v", this.SigningCAKey) + `,`, `ForceRotate:` + fmt.Sprintf("%v", this.ForceRotate) + `,`, @@ -10651,7 +10885,7 @@ func (this *TaskDefaults) String() string { return "nil" } s := strings.Join([]string{`&TaskDefaults{`, - `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, + `LogDriver:` + strings.Replace(this.LogDriver.String(), "Driver", "Driver", 1) + `,`, `}`, }, "") return s @@ -10724,10 +10958,20 @@ func (this *Placement) String() string { if this == nil { return "nil" } + repeatedStringForPreferences := "[]*PlacementPreference{" + for _, f := range this.Preferences { + repeatedStringForPreferences += strings.Replace(f.String(), "PlacementPreference", "PlacementPreference", 1) + "," + } + repeatedStringForPreferences += "}" + repeatedStringForPlatforms := "[]*Platform{" + for _, f := range this.Platforms { + repeatedStringForPlatforms += strings.Replace(f.String(), "Platform", "Platform", 1) + "," + } + repeatedStringForPlatforms += "}" s := strings.Join([]string{`&Placement{`, `Constraints:` + fmt.Sprintf("%v", this.Constraints) + `,`, - `Preferences:` + strings.Replace(fmt.Sprintf("%v", this.Preferences), "PlacementPreference", "PlacementPreference", 1) + `,`, - `Platforms:` + strings.Replace(fmt.Sprintf("%v", this.Platforms), "Platform", "Platform", 1) + `,`, + `Preferences:` + repeatedStringForPreferences + `,`, + `Platforms:` + repeatedStringForPlatforms + `,`, `MaxReplicas:` + fmt.Sprintf("%v", this.MaxReplicas) + `,`, `}`, }, "") @@ -10753,7 +10997,7 @@ func (this *RootCA) String() string { `CACert:` + fmt.Sprintf("%v", this.CACert) + `,`, `CACertHash:` + fmt.Sprintf("%v", this.CACertHash) + `,`, `JoinTokens:` + strings.Replace(strings.Replace(this.JoinTokens.String(), "JoinTokens", "JoinTokens", 1), `&`, ``, 1) + `,`, - `RootRotation:` + strings.Replace(fmt.Sprintf("%v", this.RootRotation), "RootRotation", "RootRotation", 1) + `,`, + `RootRotation:` + strings.Replace(this.RootRotation.String(), "RootRotation", "RootRotation", 1) + `,`, `LastForcedRotation:` + fmt.Sprintf("%v", this.LastForcedRotation) + `,`, `}`, }, "") @@ -11061,10 +11305,7 @@ func (m *Version) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11178,10 +11419,7 @@ func (m *IndexEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11373,7 +11611,7 @@ func (m *Annotations) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -11424,10 +11662,7 @@ func (m *Annotations) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11541,10 +11776,7 @@ func (m *NamedGenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11645,10 +11877,7 @@ func (m *DiscreteGenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11768,10 +11997,7 @@ func (m *GenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11893,10 +12119,7 @@ func (m *Resources) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12090,10 +12313,7 @@ func (m *ResourceRequirements) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12207,10 +12427,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12324,10 +12541,7 @@ func (m *PluginDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12519,7 +12733,7 @@ func (m *EngineDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -12570,10 +12784,7 @@ func (m *EngineDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12819,10 +13030,7 @@ func (m *NodeDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12974,10 +13182,7 @@ func (m *NodeTLSInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13098,10 +13303,7 @@ func (m *RaftMemberStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13234,10 +13436,7 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13319,10 +13518,7 @@ func (m *Image) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13602,10 +13798,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13694,10 +13887,7 @@ func (m *Mount_BindOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13877,7 +14067,7 @@ func (m *Mount_VolumeOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -13930,10 +14120,7 @@ func (m *Mount_VolumeOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14053,10 +14240,7 @@ func (m *Mount_TmpfsOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14216,10 +14400,7 @@ func (m *RestartPolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14406,10 +14587,7 @@ func (m *UpdateConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14582,10 +14760,7 @@ func (m *UpdateStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14705,10 +14880,7 @@ func (m *ContainerStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14792,10 +14964,7 @@ func (m *PortStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15103,10 +15272,7 @@ func (m *TaskStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15362,7 +15528,7 @@ func (m *NetworkAttachmentConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -15379,10 +15545,7 @@ func (m *NetworkAttachmentConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15657,7 +15820,7 @@ func (m *IPAMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -15674,10 +15837,7 @@ func (m *IPAMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15835,10 +15995,7 @@ func (m *PortConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16030,7 +16187,7 @@ func (m *Driver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -16047,10 +16204,7 @@ func (m *Driver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16170,10 +16324,7 @@ func (m *IPAMOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16287,10 +16438,7 @@ func (m *Peer) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16395,10 +16543,7 @@ func (m *WeightedPeer) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16499,10 +16644,7 @@ func (m *IssuanceStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16586,10 +16728,7 @@ func (m *AcceptancePolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16714,10 +16853,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16833,10 +16969,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Unmarshal(dAtA []byte) err if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17047,7 +17180,7 @@ func (m *ExternalCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -17098,10 +17231,7 @@ func (m *ExternalCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17308,10 +17438,7 @@ func (m *CAConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17380,10 +17507,7 @@ func (m *OrchestrationConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17469,10 +17593,7 @@ func (m *TaskDefaults) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17558,10 +17679,7 @@ func (m *DispatcherConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17706,10 +17824,7 @@ func (m *RaftConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17779,10 +17894,7 @@ func (m *EncryptionConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17864,10 +17976,7 @@ func (m *SpreadOver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17952,10 +18061,7 @@ func (m *PlacementPreference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18124,10 +18230,7 @@ func (m *Placement) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18241,10 +18344,7 @@ func (m *JoinTokens) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18482,10 +18582,7 @@ func (m *RootCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18687,10 +18784,7 @@ func (m *Certificate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18844,10 +18938,7 @@ func (m *EncryptionKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18987,10 +19078,7 @@ func (m *ManagerStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19155,10 +19243,7 @@ func (m *FileTarget) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19208,10 +19293,7 @@ func (m *RuntimeTarget) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19360,10 +19442,7 @@ func (m *SecretReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19547,10 +19626,7 @@ func (m *ConfigReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19636,10 +19712,7 @@ func (m *BlacklistedCertificate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19848,10 +19921,7 @@ func (m *HealthConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19988,10 +20058,7 @@ func (m *MaybeEncryptedRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20143,10 +20210,7 @@ func (m *RootRotation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20268,10 +20332,7 @@ func (m *Privileges) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20417,10 +20478,7 @@ func (m *Privileges_CredentialSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20618,10 +20676,7 @@ func (m *Privileges_SELinuxContext) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20740,10 +20795,7 @@ func (m *JobStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20761,6 +20813,7 @@ func (m *JobStatus) Unmarshal(dAtA []byte) error { func skipTypes(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 { @@ -20792,10 +20845,8 @@ func skipTypes(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 { @@ -20816,55 +20867,30 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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 := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/watch.pb.go b/vendor/github.com/docker/swarmkit/api/watch.pb.go index c3b7b75c4b..cdae947d60 100644 --- a/vendor/github.com/docker/swarmkit/api/watch.pb.go +++ b/vendor/github.com/docker/swarmkit/api/watch.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,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 // WatchActionKind distinguishes between creations, updates, and removals. It // is structured as a bitmap so multiple kinds of events can be requested with @@ -95,7 +96,7 @@ func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Object.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 } @@ -121,31 +122,31 @@ type isObject_Object interface { } type Object_Node struct { - Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof"` + Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof" json:"node,omitempty"` } type Object_Service struct { - Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof"` + Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof" json:"service,omitempty"` } type Object_Network struct { - Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof"` + Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof" json:"network,omitempty"` } type Object_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` } type Object_Cluster struct { - Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof"` + Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` } type Object_Secret struct { - Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type Object_Resource struct { - Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof"` + Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof" json:"resource,omitempty"` } type Object_Extension struct { - Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof"` + Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof" json:"extension,omitempty"` } type Object_Config struct { - Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Object_Node) isObject_Object() {} @@ -228,9 +229,9 @@ func (m *Object) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Object) 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 _Object_OneofMarshaler, _Object_OneofUnmarshaler, _Object_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Object) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Object_Node)(nil), (*Object_Service)(nil), (*Object_Network)(nil), @@ -243,198 +244,6 @@ func (*Object) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, } } -func _Object_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Object) - // Object - switch x := m.Object.(type) { - case *Object_Node: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Node); err != nil { - return err - } - case *Object_Service: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Service); err != nil { - return err - } - case *Object_Network: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Network); err != nil { - return err - } - case *Object_Task: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *Object_Cluster: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Cluster); err != nil { - return err - } - case *Object_Secret: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *Object_Resource: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Resource); err != nil { - return err - } - case *Object_Extension: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Extension); err != nil { - return err - } - case *Object_Config: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Object.Object has unexpected type %T", x) - } - return nil -} - -func _Object_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Object) - switch tag { - case 1: // Object.node - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Node) - err := b.DecodeMessage(msg) - m.Object = &Object_Node{msg} - return true, err - case 2: // Object.service - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Service) - err := b.DecodeMessage(msg) - m.Object = &Object_Service{msg} - return true, err - case 3: // Object.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Network) - err := b.DecodeMessage(msg) - m.Object = &Object_Network{msg} - return true, err - case 4: // Object.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Object = &Object_Task{msg} - return true, err - case 5: // Object.cluster - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Cluster) - err := b.DecodeMessage(msg) - m.Object = &Object_Cluster{msg} - return true, err - case 6: // Object.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Object = &Object_Secret{msg} - return true, err - case 7: // Object.resource - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Resource) - err := b.DecodeMessage(msg) - m.Object = &Object_Resource{msg} - return true, err - case 8: // Object.extension - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Extension) - err := b.DecodeMessage(msg) - m.Object = &Object_Extension{msg} - return true, err - case 9: // Object.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Object = &Object_Config{msg} - return true, err - default: - return false, nil - } -} - -func _Object_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Object) - // Object - switch x := m.Object.(type) { - case *Object_Node: - s := proto.Size(x.Node) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Service: - s := proto.Size(x.Service) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Network: - s := proto.Size(x.Network) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Cluster: - s := proto.Size(x.Cluster) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Resource: - s := proto.Size(x.Resource) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Extension: - s := proto.Size(x.Extension) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Config: - s := proto.Size(x.Config) - 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 -} - // FIXME(aaronl): These messages should ideally be embedded in SelectBy, but // protoc generates bad code for that. type SelectBySlot struct { @@ -455,7 +264,7 @@ func (m *SelectBySlot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SelectBySlot.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 } @@ -493,7 +302,7 @@ func (m *SelectByCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SelectByCustom.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 } @@ -550,7 +359,7 @@ func (m *SelectBy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SelectBy.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 } @@ -576,52 +385,52 @@ type isSelectBy_By interface { } type SelectBy_ID struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` + ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` } type SelectBy_IDPrefix struct { - IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof"` + IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof" json:"id_prefix,omitempty"` } type SelectBy_Name struct { - Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"` + Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` } type SelectBy_NamePrefix struct { - NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof"` + NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof" json:"name_prefix,omitempty"` } type SelectBy_Custom struct { - Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof"` + Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof" json:"custom,omitempty"` } type SelectBy_CustomPrefix struct { - CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof"` + CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof" json:"custom_prefix,omitempty"` } type SelectBy_ServiceID struct { - ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof"` + ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"` } type SelectBy_NodeID struct { - NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof"` + NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof" json:"node_id,omitempty"` } type SelectBy_Slot struct { - Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof"` + Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof" json:"slot,omitempty"` } type SelectBy_DesiredState struct { - DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof"` + DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof" json:"desired_state,omitempty"` } type SelectBy_Role struct { - Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof"` + Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof" json:"role,omitempty"` } type SelectBy_Membership struct { - Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof"` + Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof" json:"membership,omitempty"` } type SelectBy_ReferencedNetworkID struct { - ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof"` + ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof" json:"referenced_network_id,omitempty"` } type SelectBy_ReferencedSecretID struct { - ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof"` + ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof" json:"referenced_secret_id,omitempty"` } type SelectBy_ReferencedConfigID struct { - ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof"` + ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof" json:"referenced_config_id,omitempty"` } type SelectBy_Kind struct { - Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof"` + Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof" json:"kind,omitempty"` } func (*SelectBy_ID) isSelectBy_By() {} @@ -760,9 +569,9 @@ func (m *SelectBy) GetKind() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SelectBy) 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 _SelectBy_OneofMarshaler, _SelectBy_OneofUnmarshaler, _SelectBy_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SelectBy) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SelectBy_ID)(nil), (*SelectBy_IDPrefix)(nil), (*SelectBy_Name)(nil), @@ -782,269 +591,6 @@ func (*SelectBy) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) erro } } -func _SelectBy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SelectBy) - // By - switch x := m.By.(type) { - case *SelectBy_ID: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ID) - case *SelectBy_IDPrefix: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.IDPrefix) - case *SelectBy_Name: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Name) - case *SelectBy_NamePrefix: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.NamePrefix) - case *SelectBy_Custom: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Custom); err != nil { - return err - } - case *SelectBy_CustomPrefix: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CustomPrefix); err != nil { - return err - } - case *SelectBy_ServiceID: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ServiceID) - case *SelectBy_NodeID: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.NodeID) - case *SelectBy_Slot: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Slot); err != nil { - return err - } - case *SelectBy_DesiredState: - _ = b.EncodeVarint(10<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.DesiredState)) - case *SelectBy_Role: - _ = b.EncodeVarint(11<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Role)) - case *SelectBy_Membership: - _ = b.EncodeVarint(12<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Membership)) - case *SelectBy_ReferencedNetworkID: - _ = b.EncodeVarint(13<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedNetworkID) - case *SelectBy_ReferencedSecretID: - _ = b.EncodeVarint(14<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedSecretID) - case *SelectBy_ReferencedConfigID: - _ = b.EncodeVarint(16<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedConfigID) - case *SelectBy_Kind: - _ = b.EncodeVarint(15<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Kind) - case nil: - default: - return fmt.Errorf("SelectBy.By has unexpected type %T", x) - } - return nil -} - -func _SelectBy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SelectBy) - switch tag { - case 1: // By.id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ID{x} - return true, err - case 2: // By.id_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_IDPrefix{x} - return true, err - case 3: // By.name - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_Name{x} - return true, err - case 4: // By.name_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_NamePrefix{x} - return true, err - case 5: // By.custom - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectByCustom) - err := b.DecodeMessage(msg) - m.By = &SelectBy_Custom{msg} - return true, err - case 6: // By.custom_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectByCustom) - err := b.DecodeMessage(msg) - m.By = &SelectBy_CustomPrefix{msg} - return true, err - case 7: // By.service_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ServiceID{x} - return true, err - case 8: // By.node_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_NodeID{x} - return true, err - case 9: // By.slot - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectBySlot) - err := b.DecodeMessage(msg) - m.By = &SelectBy_Slot{msg} - return true, err - case 10: // By.desired_state - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_DesiredState{TaskState(x)} - return true, err - case 11: // By.role - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_Role{NodeRole(x)} - return true, err - case 12: // By.membership - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_Membership{NodeSpec_Membership(x)} - return true, err - case 13: // By.referenced_network_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedNetworkID{x} - return true, err - case 14: // By.referenced_secret_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedSecretID{x} - return true, err - case 16: // By.referenced_config_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedConfigID{x} - return true, err - case 15: // By.kind - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_Kind{x} - return true, err - default: - return false, nil - } -} - -func _SelectBy_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SelectBy) - // By - switch x := m.By.(type) { - case *SelectBy_ID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ID))) - n += len(x.ID) - case *SelectBy_IDPrefix: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.IDPrefix))) - n += len(x.IDPrefix) - case *SelectBy_Name: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Name))) - n += len(x.Name) - case *SelectBy_NamePrefix: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.NamePrefix))) - n += len(x.NamePrefix) - case *SelectBy_Custom: - s := proto.Size(x.Custom) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_CustomPrefix: - s := proto.Size(x.CustomPrefix) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_ServiceID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ServiceID))) - n += len(x.ServiceID) - case *SelectBy_NodeID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.NodeID))) - n += len(x.NodeID) - case *SelectBy_Slot: - s := proto.Size(x.Slot) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_DesiredState: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.DesiredState)) - case *SelectBy_Role: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Role)) - case *SelectBy_Membership: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Membership)) - case *SelectBy_ReferencedNetworkID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedNetworkID))) - n += len(x.ReferencedNetworkID) - case *SelectBy_ReferencedSecretID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedSecretID))) - n += len(x.ReferencedSecretID) - case *SelectBy_ReferencedConfigID: - n += 2 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedConfigID))) - n += len(x.ReferencedConfigID) - case *SelectBy_Kind: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Kind))) - n += len(x.Kind) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WatchRequest struct { // Multiple entries are combined using OR logic - i.e. if an event // matches all of the selectors specified in any single watch entry, @@ -1076,7 +622,7 @@ func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WatchRequest.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 } @@ -1120,7 +666,7 @@ func (m *WatchRequest_WatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_WatchRequest_WatchEntry.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 } @@ -1162,7 +708,7 @@ func (m *WatchMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WatchMessage.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 } @@ -1207,7 +753,7 @@ func (m *WatchMessage_Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_WatchMessage_Event.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 } @@ -1718,6 +1264,14 @@ type WatchServer interface { Watch(*WatchRequest, Watch_WatchServer) error } +// UnimplementedWatchServer can be embedded to have forward compatible implementations. +type UnimplementedWatchServer struct { +} + +func (*UnimplementedWatchServer) Watch(req *WatchRequest, srv Watch_WatchServer) error { + return status.Errorf(codes.Unimplemented, "method Watch not implemented") +} + func RegisterWatchServer(s *grpc.Server, srv WatchServer) { s.RegisterService(&_Watch_serviceDesc, srv) } @@ -1760,7 +1314,7 @@ var _Watch_serviceDesc = grpc.ServiceDesc{ func (m *Object) 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 } @@ -1768,150 +1322,220 @@ func (m *Object) Marshal() (dAtA []byte, err error) { } func (m *Object) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Object != nil { - nn1, err := m.Object.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Object.Size() + i -= size + if _, err := m.Object.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Node) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Service) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Service != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Service.Size())) - n3, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Network != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Network.Size())) - n4, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Task.Size())) - n5, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Cluster != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Cluster.Size())) - n6, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Secret.Size())) - n7, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Resource) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Resource != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Resource.Size())) - n8, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Extension) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Extension != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Extension.Size())) - n9, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Config.Size())) - n10, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBySlot) 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 } @@ -1919,28 +1543,34 @@ func (m *SelectBySlot) Marshal() (dAtA []byte, err error) { } func (m *SelectBySlot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBySlot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } if m.Slot != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintWatch(dAtA, i, uint64(m.Slot)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SelectByCustom) 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 } @@ -1948,35 +1578,43 @@ func (m *SelectByCustom) Marshal() (dAtA []byte, err error) { } func (m *SelectByCustom) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectByCustom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a } if len(m.Index) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Index) + copy(dAtA[i:], m.Index) i = encodeVarintWatch(dAtA, i, uint64(len(m.Index))) - i += copy(dAtA[i:], m.Index) + i-- + dAtA[i] = 0x12 } - if len(m.Value) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy) 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 } @@ -1984,169 +1622,272 @@ func (m *SelectBy) Marshal() (dAtA []byte, err error) { } func (m *SelectBy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.By != nil { - nn11, err := m.By.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.By.Size() + i -= size + if _, err := m.By.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn11 } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_ID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SelectBy_IDPrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_IDPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.IDPrefix) + copy(dAtA[i:], m.IDPrefix) i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix))) - i += copy(dAtA[i:], m.IDPrefix) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *SelectBy_Name) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Name) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintWatch(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *SelectBy_NamePrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x22 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_NamePrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.NamePrefix) + copy(dAtA[i:], m.NamePrefix) i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix))) - i += copy(dAtA[i:], m.NamePrefix) - return i, nil + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil } func (m *SelectBy_Custom) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Custom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Custom != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Custom.Size())) - n12, err := m.Custom.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Custom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_CustomPrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_CustomPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CustomPrefix != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.CustomPrefix.Size())) - n13, err := m.CustomPrefix.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CustomPrefix.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_ServiceID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x3a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ServiceID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - return i, nil + i-- + dAtA[i] = 0x3a + return len(dAtA) - i, nil } func (m *SelectBy_NodeID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x42 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_NodeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintWatch(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - return i, nil + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil } func (m *SelectBy_Slot) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Slot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Slot != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Slot.Size())) - n14, err := m.Slot.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Slot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_DesiredState) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x50 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_DesiredState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.DesiredState)) - return i, nil + i-- + dAtA[i] = 0x50 + return len(dAtA) - i, nil } func (m *SelectBy_Role) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x58 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.Role)) - return i, nil + i-- + dAtA[i] = 0x58 + return len(dAtA) - i, nil } func (m *SelectBy_Membership) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x60 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Membership) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.Membership)) - return i, nil + i-- + dAtA[i] = 0x60 + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedNetworkID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x6a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedNetworkID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedNetworkID) + copy(dAtA[i:], m.ReferencedNetworkID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedNetworkID))) - i += copy(dAtA[i:], m.ReferencedNetworkID) - return i, nil + i-- + dAtA[i] = 0x6a + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedSecretID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x72 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedSecretID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedSecretID) + copy(dAtA[i:], m.ReferencedSecretID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID))) - i += copy(dAtA[i:], m.ReferencedSecretID) - return i, nil + i-- + dAtA[i] = 0x72 + return len(dAtA) - i, nil } func (m *SelectBy_Kind) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x7a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Kind) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - return i, nil + i-- + dAtA[i] = 0x7a + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedConfigID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedConfigID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedConfigID) + copy(dAtA[i:], m.ReferencedConfigID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedConfigID))) - i += copy(dAtA[i:], m.ReferencedConfigID) - return i, nil + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + return len(dAtA) - i, nil } func (m *WatchRequest) 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 } @@ -2154,49 +1895,58 @@ func (m *WatchRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Entries) > 0 { - for _, msg := range m.Entries { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.ResumeFrom != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.ResumeFrom.Size())) - n15, err := m.ResumeFrom.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } if m.IncludeOldObject { - dAtA[i] = 0x18 - i++ + i-- if m.IncludeOldObject { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if m.ResumeFrom != nil { + { + size, err := m.ResumeFrom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Entries) > 0 { + 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 = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *WatchRequest_WatchEntry) 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 } @@ -2204,40 +1954,48 @@ func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) { } func (m *WatchRequest_WatchEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest_WatchEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } - if m.Action != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) - } if len(m.Filters) > 0 { - for _, msg := range m.Filters { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if m.Action != 0 { + i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *WatchMessage) 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 } @@ -2245,39 +2003,48 @@ func (m *WatchMessage) Marshal() (dAtA []byte, err error) { } func (m *WatchMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Events) > 0 { - for _, msg := range m.Events { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Version != nil { + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - } - if m.Version != nil { + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Version.Size())) - n16, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 } - return i, nil + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *WatchMessage_Event) 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 } @@ -2285,46 +2052,57 @@ func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) { } func (m *WatchMessage_Event) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchMessage_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + if m.OldObject != nil { + { + size, err := m.OldObject.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.Object != nil { + { + size, err := m.Object.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Object.Size())) - n17, err := m.Object.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 } - if m.OldObject != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.OldObject.Size())) - n18, err := m.OldObject.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + if m.Action != 0 { + i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintWatch(dAtA []byte, offset int, v uint64) int { + offset -= sovWatch(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 } type raftProxyWatchServer struct { @@ -2866,14 +2644,7 @@ func (m *WatchMessage_Event) Size() (n int) { } func sovWatch(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozWatch(x uint64) (n int) { return sovWatch(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3175,8 +2946,13 @@ func (this *WatchRequest) String() string { if this == nil { return "nil" } + repeatedStringForEntries := "[]*WatchRequest_WatchEntry{" + for _, f := range this.Entries { + repeatedStringForEntries += strings.Replace(fmt.Sprintf("%v", f), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + "," + } + repeatedStringForEntries += "}" s := strings.Join([]string{`&WatchRequest{`, - `Entries:` + strings.Replace(fmt.Sprintf("%v", this.Entries), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + `,`, + `Entries:` + repeatedStringForEntries + `,`, `ResumeFrom:` + strings.Replace(fmt.Sprintf("%v", this.ResumeFrom), "Version", "Version", 1) + `,`, `IncludeOldObject:` + fmt.Sprintf("%v", this.IncludeOldObject) + `,`, `}`, @@ -3187,10 +2963,15 @@ func (this *WatchRequest_WatchEntry) String() string { if this == nil { return "nil" } + repeatedStringForFilters := "[]*SelectBy{" + for _, f := range this.Filters { + repeatedStringForFilters += strings.Replace(f.String(), "SelectBy", "SelectBy", 1) + "," + } + repeatedStringForFilters += "}" s := strings.Join([]string{`&WatchRequest_WatchEntry{`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "SelectBy", "SelectBy", 1) + `,`, + `Filters:` + repeatedStringForFilters + `,`, `}`, }, "") return s @@ -3199,8 +2980,13 @@ func (this *WatchMessage) String() string { if this == nil { return "nil" } + repeatedStringForEvents := "[]*WatchMessage_Event{" + for _, f := range this.Events { + repeatedStringForEvents += strings.Replace(fmt.Sprintf("%v", f), "WatchMessage_Event", "WatchMessage_Event", 1) + "," + } + repeatedStringForEvents += "}" s := strings.Join([]string{`&WatchMessage{`, - `Events:` + strings.Replace(fmt.Sprintf("%v", this.Events), "WatchMessage_Event", "WatchMessage_Event", 1) + `,`, + `Events:` + repeatedStringForEvents + `,`, `Version:` + strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1) + `,`, `}`, }, "") @@ -3212,8 +2998,8 @@ func (this *WatchMessage_Event) String() string { } s := strings.Join([]string{`&WatchMessage_Event{`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "Object", "Object", 1) + `,`, - `OldObject:` + strings.Replace(fmt.Sprintf("%v", this.OldObject), "Object", "Object", 1) + `,`, + `Object:` + strings.Replace(this.Object.String(), "Object", "Object", 1) + `,`, + `OldObject:` + strings.Replace(this.OldObject.String(), "Object", "Object", 1) + `,`, `}`, }, "") return s @@ -3576,10 +3362,7 @@ func (m *Object) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -3680,10 +3463,7 @@ func (m *SelectBySlot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -3829,10 +3609,7 @@ func (m *SelectByCustom) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4367,10 +4144,7 @@ func (m *SelectBy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4510,10 +4284,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4648,10 +4419,7 @@ func (m *WatchRequest_WatchEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4771,10 +4539,7 @@ func (m *WatchMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4915,10 +4680,7 @@ func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4936,6 +4698,7 @@ func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error { func skipWatch(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 { @@ -4967,10 +4730,8 @@ func skipWatch(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 { @@ -4991,55 +4752,30 @@ func skipWatch(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthWatch } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthWatch - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWatch - } - 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 := skipWatch(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthWatch - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupWatch + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthWatch + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupWatch = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go b/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go index 5923859722..1ff8cdc382 100644 --- a/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go +++ b/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go @@ -11,6 +11,7 @@ import ( descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -24,7 +25,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 WatchSelectors struct { // supported by all object types @@ -59,7 +60,7 @@ func (m *WatchSelectors) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_WatchSelectors.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 } @@ -95,7 +96,7 @@ func (m *StoreObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StoreObject.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 } @@ -136,7 +137,7 @@ func (m *TLSAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_TLSAuthorization.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 } @@ -293,7 +294,7 @@ func (m *TLSAuthorization) CopyFrom(src interface{}) { func (m *WatchSelectors) 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 } @@ -301,147 +302,152 @@ func (m *WatchSelectors) Marshal() (dAtA []byte, err error) { } func (m *WatchSelectors) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchSelectors) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != nil { - dAtA[i] = 0x8 - i++ - if *m.ID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IDPrefix != nil { - dAtA[i] = 0x10 - i++ - if *m.IDPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Name != nil { - dAtA[i] = 0x18 - i++ - if *m.Name { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.NamePrefix != nil { - dAtA[i] = 0x20 - i++ - if *m.NamePrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Custom != nil { - dAtA[i] = 0x28 - i++ - if *m.Custom { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.CustomPrefix != nil { - dAtA[i] = 0x30 - i++ - if *m.CustomPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.ServiceID != nil { - dAtA[i] = 0x38 - i++ - if *m.ServiceID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.NodeID != nil { - dAtA[i] = 0x40 - i++ - if *m.NodeID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Slot != nil { - dAtA[i] = 0x48 - i++ - if *m.Slot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.DesiredState != nil { - dAtA[i] = 0x50 - i++ - if *m.DesiredState { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Role != nil { - dAtA[i] = 0x58 - i++ - if *m.Role { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Membership != nil { - dAtA[i] = 0x60 - i++ - if *m.Membership { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.Kind != nil { - dAtA[i] = 0x68 - i++ + i-- if *m.Kind { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x68 } - return i, nil + if m.Membership != nil { + i-- + if *m.Membership { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.Role != nil { + i-- + if *m.Role { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.DesiredState != nil { + i-- + if *m.DesiredState { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.Slot != nil { + i-- + if *m.Slot { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.NodeID != nil { + i-- + if *m.NodeID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.ServiceID != nil { + i-- + if *m.ServiceID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.CustomPrefix != nil { + i-- + if *m.CustomPrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Custom != nil { + i-- + if *m.Custom { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.NamePrefix != nil { + i-- + if *m.NamePrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Name != nil { + i-- + if *m.Name { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.IDPrefix != nil { + i-- + if *m.IDPrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.ID != nil { + i-- + if *m.ID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreObject) 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 } @@ -449,29 +455,36 @@ func (m *StoreObject) Marshal() (dAtA []byte, err error) { } func (m *StoreObject) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.WatchSelectors == nil { return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("watch_selectors") } else { - dAtA[i] = 0xa - i++ - i = encodeVarintPlugin(dAtA, i, uint64(m.WatchSelectors.Size())) - n1, err := m.WatchSelectors.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.WatchSelectors.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPlugin(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TLSAuthorization) 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 } @@ -479,46 +492,47 @@ func (m *TLSAuthorization) Marshal() (dAtA []byte, err error) { } func (m *TLSAuthorization) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Roles) > 0 { - for _, s := range m.Roles { - 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.Insecure != nil { - dAtA[i] = 0x10 - i++ + i-- if *m.Insecure { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Roles) > 0 { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Roles[iNdEx]) + copy(dAtA[i:], m.Roles[iNdEx]) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Roles[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { + offset -= sovPlugin(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 *WatchSelectors) Size() (n int) { if m == nil { @@ -600,14 +614,7 @@ func (m *TLSAuthorization) Size() (n int) { } func sovPlugin(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozPlugin(x uint64) (n int) { return sovPlugin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -639,7 +646,7 @@ func (this *StoreObject) String() string { return "nil" } s := strings.Join([]string{`&StoreObject{`, - `WatchSelectors:` + strings.Replace(fmt.Sprintf("%v", this.WatchSelectors), "WatchSelectors", "WatchSelectors", 1) + `,`, + `WatchSelectors:` + strings.Replace(this.WatchSelectors.String(), "WatchSelectors", "WatchSelectors", 1) + `,`, `}`, }, "") return s @@ -971,10 +978,7 @@ func (m *WatchSelectors) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1062,10 +1066,7 @@ func (m *StoreObject) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1171,10 +1172,7 @@ func (m *TLSAuthorization) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1192,6 +1190,7 @@ func (m *TLSAuthorization) Unmarshal(dAtA []byte) error { func skipPlugin(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 { @@ -1223,10 +1222,8 @@ func skipPlugin(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 { @@ -1247,55 +1244,30 @@ func skipPlugin(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthPlugin } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthPlugin - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlugin - } - 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 := skipPlugin(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthPlugin - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPlugin + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthPlugin + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPlugin = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/vendor.conf b/vendor/github.com/docker/swarmkit/vendor.conf index 1220bc9f1e..e1c8214a7b 100644 --- a/vendor/github.com/docker/swarmkit/vendor.conf +++ b/vendor/github.com/docker/swarmkit/vendor.conf @@ -8,69 +8,72 @@ # In >=1.11, those errors were brought back but the string had changed again. # After updating GRPC, if integration test failures occur, verify that the # string matching there is correct. -google.golang.org/grpc 25c4f928eaa6d96443009bd842389fb4fa48664e # v1.20.1 -github.com/gogo/protobuf ba06b47c162d49f2af050fb4c75bcbc86a159d5c # v1.2.1 -github.com/golang/protobuf aa810b61a9c79d51363740d207bb46cf8e620ed5 # v1.2.0 -github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1 -google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9 +google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1 +github.com/gogo/protobuf b03c65ea87cdc3521ede29f62fe3ce239267c1bc # v1.3.2 +github.com/golang/protobuf 84668698ea25b64748563aa20726db66a6b8d299 # v1.3.5 +github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1 +google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8 # metrics -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 -github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18 +github.com/grpc-ecosystem/go-grpc-prometheus c225b8c3b01faf2899099b768856a9e916e5087b # v1.2.0 +github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 # etcd/raft -github.com/coreos/etcd d57e8b8d97adfc4a6c224fe116714bf1a1f3beb9 # v3.3.12 -github.com/coreos/go-systemd v17 -github.com/coreos/pkg v3 -github.com/prometheus/client_golang v0.8.0 -github.com/prometheus/client_model 6f3806018612930941127f2a7c6c453ba2c527d2 -github.com/prometheus/common 7600349dcfe1abd18d72d3a1770870d9800a7801 -github.com/prometheus/procfs 7d6f385de8bea29190f15ba9931442a0eaef9af7 +github.com/coreos/etcd 2c834459e1aab78a5d5219c7dfe42335fc4b617a # v3.3.25 -github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 -github.com/docker/docker 827cb09f87964ed38b46502f22a585f2ed4a78e1 -github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 -github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 -github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 -github.com/docker/libkv 458977154600b9f23984d9f4b82e79570b5ae12b -github.com/docker/libnetwork 09cdcc8c0eab3946c2d70e8f6225b05baf1e90d1 -github.com/opencontainers/runc 425e105d5a03fabd737a126ad93d62a9eeede87f # v1.0.0-rc8 -github.com/opencontainers/go-digest v1.0.0-rc1 -github.com/opencontainers/image-spec v1.0.1 -github.com/ishidawataru/sctp 6e2cb1366111dcf547c13531e3a263a067715847 +# go-systemd v17 is required by github.com/coreos/pkg/capnslog/journald_formatter.go +github.com/coreos/go-systemd 39ca1b05acc7ad1220e09f133283b8859a8b71ab # v17 +github.com/coreos/pkg 97fdf19511ea361ae1c100dd393cc47f8dcfa1e1 # v4 +github.com/prometheus/client_golang 6edbbd9e560190e318cdc5b4d3e630b442858380 # v1.6.0 +github.com/prometheus/client_model 7bc5445566f0fe75b15de23e6b93886e982d7bf9 # v0.2.0 +github.com/prometheus/common d978bcb1309602d68bb4ba69cf3f8ed900e07308 # v0.9.1 +github.com/prometheus/procfs 46159f73e74d1cb8dc223deef9b2d049286f46b1 # v0.0.11 +github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 -github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 -github.com/Microsoft/go-winio 6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14 -github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1 -github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 -github.com/cloudflare/cfssl 1.3.2 -github.com/dustin/go-humanize 9f541cc9db5d55bce703bd99987c9d5cb8eea45e # v1.0.0 -github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 -github.com/google/certificate-transparency-go v1.0.20 -github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git -github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad -github.com/hashicorp/golang-lru 7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c # v0.5.1 -github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5 -code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec -github.com/pkg/errors ba968bfe8b2f7e042a574c888954fccecfa385b4 # v0.8.1 -github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 # v1.0.0 -github.com/rcrowley/go-metrics 51425a2415d21afadfd55cd93432c0bc69e9598d -github.com/spf13/cobra 8e91712f174ced10270cf66615e0a9127e7c4de5 -github.com/spf13/pflag 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7 -github.com/stretchr/testify ffdc059bfe9ce6a4e144ba849dbedead332c6053 # v1.3.0 -go.etcd.io/bbolt a0458a2b35708eef59eb5f620ceb3cd1c01a824d # v1.3.3 -golang.org/x/crypto 88737f569e3a9c7ab309cdc09a07fe7fc87233c3 -golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3 -golang.org/x/sys 9eafafc0a87e0fd0aeeba439a4573537970c44c7 -golang.org/x/text f21a4dfb5e38f5895301dc265a8def02365cc3d0 # v0.3.0 -golang.org/x/time fbb02b2291d28baffd63558aa44b4b56f178d650 +github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 +github.com/docker/docker 0ad2293d0e5bbf4c966a0e8b27c3ac3835265577 # master / v21.xx-dev +github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 +github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f +github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 +github.com/docker/libkv 458977154600b9f23984d9f4b82e79570b5ae12b +github.com/opencontainers/runc b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7 # v1.0.0-rc95 +github.com/opencontainers/go-digest ea51bea511f75cfa3ef6098cc253c5c3609b037a # v1.0.0 +github.com/opencontainers/image-spec d60099175f88c47cd379c4738d158884749ed235 # v1.0.1 +github.com/ishidawataru/sctp f2269e66cdee387bd321445d5d300893449805be +github.com/containerd/containerd 36cc874494a56a253cd181a1a685b44b58a2e34a # v1.5.2 + +github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 +github.com/Microsoft/go-winio 5b44b70ab3ab4d291a7c1d28afe7b4afeced0ed4 # v0.4.15 +github.com/sirupsen/logrus 6699a89a232f3db797f2e280639854bbc4b89725 # v1.7.0 +github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 +github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2 +github.com/dustin/go-humanize 9f541cc9db5d55bce703bd99987c9d5cb8eea45e # v1.0.0 +github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 +github.com/google/certificate-transparency-go 37a384cd035e722ea46e55029093e26687138edf # v1.0.20 +github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git +github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad +github.com/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3 +github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 # v1.0.0 +github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5 +code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec # v1.0.0 +github.com/pkg/errors 614d223910a179a466c1767a985424175c39b465 # v0.9.1 +github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 # v1.0.0 +github.com/rcrowley/go-metrics 51425a2415d21afadfd55cd93432c0bc69e9598d +github.com/spf13/cobra 8380ddd3132bdf8fd77731725b550c181dda0aa8 # v1.1.3 +github.com/spf13/pflag 2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab # v1.0.5 +github.com/stretchr/testify ffdc059bfe9ce6a4e144ba849dbedead332c6053 # v1.3.0 +go.etcd.io/bbolt 232d8fc87f50244f9c808f4745759e08a304c029 # v1.3.5 +golang.org/x/crypto c1f2f97bffc9c53fc40a1a28a5b460094c0050d9 +golang.org/x/net 6772e930b67bb09bf22262c7378e7d2f67cf59d1 +golang.org/x/sys d19ff857e887eacb631721f188c7d365c2331456 +golang.org/x/text 23ae387dee1f90d29a23c0e87ee0b46038fbed0e # v0.3.3 +golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 # ginkgo is used for testing in some places in the code. this is it and its # sub-dependencies. -github.com/onsi/ginkgo v1.8.0 -github.com/onsi/gomega v1.5.0 -gopkg.in/yaml.v2 v2.2.1 -github.com/hpcloud/tail v1.0.0 -gopkg.in/fsnotify.v1 v1.4.7 -gopkg.in/tomb.v1 v1 +github.com/onsi/ginkgo eea6ad008b96acdaa524f5b409513bf062b500ad # v1.8.0 +github.com/onsi/gomega 90e289841c1ed79b7a598a7cd9959750cb5e89e2 # v1.5.0 +gopkg.in/yaml.v2 7649d4548cb53a614db133b2a8ac1f31859dda8c # v2.4.0 +github.com/hpcloud/tail a30252cb686a21eb2d0b98132633053ec2f7f1e5 # v1.0.0 +gopkg.in/fsnotify.v1 c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9 # v1.4.7 +gopkg.in/tomb.v1 dd632973f1e7218eb1089048e0798ec9ae7dceb8 # v1 From a04c8210a66e4d735146642053de2c1a316a33bb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 21 Jun 2021 18:02:23 +0200 Subject: [PATCH 3/4] vendor: github.com/docker/docker 25917217cab38eab40c3db0010b915258f4a8491 https://github.com/docker/docker/compare/b0f5bc36fea9dfb9672e1e9b1278ebab797b9ee0..25917217cab38eab40c3db0010b915258f4a8491 Signed-off-by: Sebastiaan van Stijn --- cli/registry/client/endpoint.go | 5 +- vendor.conf | 2 +- .../docker/docker/api/types/client.go | 1 - .../docker/docker/client/build_cancel.go | 2 +- .../docker/docker/client/config_create.go | 2 +- .../docker/docker/client/config_remove.go | 2 +- .../docker/docker/client/config_update.go | 2 +- .../docker/docker/client/container_commit.go | 2 +- .../docker/docker/client/container_copy.go | 2 +- .../docker/docker/client/container_create.go | 2 +- .../docker/docker/client/container_restart.go | 2 +- .../docker/docker/client/container_update.go | 2 +- .../docker/client/distribution_inspect.go | 2 +- .../docker/docker/client/image_build.go | 4 +- .../docker/docker/client/image_create.go | 2 +- .../docker/docker/client/image_import.go | 2 +- .../docker/docker/client/image_search.go | 2 +- .../docker/docker/client/request.go | 17 ++-- .../docker/docker/client/secret_create.go | 2 +- .../docker/docker/client/secret_remove.go | 2 +- .../docker/docker/client/secret_update.go | 2 +- .../docker/docker/client/service_create.go | 2 +- .../docker/docker/client/task_inspect.go | 2 +- .../docker/docker/pkg/archive/archive_unix.go | 8 +- .../docker/docker/pkg/archive/copy.go | 10 ++ .../docker/docker/pkg/fileutils/fileutils.go | 6 -- .../docker/pkg/idtools/idtools_windows.go | 9 ++ .../docker/docker/pkg/system/lcow.go | 48 --------- .../docker/pkg/system/lcow_unsupported.go | 13 --- .../docker/docker/pkg/system/path.go | 32 +----- .../docker/docker/pkg/system/path_unix.go | 6 ++ .../docker/docker/pkg/system/path_windows.go | 23 ++++- .../docker/docker/pkg/system/stat_linux.go | 2 +- .../docker/docker/pkg/system/syscall_unix.go | 11 --- .../docker/pkg/system/syscall_windows.go | 97 +++---------------- .../github.com/docker/docker/registry/auth.go | 59 +++-------- .../docker/docker/registry/endpoint_v1.go | 1 + .../docker/docker/registry/service.go | 13 ++- vendor/github.com/docker/docker/vendor.conf | 70 ++++++------- .../sshprovider/agentprovider_unix.go | 15 +++ .../sshprovider/agentprovider_windows.go | 60 ++++++++++++ 41 files changed, 232 insertions(+), 316 deletions(-) delete mode 100644 vendor/github.com/docker/docker/pkg/system/lcow.go delete mode 100644 vendor/github.com/docker/docker/pkg/system/syscall_unix.go create mode 100644 vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_unix.go create mode 100644 vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_windows.go diff --git a/cli/registry/client/endpoint.go b/cli/registry/client/endpoint.go index 5af00ca70d..f69c5c0dc2 100644 --- a/cli/registry/client/endpoint.go +++ b/cli/registry/client/endpoint.go @@ -90,13 +90,10 @@ func getHTTPTransport(authConfig authtypes.AuthConfig, endpoint registry.APIEndp modifiers := registry.Headers(userAgent, http.Header{}) authTransport := transport.NewTransport(base, modifiers...) - challengeManager, confirmedV2, err := registry.PingV2Registry(endpoint.URL, authTransport) + challengeManager, err := registry.PingV2Registry(endpoint.URL, authTransport) if err != nil { return nil, errors.Wrap(err, "error pinging v2 registry") } - if !confirmedV2 { - return nil, fmt.Errorf("unsupported registry version") - } if authConfig.RegistryToken != "" { passThruTokenHandler := &existingTokenHandler{token: authConfig.RegistryToken} modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, passThruTokenHandler)) diff --git a/vendor.conf b/vendor.conf index 6922c49e54..8e3957db4d 100755 --- a/vendor.conf +++ b/vendor.conf @@ -13,7 +13,7 @@ github.com/creack/pty 2a38352e8b4d7ab6c336eef107e4 github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 github.com/docker/compose-on-kubernetes 78e6a00beda64ac8ccb9fec787e601fe2ce0d5bb # v0.5.0-alpha1 github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 -github.com/docker/docker b0f5bc36fea9dfb9672e1e9b1278ebab797b9ee0 # v20.10.7 +github.com/docker/docker 25917217cab38eab40c3db0010b915258f4a8491 # master (v21.xx-dev) github.com/docker/docker-credential-helpers fc9290adbcf1594e78910e2f0334090eaee0e1ee # v0.6.4 github.com/docker/go d30aec9fd63c35133f8f79c3412ad91a3b08be06 # Contains a customized version of canonical/json and is used by Notary. The package is periodically rebased on current Go versions. github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 diff --git a/vendor/github.com/docker/docker/api/types/client.go b/vendor/github.com/docker/docker/api/types/client.go index 9c464b73e2..9dd343ad64 100644 --- a/vendor/github.com/docker/docker/api/types/client.go +++ b/vendor/github.com/docker/docker/api/types/client.go @@ -59,7 +59,6 @@ type ContainerExecInspect struct { // ContainerListOptions holds parameters to list containers with. type ContainerListOptions struct { - Quiet bool Size bool All bool Latest bool diff --git a/vendor/github.com/docker/docker/client/build_cancel.go b/vendor/github.com/docker/docker/client/build_cancel.go index 3aae43e3d1..b76bf366bb 100644 --- a/vendor/github.com/docker/docker/client/build_cancel.go +++ b/vendor/github.com/docker/docker/client/build_cancel.go @@ -5,7 +5,7 @@ import ( "net/url" ) -// BuildCancel requests the daemon to cancel ongoing build request +// BuildCancel requests the daemon to cancel the ongoing build request. func (cli *Client) BuildCancel(ctx context.Context, id string) error { query := url.Values{} query.Set("id", id) diff --git a/vendor/github.com/docker/docker/client/config_create.go b/vendor/github.com/docker/docker/client/config_create.go index ee7d411df0..f6b1881fc3 100644 --- a/vendor/github.com/docker/docker/client/config_create.go +++ b/vendor/github.com/docker/docker/client/config_create.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/swarm" ) -// ConfigCreate creates a new Config. +// ConfigCreate creates a new config. func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { var response types.ConfigCreateResponse if err := cli.NewVersionError("1.30", "config create"); err != nil { diff --git a/vendor/github.com/docker/docker/client/config_remove.go b/vendor/github.com/docker/docker/client/config_remove.go index a708fcaecf..93de0d8445 100644 --- a/vendor/github.com/docker/docker/client/config_remove.go +++ b/vendor/github.com/docker/docker/client/config_remove.go @@ -2,7 +2,7 @@ package client // import "github.com/docker/docker/client" import "context" -// ConfigRemove removes a Config. +// ConfigRemove removes a config. func (cli *Client) ConfigRemove(ctx context.Context, id string) error { if err := cli.NewVersionError("1.30", "config remove"); err != nil { return err diff --git a/vendor/github.com/docker/docker/client/config_update.go b/vendor/github.com/docker/docker/client/config_update.go index 39e59cf858..ba79ae64e5 100644 --- a/vendor/github.com/docker/docker/client/config_update.go +++ b/vendor/github.com/docker/docker/client/config_update.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/swarm" ) -// ConfigUpdate attempts to update a Config +// ConfigUpdate attempts to update a config func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { if err := cli.NewVersionError("1.30", "config update"); err != nil { return err diff --git a/vendor/github.com/docker/docker/client/container_commit.go b/vendor/github.com/docker/docker/client/container_commit.go index 2966e88c8e..cd7f763464 100644 --- a/vendor/github.com/docker/docker/client/container_commit.go +++ b/vendor/github.com/docker/docker/client/container_commit.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" ) -// ContainerCommit applies changes into a container and creates a new tagged image. +// ContainerCommit applies changes to a container and creates a new tagged image. func (cli *Client) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) { var repository, tag string if options.Reference != "" { diff --git a/vendor/github.com/docker/docker/client/container_copy.go b/vendor/github.com/docker/docker/client/container_copy.go index bb278bf7f3..c0a47c14e3 100644 --- a/vendor/github.com/docker/docker/client/container_copy.go +++ b/vendor/github.com/docker/docker/client/container_copy.go @@ -14,7 +14,7 @@ import ( "github.com/docker/docker/api/types" ) -// ContainerStatPath returns Stat information about a path inside the container filesystem. +// ContainerStatPath returns stat information about a path inside the container filesystem. func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error) { query := url.Values{} query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API. diff --git a/vendor/github.com/docker/docker/client/container_create.go b/vendor/github.com/docker/docker/client/container_create.go index b1d5fea5bd..cfae96a6f5 100644 --- a/vendor/github.com/docker/docker/client/container_create.go +++ b/vendor/github.com/docker/docker/client/container_create.go @@ -19,7 +19,7 @@ type configWrapper struct { Platform *specs.Platform } -// ContainerCreate creates a new container based in the given configuration. +// ContainerCreate creates a new container based on the given configuration. // It can be associated with a name, but it's not mandatory. func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error) { var response container.ContainerCreateCreatedBody diff --git a/vendor/github.com/docker/docker/client/container_restart.go b/vendor/github.com/docker/docker/client/container_restart.go index 41e421969f..aa0d6485de 100644 --- a/vendor/github.com/docker/docker/client/container_restart.go +++ b/vendor/github.com/docker/docker/client/container_restart.go @@ -9,7 +9,7 @@ import ( ) // ContainerRestart stops and starts a container again. -// It makes the daemon to wait for the container to be up again for +// It makes the daemon wait for the container to be up again for // a specific amount of time, given the timeout. func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error { query := url.Values{} diff --git a/vendor/github.com/docker/docker/client/container_update.go b/vendor/github.com/docker/docker/client/container_update.go index 6917cf9fb3..bf68a5300e 100644 --- a/vendor/github.com/docker/docker/client/container_update.go +++ b/vendor/github.com/docker/docker/client/container_update.go @@ -7,7 +7,7 @@ import ( "github.com/docker/docker/api/types/container" ) -// ContainerUpdate updates resources of a container +// ContainerUpdate updates the resources of a container. func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { var response container.ContainerUpdateOKBody serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil) diff --git a/vendor/github.com/docker/docker/client/distribution_inspect.go b/vendor/github.com/docker/docker/client/distribution_inspect.go index f4e3794cb4..7f36c99a01 100644 --- a/vendor/github.com/docker/docker/client/distribution_inspect.go +++ b/vendor/github.com/docker/docker/client/distribution_inspect.go @@ -8,7 +8,7 @@ import ( registrytypes "github.com/docker/docker/api/types/registry" ) -// DistributionInspect returns the image digest with full Manifest +// DistributionInspect returns the image digest with the full manifest. func (cli *Client) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registrytypes.DistributionInspect, error) { // Contact the registry to retrieve digest and platform information var distributionInspect registrytypes.DistributionInspect diff --git a/vendor/github.com/docker/docker/client/image_build.go b/vendor/github.com/docker/docker/client/image_build.go index 8fcf995036..d16e1d8ea9 100644 --- a/vendor/github.com/docker/docker/client/image_build.go +++ b/vendor/github.com/docker/docker/client/image_build.go @@ -14,8 +14,8 @@ import ( "github.com/docker/docker/api/types/container" ) -// ImageBuild sends request to the daemon to build images. -// The Body in the response implement an io.ReadCloser and it's up to the caller to +// ImageBuild sends a request to the daemon to build images. +// The Body in the response implements an io.ReadCloser and it's up to the caller to // close it. func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { query, err := cli.imageBuildOptionsToQuery(options) diff --git a/vendor/github.com/docker/docker/client/image_create.go b/vendor/github.com/docker/docker/client/image_create.go index 239380474e..b1c0227775 100644 --- a/vendor/github.com/docker/docker/client/image_create.go +++ b/vendor/github.com/docker/docker/client/image_create.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" ) -// ImageCreate creates a new image based in the parent options. +// ImageCreate creates a new image based on the parent options. // It returns the JSON content in the response body. func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { ref, err := reference.ParseNormalizedNamed(parentReference) diff --git a/vendor/github.com/docker/docker/client/image_import.go b/vendor/github.com/docker/docker/client/image_import.go index d3336d4106..c5de42cb79 100644 --- a/vendor/github.com/docker/docker/client/image_import.go +++ b/vendor/github.com/docker/docker/client/image_import.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" ) -// ImageImport creates a new image based in the source options. +// ImageImport creates a new image based on the source options. // It returns the JSON content in the response body. func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { if ref != "" { diff --git a/vendor/github.com/docker/docker/client/image_search.go b/vendor/github.com/docker/docker/client/image_search.go index 82955a7477..5f40a22a96 100644 --- a/vendor/github.com/docker/docker/client/image_search.go +++ b/vendor/github.com/docker/docker/client/image_search.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/errdefs" ) -// ImageSearch makes the docker host to search by a term in a remote registry. +// ImageSearch makes the docker host search by a term in a remote registry. // The list of results is not sorted in any fashion. func (cli *Client) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) { var results []registry.SearchResult diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go index 813eac2c9e..d24d28ae51 100644 --- a/vendor/github.com/docker/docker/client/request.go +++ b/vendor/github.com/docker/docker/client/request.go @@ -110,11 +110,16 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u if err != nil { return serverResponse{}, err } + resp, err := cli.doRequest(ctx, req) - if err != nil { - return resp, errdefs.FromStatusCode(err, resp.statusCode) + switch { + case errors.Is(err, context.Canceled): + return serverResponse{}, errdefs.Cancelled(err) + case errors.Is(err, context.DeadlineExceeded): + return serverResponse{}, errdefs.Deadline(err) + case err == nil: + err = cli.checkResponseErr(resp) } - err = cli.checkResponseErr(resp) return resp, errdefs.FromStatusCode(err, resp.statusCode) } @@ -242,10 +247,8 @@ func (cli *Client) addHeaders(req *http.Request, headers headers) *http.Request req.Header.Set(k, v) } - if headers != nil { - for k, v := range headers { - req.Header[k] = v - } + for k, v := range headers { + req.Header[k] = v } return req } diff --git a/vendor/github.com/docker/docker/client/secret_create.go b/vendor/github.com/docker/docker/client/secret_create.go index fd5b914136..c65d38a191 100644 --- a/vendor/github.com/docker/docker/client/secret_create.go +++ b/vendor/github.com/docker/docker/client/secret_create.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/swarm" ) -// SecretCreate creates a new Secret. +// SecretCreate creates a new secret. func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { var response types.SecretCreateResponse if err := cli.NewVersionError("1.25", "secret create"); err != nil { diff --git a/vendor/github.com/docker/docker/client/secret_remove.go b/vendor/github.com/docker/docker/client/secret_remove.go index c16f555804..f6c69e57f8 100644 --- a/vendor/github.com/docker/docker/client/secret_remove.go +++ b/vendor/github.com/docker/docker/client/secret_remove.go @@ -2,7 +2,7 @@ package client // import "github.com/docker/docker/client" import "context" -// SecretRemove removes a Secret. +// SecretRemove removes a secret. func (cli *Client) SecretRemove(ctx context.Context, id string) error { if err := cli.NewVersionError("1.25", "secret remove"); err != nil { return err diff --git a/vendor/github.com/docker/docker/client/secret_update.go b/vendor/github.com/docker/docker/client/secret_update.go index 164256bbc1..d082dcef75 100644 --- a/vendor/github.com/docker/docker/client/secret_update.go +++ b/vendor/github.com/docker/docker/client/secret_update.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/swarm" ) -// SecretUpdate attempts to update a Secret +// SecretUpdate attempts to update a secret. func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { if err := cli.NewVersionError("1.25", "secret update"); err != nil { return err diff --git a/vendor/github.com/docker/docker/client/service_create.go b/vendor/github.com/docker/docker/client/service_create.go index e0428bf98b..a07315f71f 100644 --- a/vendor/github.com/docker/docker/client/service_create.go +++ b/vendor/github.com/docker/docker/client/service_create.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" ) -// ServiceCreate creates a new Service. +// ServiceCreate creates a new service. func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { var response types.ServiceCreateResponse headers := map[string][]string{ diff --git a/vendor/github.com/docker/docker/client/task_inspect.go b/vendor/github.com/docker/docker/client/task_inspect.go index 44d40ba5ae..ed132f3796 100644 --- a/vendor/github.com/docker/docker/client/task_inspect.go +++ b/vendor/github.com/docker/docker/client/task_inspect.go @@ -9,7 +9,7 @@ import ( "github.com/docker/docker/api/types/swarm" ) -// TaskInspectWithRaw returns the task information and its raw representation.. +// TaskInspectWithRaw returns the task information and its raw representation. func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { if taskID == "" { return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID} diff --git a/vendor/github.com/docker/docker/pkg/archive/archive_unix.go b/vendor/github.com/docker/docker/pkg/archive/archive_unix.go index 0b92bb0f4a..412cd5a3b0 100644 --- a/vendor/github.com/docker/docker/pkg/archive/archive_unix.go +++ b/vendor/github.com/docker/docker/pkg/archive/archive_unix.go @@ -10,7 +10,7 @@ import ( "strings" "syscall" - "github.com/containerd/containerd/sys" + "github.com/containerd/containerd/pkg/userns" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/system" "golang.org/x/sys/unix" @@ -51,8 +51,8 @@ func setHeaderForSpecialDevice(hdr *tar.Header, name string, stat interface{}) ( // Currently go does not fill in the major/minors if s.Mode&unix.S_IFBLK != 0 || s.Mode&unix.S_IFCHR != 0 { - hdr.Devmajor = int64(unix.Major(uint64(s.Rdev))) // nolint: unconvert - hdr.Devminor = int64(unix.Minor(uint64(s.Rdev))) // nolint: unconvert + hdr.Devmajor = int64(unix.Major(uint64(s.Rdev))) //nolint: unconvert + hdr.Devminor = int64(unix.Minor(uint64(s.Rdev))) //nolint: unconvert } } @@ -92,7 +92,7 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { } err := system.Mknod(path, mode, int(system.Mkdev(hdr.Devmajor, hdr.Devminor))) - if errors.Is(err, syscall.EPERM) && sys.RunningInUserNS() { + if errors.Is(err, syscall.EPERM) && userns.RunningInUserNS() { // In most cases, cannot create a device if running in user namespace err = nil } diff --git a/vendor/github.com/docker/docker/pkg/archive/copy.go b/vendor/github.com/docker/docker/pkg/archive/copy.go index 57fddac078..4b9f504d7d 100644 --- a/vendor/github.com/docker/docker/pkg/archive/copy.go +++ b/vendor/github.com/docker/docker/pkg/archive/copy.go @@ -354,6 +354,16 @@ func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.Read return } + // Ignoring GoSec G110. See https://github.com/securego/gosec/pull/433 + // and https://cure53.de/pentest-report_opa.pdf, which recommends to + // replace io.Copy with io.CopyN7. The latter allows to specify the + // maximum number of bytes that should be read. By properly defining + // the limit, it can be assured that a GZip compression bomb cannot + // easily cause a Denial-of-Service. + // After reviewing with @tonistiigi and @cpuguy83, this should not + // affect us, because here we do not read into memory, hence should + // not be vulnerable to this code consuming memory. + //nolint:gosec // G110: Potential DoS vulnerability via decompression bomb (gosec) if _, err = io.Copy(rebasedTar, srcTar); err != nil { w.CloseWithError(err) return diff --git a/vendor/github.com/docker/docker/pkg/fileutils/fileutils.go b/vendor/github.com/docker/docker/pkg/fileutils/fileutils.go index 34f1c726fb..fd4fb7f08f 100644 --- a/vendor/github.com/docker/docker/pkg/fileutils/fileutils.go +++ b/vendor/github.com/docker/docker/pkg/fileutils/fileutils.go @@ -9,8 +9,6 @@ import ( "regexp" "strings" "text/scanner" - - "github.com/sirupsen/logrus" ) // PatternMatcher allows checking paths against a list of patterns @@ -89,10 +87,6 @@ func (pm *PatternMatcher) Matches(file string) (bool, error) { } } - if matched { - logrus.Debugf("Skipping excluded path: %s", file) - } - return matched, nil } diff --git a/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go b/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go index 35ede0fffa..0f5aadd496 100644 --- a/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go +++ b/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go @@ -6,6 +6,15 @@ import ( "github.com/docker/docker/pkg/system" ) +const ( + SeTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege" +) + +const ( + ContainerAdministratorSidString = "S-1-5-93-2-1" + ContainerUserSidString = "S-1-5-93-2-2" +) + // This is currently a wrapper around MkdirAll, however, since currently // permissions aren't set through this path, the identity isn't utilized. // Ownership is handled elsewhere, but in the future could be support here diff --git a/vendor/github.com/docker/docker/pkg/system/lcow.go b/vendor/github.com/docker/docker/pkg/system/lcow.go deleted file mode 100644 index 0f00028fbd..0000000000 --- a/vendor/github.com/docker/docker/pkg/system/lcow.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build windows,!no_lcow - -package system // import "github.com/docker/docker/pkg/system" - -import ( - "strings" - - "github.com/Microsoft/hcsshim/osversion" - specs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" -) - -var ( - // lcowSupported determines if Linux Containers on Windows are supported. - lcowSupported = false -) - -// InitLCOW sets whether LCOW is supported or not. Requires RS5+ -func InitLCOW(experimental bool) { - if experimental && osversion.Build() >= osversion.RS5 { - lcowSupported = true - } -} - -func LCOWSupported() bool { - return lcowSupported -} - -// ValidatePlatform determines if a platform structure is valid. -// TODO This is a temporary windows-only function, should be replaced by -// comparison of worker capabilities -func ValidatePlatform(platform specs.Platform) error { - if !IsOSSupported(platform.OS) { - return errors.Errorf("unsupported os %s", platform.OS) - } - return nil -} - -// IsOSSupported determines if an operating system is supported by the host -func IsOSSupported(os string) bool { - if strings.EqualFold("windows", os) { - return true - } - if LCOWSupported() && strings.EqualFold(os, "linux") { - return true - } - return false -} diff --git a/vendor/github.com/docker/docker/pkg/system/lcow_unsupported.go b/vendor/github.com/docker/docker/pkg/system/lcow_unsupported.go index 3d3cf775a7..09150f1282 100644 --- a/vendor/github.com/docker/docker/pkg/system/lcow_unsupported.go +++ b/vendor/github.com/docker/docker/pkg/system/lcow_unsupported.go @@ -1,27 +1,14 @@ -// +build !windows windows,no_lcow - package system // import "github.com/docker/docker/pkg/system" import ( "runtime" "strings" - - specs "github.com/opencontainers/image-spec/specs-go/v1" ) -// InitLCOW does nothing since LCOW is a windows only feature -func InitLCOW(_ bool) {} - // LCOWSupported returns true if Linux containers on Windows are supported. func LCOWSupported() bool { return false } -// ValidatePlatform determines if a platform structure is valid. This function -// is used for LCOW, and is a no-op on non-windows platforms. -func ValidatePlatform(_ specs.Platform) error { - return nil -} - // IsOSSupported determines if an operating system is supported by the host. func IsOSSupported(os string) bool { return strings.EqualFold(runtime.GOOS, os) diff --git a/vendor/github.com/docker/docker/pkg/system/path.go b/vendor/github.com/docker/docker/pkg/system/path.go index 64e892289a..4d81906b9d 100644 --- a/vendor/github.com/docker/docker/pkg/system/path.go +++ b/vendor/github.com/docker/docker/pkg/system/path.go @@ -1,24 +1,15 @@ package system // import "github.com/docker/docker/pkg/system" -import ( - "fmt" - "path/filepath" - "runtime" - "strings" -) - const defaultUnixPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" // DefaultPathEnv is unix style list of directories to search for // executables. Each directory is separated from the next by a colon // ':' character . +// For Windows containers, an empty string is returned as the default +// path will be set by the container, and Docker has no context of what the +// default path should be. func DefaultPathEnv(os string) string { - if runtime.GOOS == "windows" { - if os != runtime.GOOS { - return defaultUnixPathEnv - } - // Deliberately empty on Windows containers on Windows as the default path will be set by - // the container. Docker has no context of what the default path should be. + if os == "windows" { return "" } return defaultUnixPathEnv @@ -47,18 +38,5 @@ type PathVerifier interface { // /a --> \a // d:\ --> Fail func CheckSystemDriveAndRemoveDriveLetter(path string, driver PathVerifier) (string, error) { - if runtime.GOOS != "windows" || LCOWSupported() { - return path, nil - } - - if len(path) == 2 && string(path[1]) == ":" { - return "", fmt.Errorf("No relative path specified in %q", path) - } - if !driver.IsAbs(path) || len(path) < 2 { - return filepath.FromSlash(path), nil - } - if string(path[1]) == ":" && !strings.EqualFold(string(path[0]), "c") { - return "", fmt.Errorf("The specified path is not on the system drive (C:)") - } - return filepath.FromSlash(path[2:]), nil + return checkSystemDriveAndRemoveDriveLetter(path, driver) } diff --git a/vendor/github.com/docker/docker/pkg/system/path_unix.go b/vendor/github.com/docker/docker/pkg/system/path_unix.go index b0b93196a1..19681985da 100644 --- a/vendor/github.com/docker/docker/pkg/system/path_unix.go +++ b/vendor/github.com/docker/docker/pkg/system/path_unix.go @@ -8,3 +8,9 @@ package system // import "github.com/docker/docker/pkg/system" func GetLongPathName(path string) (string, error) { return path, nil } + +// checkSystemDriveAndRemoveDriveLetter is the non-Windows implementation +// of CheckSystemDriveAndRemoveDriveLetter +func checkSystemDriveAndRemoveDriveLetter(path string, driver PathVerifier) (string, error) { + return path, nil +} diff --git a/vendor/github.com/docker/docker/pkg/system/path_windows.go b/vendor/github.com/docker/docker/pkg/system/path_windows.go index 22a56136c8..7d375b0ddc 100644 --- a/vendor/github.com/docker/docker/pkg/system/path_windows.go +++ b/vendor/github.com/docker/docker/pkg/system/path_windows.go @@ -1,6 +1,12 @@ package system // import "github.com/docker/docker/pkg/system" -import "golang.org/x/sys/windows" +import ( + "fmt" + "path/filepath" + "strings" + + "golang.org/x/sys/windows" +) // GetLongPathName converts Windows short pathnames to full pathnames. // For example C:\Users\ADMIN~1 --> C:\Users\Administrator. @@ -25,3 +31,18 @@ func GetLongPathName(path string) (string, error) { } return windows.UTF16ToString(b), nil } + +// checkSystemDriveAndRemoveDriveLetter is the Windows implementation +// of CheckSystemDriveAndRemoveDriveLetter +func checkSystemDriveAndRemoveDriveLetter(path string, driver PathVerifier) (string, error) { + if len(path) == 2 && string(path[1]) == ":" { + return "", fmt.Errorf("No relative path specified in %q", path) + } + if !driver.IsAbs(path) || len(path) < 2 { + return filepath.FromSlash(path), nil + } + if string(path[1]) == ":" && !strings.EqualFold(string(path[0]), "c") { + return "", fmt.Errorf("The specified path is not on the system drive (C:)") + } + return filepath.FromSlash(path[2:]), nil +} diff --git a/vendor/github.com/docker/docker/pkg/system/stat_linux.go b/vendor/github.com/docker/docker/pkg/system/stat_linux.go index 17d5d131a3..3ac02393f0 100644 --- a/vendor/github.com/docker/docker/pkg/system/stat_linux.go +++ b/vendor/github.com/docker/docker/pkg/system/stat_linux.go @@ -9,7 +9,7 @@ func fromStatT(s *syscall.Stat_t) (*StatT, error) { uid: s.Uid, gid: s.Gid, // the type is 32bit on mips - rdev: uint64(s.Rdev), // nolint: unconvert + rdev: uint64(s.Rdev), //nolint: unconvert mtim: s.Mtim}, nil } diff --git a/vendor/github.com/docker/docker/pkg/system/syscall_unix.go b/vendor/github.com/docker/docker/pkg/system/syscall_unix.go deleted file mode 100644 index 905d10f153..0000000000 --- a/vendor/github.com/docker/docker/pkg/system/syscall_unix.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build linux freebsd - -package system // import "github.com/docker/docker/pkg/system" - -import "golang.org/x/sys/unix" - -// Unmount is a platform-specific helper function to call -// the unmount syscall. -func Unmount(dest string) error { - return unix.Unmount(dest, 0) -} diff --git a/vendor/github.com/docker/docker/pkg/system/syscall_windows.go b/vendor/github.com/docker/docker/pkg/system/syscall_windows.go index 1588aa3ef9..afebed74d7 100644 --- a/vendor/github.com/docker/docker/pkg/system/syscall_windows.go +++ b/vendor/github.com/docker/docker/pkg/system/syscall_windows.go @@ -1,69 +1,30 @@ package system // import "github.com/docker/docker/pkg/system" import ( - "syscall" "unsafe" - "github.com/Microsoft/hcsshim/osversion" "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) const ( - OWNER_SECURITY_INFORMATION = windows.OWNER_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.OWNER_SECURITY_INFORMATION - GROUP_SECURITY_INFORMATION = windows.GROUP_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.GROUP_SECURITY_INFORMATION - DACL_SECURITY_INFORMATION = windows.DACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.DACL_SECURITY_INFORMATION - SACL_SECURITY_INFORMATION = windows.SACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.SACL_SECURITY_INFORMATION - LABEL_SECURITY_INFORMATION = windows.LABEL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.LABEL_SECURITY_INFORMATION - ATTRIBUTE_SECURITY_INFORMATION = windows.ATTRIBUTE_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.ATTRIBUTE_SECURITY_INFORMATION - SCOPE_SECURITY_INFORMATION = windows.SCOPE_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.SCOPE_SECURITY_INFORMATION - PROCESS_TRUST_LABEL_SECURITY_INFORMATION = 0x00000080 - ACCESS_FILTER_SECURITY_INFORMATION = 0x00000100 - BACKUP_SECURITY_INFORMATION = windows.BACKUP_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.BACKUP_SECURITY_INFORMATION - PROTECTED_DACL_SECURITY_INFORMATION = windows.PROTECTED_DACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.PROTECTED_DACL_SECURITY_INFORMATION - PROTECTED_SACL_SECURITY_INFORMATION = windows.PROTECTED_SACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.PROTECTED_SACL_SECURITY_INFORMATION - UNPROTECTED_DACL_SECURITY_INFORMATION = windows.UNPROTECTED_DACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.UNPROTECTED_DACL_SECURITY_INFORMATION - UNPROTECTED_SACL_SECURITY_INFORMATION = windows.UNPROTECTED_SACL_SECURITY_INFORMATION // Deprecated: use golang.org/x/sys/windows.UNPROTECTED_SACL_SECURITY_INFORMATION -) - -const ( - SE_UNKNOWN_OBJECT_TYPE = windows.SE_UNKNOWN_OBJECT_TYPE // Deprecated: use golang.org/x/sys/windows.SE_UNKNOWN_OBJECT_TYPE - SE_FILE_OBJECT = windows.SE_FILE_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_FILE_OBJECT - SE_SERVICE = windows.SE_SERVICE // Deprecated: use golang.org/x/sys/windows.SE_SERVICE - SE_PRINTER = windows.SE_PRINTER // Deprecated: use golang.org/x/sys/windows.SE_PRINTER - SE_REGISTRY_KEY = windows.SE_REGISTRY_KEY // Deprecated: use golang.org/x/sys/windows.SE_REGISTRY_KEY - SE_LMSHARE = windows.SE_LMSHARE // Deprecated: use golang.org/x/sys/windows.SE_LMSHARE - SE_KERNEL_OBJECT = windows.SE_KERNEL_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_KERNEL_OBJECT - SE_WINDOW_OBJECT = windows.SE_WINDOW_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_WINDOW_OBJECT - SE_DS_OBJECT = windows.SE_DS_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_DS_OBJECT - SE_DS_OBJECT_ALL = windows.SE_DS_OBJECT_ALL // Deprecated: use golang.org/x/sys/windows.SE_DS_OBJECT_ALL - SE_PROVIDER_DEFINED_OBJECT = windows.SE_PROVIDER_DEFINED_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_PROVIDER_DEFINED_OBJECT - SE_WMIGUID_OBJECT = windows.SE_WMIGUID_OBJECT // Deprecated: use golang.org/x/sys/windows.SE_WMIGUID_OBJECT - SE_REGISTRY_WOW64_32KEY = windows.SE_REGISTRY_WOW64_32KEY // Deprecated: use golang.org/x/sys/windows.SE_REGISTRY_WOW64_32KEY -) - -const ( + // Deprecated: use github.com/docker/pkg/idtools.SeTakeOwnershipPrivilege SeTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege" ) const ( + // Deprecated: use github.com/docker/pkg/idtools.ContainerAdministratorSidString ContainerAdministratorSidString = "S-1-5-93-2-1" - ContainerUserSidString = "S-1-5-93-2-2" + // Deprecated: use github.com/docker/pkg/idtools.ContainerUserSidString + ContainerUserSidString = "S-1-5-93-2-2" ) var ( - ntuserApiset = windows.NewLazyDLL("ext-ms-win-ntuser-window-l1-1-0") - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - procGetVersionExW = modkernel32.NewProc("GetVersionExW") - procSetNamedSecurityInfo = modadvapi32.NewProc("SetNamedSecurityInfoW") - procGetSecurityDescriptorDacl = modadvapi32.NewProc("GetSecurityDescriptorDacl") + ntuserApiset = windows.NewLazyDLL("ext-ms-win-ntuser-window-l1-1-0") + procGetVersionExW = modkernel32.NewProc("GetVersionExW") ) -// OSVersion is a wrapper for Windows version information -// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx -type OSVersion = osversion.OSVersion - -// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx +// https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa // TODO: use golang.org/x/sys/windows.OsVersionInfoEx (needs OSVersionInfoSize to be exported) type osVersionInfoEx struct { OSVersionInfoSize uint32 @@ -79,31 +40,21 @@ type osVersionInfoEx struct { Reserve byte } -// GetOSVersion gets the operating system version on Windows. Note that -// dockerd.exe must be manifested to get the correct version information. -// Deprecated: use github.com/Microsoft/hcsshim/osversion.Get() instead -func GetOSVersion() OSVersion { - return osversion.Get() -} - -// IsWindowsClient returns true if the SKU is client +// IsWindowsClient returns true if the SKU is client. It returns false on +// Windows server, or if an error occurred when making the GetVersionExW +// syscall. func IsWindowsClient() bool { osviex := &osVersionInfoEx{OSVersionInfoSize: 284} r1, _, err := procGetVersionExW.Call(uintptr(unsafe.Pointer(osviex))) if r1 == 0 { - logrus.Warnf("GetVersionExW failed - assuming server SKU: %v", err) + logrus.WithError(err).Warn("GetVersionExW failed - assuming server SKU") return false } - const verNTWorkstation = 0x00000001 + // VER_NT_WORKSTATION, see https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa + const verNTWorkstation = 0x00000001 // VER_NT_WORKSTATION return osviex.ProductType == verNTWorkstation } -// Unmount is a platform-specific helper function to call -// the unmount syscall. Not supported on Windows -func Unmount(_ string) error { - return nil -} - // HasWin32KSupport determines whether containers that depend on win32k can // run on this machine. Win32k is the driver used to implement windowing. func HasWin32KSupport() bool { @@ -112,25 +63,3 @@ func HasWin32KSupport() bool { // APIs. return ntuserApiset.Load() == nil } - -// Deprecated: use golang.org/x/sys/windows.SetNamedSecurityInfo() -func SetNamedSecurityInfo(objectName *uint16, objectType uint32, securityInformation uint32, sidOwner *windows.SID, sidGroup *windows.SID, dacl *byte, sacl *byte) (result error) { - r0, _, _ := syscall.Syscall9(procSetNamedSecurityInfo.Addr(), 7, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(sidOwner)), uintptr(unsafe.Pointer(sidGroup)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0) - if r0 != 0 { - result = syscall.Errno(r0) - } - return -} - -// Deprecated: uses golang.org/x/sys/windows.SecurityDescriptorFromString() and golang.org/x/sys/windows.SECURITY_DESCRIPTOR.DACL() -func GetSecurityDescriptorDacl(securityDescriptor *byte, daclPresent *uint32, dacl **byte, daclDefaulted *uint32) (result error) { - r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(securityDescriptor)), uintptr(unsafe.Pointer(daclPresent)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclDefaulted)), 0, 0) - if r1 == 0 { - if e1 != 0 { - result = e1 - } else { - result = syscall.EINVAL - } - } - return -} diff --git a/vendor/github.com/docker/docker/registry/auth.go b/vendor/github.com/docker/docker/registry/auth.go index 2d0ecde2d4..81533d269f 100644 --- a/vendor/github.com/docker/docker/registry/auth.go +++ b/vendor/github.com/docker/docker/registry/auth.go @@ -87,26 +87,19 @@ func loginV2(authConfig *types.AuthConfig, endpoint APIEndpoint, userAgent strin logrus.Debugf("attempting v2 login to registry endpoint %s", endpointStr) - loginClient, foundV2, err := v2AuthHTTPClient(endpoint.URL, authTransport, modifiers, creds, nil) + loginClient, err := v2AuthHTTPClient(endpoint.URL, authTransport, modifiers, creds, nil) if err != nil { return "", "", err } req, err := http.NewRequest(http.MethodGet, endpointStr, nil) if err != nil { - if !foundV2 { - err = fallbackError{err: err} - } return "", "", err } resp, err := loginClient.Do(req) if err != nil { err = translateV2AuthError(err) - if !foundV2 { - err = fallbackError{err: err} - } - return "", "", err } defer resp.Body.Close() @@ -117,19 +110,13 @@ func loginV2(authConfig *types.AuthConfig, endpoint APIEndpoint, userAgent strin // TODO(dmcgowan): Attempt to further interpret result, status code and error code string err = errors.Errorf("login attempt to %s failed with status: %d %s", endpointStr, resp.StatusCode, http.StatusText(resp.StatusCode)) - if !foundV2 { - err = fallbackError{err: err} - } return "", "", err } -func v2AuthHTTPClient(endpoint *url.URL, authTransport http.RoundTripper, modifiers []transport.RequestModifier, creds auth.CredentialStore, scopes []auth.Scope) (*http.Client, bool, error) { - challengeManager, foundV2, err := PingV2Registry(endpoint, authTransport) +func v2AuthHTTPClient(endpoint *url.URL, authTransport http.RoundTripper, modifiers []transport.RequestModifier, creds auth.CredentialStore, scopes []auth.Scope) (*http.Client, error) { + challengeManager, err := PingV2Registry(endpoint, authTransport) if err != nil { - if !foundV2 { - err = fallbackError{err: err} - } - return nil, foundV2, err + return nil, err } tokenHandlerOptions := auth.TokenHandlerOptions{ @@ -147,8 +134,7 @@ func v2AuthHTTPClient(endpoint *url.URL, authTransport http.RoundTripper, modifi return &http.Client{ Transport: tr, Timeout: 15 * time.Second, - }, foundV2, nil - + }, nil } // ConvertToHostname converts a registry url which has http|https prepended @@ -197,18 +183,9 @@ func (err PingResponseError) Error() string { } // PingV2Registry attempts to ping a v2 registry and on success return a -// challenge manager for the supported authentication types and -// whether v2 was confirmed by the response. If a response is received but -// cannot be interpreted a PingResponseError will be returned. -func PingV2Registry(endpoint *url.URL, transport http.RoundTripper) (challenge.Manager, bool, error) { - var ( - foundV2 = false - v2Version = auth.APIVersion{ - Type: "registry", - Version: "2.0", - } - ) - +// challenge manager for the supported authentication types. +// If a response is received but cannot be interpreted, a PingResponseError will be returned. +func PingV2Registry(endpoint *url.URL, transport http.RoundTripper) (challenge.Manager, error) { pingClient := &http.Client{ Transport: transport, Timeout: 15 * time.Second, @@ -216,32 +193,20 @@ func PingV2Registry(endpoint *url.URL, transport http.RoundTripper) (challenge.M endpointStr := strings.TrimRight(endpoint.String(), "/") + "/v2/" req, err := http.NewRequest(http.MethodGet, endpointStr, nil) if err != nil { - return nil, false, err + return nil, err } resp, err := pingClient.Do(req) if err != nil { - return nil, false, err + return nil, err } defer resp.Body.Close() - versions := auth.APIVersions(resp, DefaultRegistryVersionHeader) - for _, pingVersion := range versions { - if pingVersion == v2Version { - // The version header indicates we're definitely - // talking to a v2 registry. So don't allow future - // fallbacks to the v1 protocol. - - foundV2 = true - break - } - } - challengeManager := challenge.NewSimpleManager() if err := challengeManager.AddResponse(resp); err != nil { - return nil, foundV2, PingResponseError{ + return nil, PingResponseError{ Err: err, } } - return challengeManager, foundV2, nil + return challengeManager, nil } diff --git a/vendor/github.com/docker/docker/registry/endpoint_v1.go b/vendor/github.com/docker/docker/registry/endpoint_v1.go index db342d1412..18304bda9c 100644 --- a/vendor/github.com/docker/docker/registry/endpoint_v1.go +++ b/vendor/github.com/docker/docker/registry/endpoint_v1.go @@ -22,6 +22,7 @@ type V1Endpoint struct { } // NewV1Endpoint parses the given address to return a registry endpoint. +// TODO: remove. This is only used by search. func NewV1Endpoint(index *registrytypes.IndexInfo, userAgent string, metaHeaders http.Header) (*V1Endpoint, error) { tlsConfig, err := newTLSConfig(index.Name, index.Secure) if err != nil { diff --git a/vendor/github.com/docker/docker/registry/service.go b/vendor/github.com/docker/docker/registry/service.go index 3b08e39da2..7e55923c11 100644 --- a/vendor/github.com/docker/docker/registry/service.go +++ b/vendor/github.com/docker/docker/registry/service.go @@ -135,12 +135,11 @@ func (s *DefaultService) Auth(ctx context.Context, authConfig *types.AuthConfig, if err == nil { return } - if fErr, ok := err.(fallbackError); ok { - logrus.WithError(fErr.err).Infof("Error logging in to endpoint, trying next endpoint") - continue + if errdefs.IsUnauthorized(err) { + // Failed to authenticate; don't continue with (non-TLS) endpoints. + return status, token, err } - - return "", "", err + logrus.WithError(err).Infof("Error logging in to endpoint, trying next endpoint") } return "", "", err @@ -194,14 +193,14 @@ func (s *DefaultService) Search(ctx context.Context, term string, limit int, aut } modifiers := Headers(userAgent, nil) - v2Client, foundV2, err := v2AuthHTTPClient(endpoint.URL, endpoint.client.Transport, modifiers, creds, scopes) + v2Client, err := v2AuthHTTPClient(endpoint.URL, endpoint.client.Transport, modifiers, creds, scopes) if err != nil { if fErr, ok := err.(fallbackError); ok { logrus.Errorf("Cannot use identity token for search, v2 auth not supported: %v", fErr.err) } else { return nil, err } - } else if foundV2 { + } else { // Copy non transport http client features v2Client.Timeout = endpoint.client.Timeout v2Client.CheckRedirect = endpoint.client.CheckRedirect diff --git a/vendor/github.com/docker/docker/vendor.conf b/vendor/github.com/docker/docker/vendor.conf index b8cb3ae97e..0a51cc72a6 100644 --- a/vendor/github.com/docker/docker/vendor.conf +++ b/vendor/github.com/docker/docker/vendor.conf @@ -1,11 +1,10 @@ github.com/Azure/go-ansiterm d6e3b3328b783f23731bc4d058875b0371ff8109 -github.com/Microsoft/hcsshim 89a9a3b524264d34985f1d48793ab2b2d2e430f6 # moby branch -github.com/Microsoft/go-winio 5b44b70ab3ab4d291a7c1d28afe7b4afeced0ed4 # v0.4.15 +github.com/Microsoft/hcsshim e811ee705ec77df2ae28857ade553043fb564d91 # v0.8.16 +github.com/Microsoft/go-winio 5c2e05d71961716a6c392a06ada435aaf5d5302c # v0.4.19 github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a github.com/golang/gddo 72a348e765d293ed6d1ded7b699591f14d6cd921 github.com/google/uuid 0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1 github.com/gorilla/mux 98cb6bf42e086f6af920b965c38cacc07402d51b # v1.8.0 -github.com/Microsoft/opengcs a10967154e143a36014584a6f664344e3bb0aa64 github.com/moby/locker 281af2d563954745bea9d1487c965f24d30742fe # v1.0.1 github.com/moby/term bea5bbe245bf407372d477f1361d2ff042d2f556 @@ -14,13 +13,13 @@ github.com/moby/term bea5bbe245bf407372d477f1361d # tool (vndr) currently does not support submodules / vendoring sub-paths, so we vendor # the top-level moby/sys repository (which contains both) and pick the most recent tag, # which could be either `mountinfo/vX.Y.Z`, `mount/vX.Y.Z`, or `symlink/vX.Y.Z`. -github.com/moby/sys 1bc8673b57550ddf85262eb0fed0aac651a37dab # symlink/v0.1.0 +github.com/moby/sys b0f1fd7235275d01bd35cc4421e884e522395f45 # mountinfo/v0.4.1 github.com/creack/pty 2a38352e8b4d7ab6c336eef107e42a55e72e7fbc # v1.1.11 github.com/sirupsen/logrus 6699a89a232f3db797f2e280639854bbc4b89725 # v1.7.0 github.com/tchap/go-patricia a7f0089c6f496e8e70402f61733606daa326cac5 # v2.3.0 -golang.org/x/net ab34263943818b32f575efc978a3d24e80b04bd7 -golang.org/x/sys b64e53b001e413bd5067f36d4e439eded3827374 +golang.org/x/net e18ecbb051101a46fc263334b127c89bc7bff7ea +golang.org/x/sys d19ff857e887eacb631721f188c7d365c2331456 github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 golang.org/x/text 23ae387dee1f90d29a23c0e87ee0b46038fbed0e # v0.3.3 @@ -30,11 +29,11 @@ github.com/syndtr/gocapability 42c35b4376354fd554efc7ad35e0 github.com/RackSec/srslog a4725f04ec91af1a91b380da679d6e0c2f061e59 github.com/imdario/mergo 1afb36080aec31e0d1528973ebe6721b191b0369 # v0.3.8 -golang.org/x/sync cd5d95a43a6e21273425c7ae415d3df9ea832eeb +golang.org/x/sync 036812b2e83c0ddf193dd5a34e034151da389d09 # buildkit -github.com/moby/buildkit 244e8cde639f71a05a1a2e0670bd88e0206ce55c # v0.8.3-3-g244e8cde -github.com/tonistiigi/fsutil 0834f99b7b85462efb69b4f571a4fa3ca7da5ac9 +github.com/moby/buildkit 9f254e18360a24c2ae47b26f772c3c89533bcbb7 # master / v0.9.0-dev +github.com/tonistiigi/fsutil d72af97c0eaf93c1d20360e3cb9c63c223675b83 github.com/tonistiigi/units 6950e57a87eaf136bbe44ef2ec8e75b9e3569de2 github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746 github.com/opentracing/opentracing-go d34af3eaa63c4d08ab54863a4bdd0daa45212e12 # v1.2.0 @@ -62,18 +61,19 @@ github.com/docker/libkv 458977154600b9f23984d9f4b82e github.com/vishvananda/netns db3c7e526aae966c4ccfa6c8189b693d6ac5d202 github.com/vishvananda/netlink f049be6f391489d3f374498fe0c8df8449258372 # v1.1.0 github.com/moby/ipvs 4566ccea0e08d68e9614c3e7a64a23b850c4bb35 # v1.0.1 +github.com/urfave/cli a65b733b303f0055f8d324d805f393cd3e7a7904 -# When updating, consider updating TOMLV_COMMIT in hack/dockerfile/install/tomlv.installer accordingly -github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1 github.com/samuel/go-zookeeper d0e0d8e11f318e000a8cc434616d69e329edc374 github.com/deckarep/golang-set ef32fa3046d9f249d399f98ebaf9be944430fd1d -github.com/coreos/etcd d57e8b8d97adfc4a6c224fe116714bf1a1f3beb9 # v3.3.12 +github.com/coreos/etcd 2c834459e1aab78a5d5219c7dfe42335fc4b617a # v3.3.25 github.com/coreos/go-semver 8ab6407b697782a06568d4b7f1db25550ec2e4c6 # v0.2.0 -github.com/ugorji/go b4c50a2b199d93b13dc15e78929cfb23bfdf21ab # v1.1.1 github.com/hashicorp/consul 9a9cc9341bb487651a0399e3fc5e1e8a42e62dd9 # v0.5.2 github.com/miekg/dns 6c0c4e6581f8e173cc562c8b3363ab984e4ae071 # v1.1.27 github.com/ishidawataru/sctp f2269e66cdee387bd321445d5d300893449805be go.etcd.io/bbolt 232d8fc87f50244f9c808f4745759e08a304c029 # v1.3.5 +github.com/json-iterator/go a1ca0830781e007c66b225121d2cdb3a649421f6 # v1.1.10 +github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 +github.com/modern-go/reflect2 94122c33edd36123c84d5368cfb2b69df93a0ec8 # v1.0.1 # get graph and distribution packages github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 @@ -90,8 +90,8 @@ google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfc # the containerd project first, and update both after that is merged. # This commit does not need to match RUNC_COMMIT as it is used for helper # packages but should be newer or equal. -github.com/opencontainers/runc ff819c7e9184c13b7c2607fe6c30ae19403a7aff # v1.0.0-rc92 -github.com/opencontainers/runtime-spec 4d89ac9fbff6c455f46a5bb59c6b1bb7184a5e43 # v1.0.3-0.20200728170252-4d89ac9fbff6 +github.com/opencontainers/runc b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7 # v1.0.0-rc95 +github.com/opencontainers/runtime-spec 1c3f411f041711bbeecf35ff7e93461ea6789220 # v1.0.3-0.20210326190908-1c3f411f0417 github.com/opencontainers/image-spec d60099175f88c47cd379c4738d158884749ed235 # v1.0.1 github.com/cyphar/filepath-securejoin a261ee33d7a517f054effbf451841abaafe3e0fd # v0.2.2 @@ -99,14 +99,14 @@ github.com/cyphar/filepath-securejoin a261ee33d7a517f054effbf45184 github.com/coreos/go-systemd 39ca1b05acc7ad1220e09f133283b8859a8b71ab # v17 # systemd integration (journald, daemon/listeners, containerd/cgroups) -github.com/coreos/go-systemd/v22 2d78030078ef61b3cae27f42ad6d0e46db51b339 # v22.0.0 -github.com/godbus/dbus/v5 37bf87eef99d69c4f1d3528bd66e3a87dc201472 # v5.0.3 +github.com/coreos/go-systemd/v22 256724e3db397c5ca4287b8f0c78e9e8492fdb01 # v22.3.1 +github.com/godbus/dbus/v5 c88335c0b1d28a30e7fc76d526a06154b85e5d97 # v5.0.4 # gelf logging driver deps github.com/Graylog2/go-gelf 1550ee647df0510058c9d67a45c56f18911d80b8 # v2 branch # fluent-logger-golang deps -github.com/fluent/fluent-logger-golang 7a6c9dcd7f14c2ed5d8c55c11b894e5455ee311b # v1.4.0 +github.com/fluent/fluent-logger-golang b9b7fb02ccfee8ba4e69aa87386820c2bf24fd11 # v1.6.1 github.com/philhofer/fwd bb6d471dc95d4fe11e432687f8b70ff496cf3136 # v1.0.0 github.com/tinylib/msgp af6442a0fcf6e2a1b824f70dd0c734f01e817751 # v1.1.0 @@ -130,30 +130,32 @@ github.com/googleapis/gax-go bd5b16380fd03dc758d11cef74ba google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8 # containerd -github.com/containerd/containerd 0edc412565dcc6e3d6125ff9e4b009ad4b89c638 # master (v1.5.0-dev) -github.com/containerd/fifo 0724c46b320cf96bb172a0550c19a4b1fca4dacb -github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165 -github.com/containerd/cgroups 0b889c03f102012f1d93a97ddd3ef71cd6f4f510 -github.com/containerd/console 5d7e1412f07b502a01029ea20e20e0d2be31fa7c # v1.0.1 -github.com/containerd/go-runc 16b287bc67d069a60fa48db15f330b790b74365b -github.com/containerd/typeurl cd3ce7159eae562a4f60ceff37dada11a939d247 # v1.0.1 +github.com/containerd/containerd 36cc874494a56a253cd181a1a685b44b58a2e34a # v1.5.2 +github.com/containerd/fifo 650e8a8a179d040123db61f016cb133143e7a581 # v1.0.0 +github.com/containerd/continuity bce1c3f9669b6f3e7f6656ee715b0b4d75fa64a6 # v0.1.0 +github.com/containerd/cgroups b9de8a2212026c07cec67baf3323f1fc0121e048 # v1.0.1 +github.com/containerd/console 2f1e3d2b6afd18e8b2077816c711205a0b4d8769 # v1.0.2 +github.com/containerd/go-runc 16b287bc67d069a60fa48db15f330b790b74365b # v1.0.0 +github.com/containerd/typeurl 5e43fb8b75ed2f2305fc04e6918c8d10636771bc # v1.0.2 github.com/containerd/ttrpc bfba540dc45464586c106b1f31c8547933c1eb41 # v1.0.2 github.com/gogo/googleapis 01e0f9cca9b92166042241267ee2a5cdf5cff46c # v1.3.2 -github.com/cilium/ebpf 1c8d4c9ef7759622653a1d319284a44652333b28 +github.com/cilium/ebpf ef54c303d1fff1e80a9bf20f00a378fde5419d61 # v0.5.0 +github.com/klauspost/compress a3b7545c88eea469c2246bee0e6c130525d56190 # v1.11.13 +github.com/pelletier/go-toml 65ca8064882c8c308e5c804c5d5443d409e0738c # v1.8.1 # cluster -github.com/docker/swarmkit 17d8d4e4d8bdec33d386e6362d3537fa9493ba00 -github.com/gogo/protobuf 5628607bb4c51c3157aacc3a50f0ab707582b805 # v1.3.1 +github.com/docker/swarmkit 2dcf70aafdc9ea55af3aaaeca440638cde0ecda6 # master +github.com/gogo/protobuf b03c65ea87cdc3521ede29f62fe3ce239267c1bc # v1.3.2 github.com/golang/protobuf 84668698ea25b64748563aa20726db66a6b8d299 # v1.3.5 github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2 github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 github.com/google/certificate-transparency-go 37a384cd035e722ea46e55029093e26687138edf # v1.0.20 -golang.org/x/crypto c1f2f97bffc9c53fc40a1a28a5b460094c0050d9 -golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 +golang.org/x/crypto 0c34fe9e7dc2486962ef9867e3edb3503537209f +golang.org/x/time 3af7569d3a1e776fc2a3c1cec133b43105ea9c2e github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git github.com/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3 -github.com/coreos/pkg 3ac0863d7acf3bc44daf49afef8919af12f704ef # v3 +github.com/coreos/pkg 97fdf19511ea361ae1c100dd393cc47f8dcfa1e1 # v4 code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec # v1.0.0 # prometheus @@ -168,7 +170,7 @@ github.com/grpc-ecosystem/go-grpc-prometheus c225b8c3b01faf2899099b768856 github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 # cli -github.com/spf13/cobra 86f8bfd7fef868a174e1b606783bd7f5c82ddf8f # v1.1.1 +github.com/spf13/cobra 8380ddd3132bdf8fd77731725b550c181dda0aa8 # v1.1.3 github.com/spf13/pflag 2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab # v1.0.5 github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 # v1.0.0 github.com/morikuni/aec 39771216ff4c63d11f5e604076f9c45e8be1067b # v1.0.0 @@ -176,8 +178,8 @@ github.com/morikuni/aec 39771216ff4c63d11f5e604076f9 # metrics github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 -github.com/opencontainers/selinux 2f45b3796d18f1ab4c9fc0c888a98d0a0fd6e429 # v1.8.0 -github.com/willf/bitset 559910e8471e48d76d9e5a1ba15842dee77ad45d # v1.1.11 +github.com/opencontainers/selinux 76bc82e11d854d3e40c08889d13c98abcea72ea2 # v1.8.2 +github.com/bits-and-blooms/bitset 59de210119f50cedaa42d175dc88b6335fcf63f6 # v1.2.0 # archive/tar diff --git a/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_unix.go b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_unix.go new file mode 100644 index 0000000000..07b6b7b1e9 --- /dev/null +++ b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_unix.go @@ -0,0 +1,15 @@ +// +build !windows + +package sshprovider + +import ( + "github.com/pkg/errors" +) + +func getFallbackAgentPath() (string, error) { + return "", errors.Errorf("make sure SSH_AUTH_SOCK is set") +} + +func getWindowsPipeDialer(path string) *socketDialer { + return nil +} diff --git a/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_windows.go b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_windows.go new file mode 100644 index 0000000000..812e273c2e --- /dev/null +++ b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider_windows.go @@ -0,0 +1,60 @@ +// +build windows + +package sshprovider + +import ( + "net" + "regexp" + "strings" + + "github.com/Microsoft/go-winio" + "github.com/pkg/errors" + "golang.org/x/sys/windows" +) + +// Returns the Windows OpenSSH agent named pipe path, but +// only if the agent is running. Returns an error otherwise. +func getFallbackAgentPath() (string, error) { + // Windows OpenSSH agent uses a named pipe rather + // than a UNIX socket. These pipes do not play nice + // with os.Stat (which tries to open its target), so + // use a FindFirstFile syscall to check for existence. + var fd windows.Win32finddata + + path := `\\.\pipe\openssh-ssh-agent` + pathPtr, _ := windows.UTF16PtrFromString(path) + handle, err := windows.FindFirstFile(pathPtr, &fd) + + if err != nil { + msg := "Windows OpenSSH agent not available at %s." + + " Enable the SSH agent service or set SSH_AUTH_SOCK." + return "", errors.Errorf(msg, path) + } + + _ = windows.CloseHandle(handle) + + return path, nil +} + +// Returns true if the path references a named pipe. +func isWindowsPipePath(path string) bool { + // If path matches \\*\pipe\* then it references a named pipe + // and requires winio.DialPipe() rather than DialTimeout("unix"). + // Slashes and backslashes may be used interchangeably in the path. + // Path separators may consist of multiple consecutive (back)slashes. + pipePattern := strings.ReplaceAll("^[/]{2}[^/]+[/]+pipe[/]+", "/", `\\/`) + ok, _ := regexp.MatchString(pipePattern, path) + return ok +} + +func getWindowsPipeDialer(path string) *socketDialer { + if isWindowsPipePath(path) { + return &socketDialer{path: path, dialer: windowsPipeDialer} + } + + return nil +} + +func windowsPipeDialer(path string) (net.Conn, error) { + return winio.DialPipe(path, nil) +} From 711334e9a4b70978816052564d3bfcc3b182733d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 22 Jun 2021 10:17:41 +0200 Subject: [PATCH 4/4] vendor: github.com/moby/buildkit 9f254e18360a24c2ae47b26f772c3c89533bcbb7 (master / v0.9.0-dev) full diff: https://github.com/moby/buildkit/compare/8142d66b5ebde79846b869fba30d9d30633e74aa...9f254e18360a24c2ae47b26f772c3c89533bcbb7 Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- .../golang/protobuf/jsonpb/jsonpb.go | 1290 ----------------- .../protobuf/ptypes/struct/struct.pb.go | 338 ----- .../protobuf/ptypes/struct/struct.proto | 95 -- vendor/github.com/moby/buildkit/README.md | 23 + .../api/services/control/control.pb.go | 92 +- .../api/services/control/control.proto | 3 - .../moby/buildkit/api/types/worker.pb.go | 12 +- .../moby/buildkit/client/llb/exec.go | 2 + .../moby/buildkit/client/llb/fileop.go | 18 + .../moby/buildkit/client/llb/source.go | 47 +- .../gateway}/errdefs/exit.go | 6 +- .../frontend/gateway/grpcclient/client.go | 4 +- .../frontend/gateway/pb/gateway.pb.go | 179 +-- vendor/github.com/moby/buildkit/go.mod | 72 +- .../moby/buildkit/session/auth/auth.go | 12 +- .../moby/buildkit/session/auth/auth.pb.go | 40 +- .../session/auth/authprovider/tokenseed.go | 5 +- .../buildkit/session/filesync/diffcopy.go | 8 +- .../buildkit/session/filesync/filesync.pb.go | 76 +- .../buildkit/session/filesync/filesync.proto | 8 +- .../buildkit/session/filesync/generate.go | 2 +- .../buildkit/session/secrets/secrets.pb.go | 12 +- .../buildkit/session/sshforward/ssh.pb.go | 15 +- .../sshforward/sshprovider/agentprovider.go | 51 +- .../moby/buildkit/solver/errdefs/context.go | 13 - .../buildkit/solver/errdefs/errdefs.pb.go | 399 ----- .../buildkit/solver/errdefs/errdefs.proto | 43 - .../buildkit/solver/errdefs/fronetendcap.go | 41 - .../moby/buildkit/solver/errdefs/generate.go | 3 - .../moby/buildkit/solver/errdefs/op.go | 20 - .../moby/buildkit/solver/errdefs/solve.go | 74 - .../moby/buildkit/solver/errdefs/source.go | 128 -- .../buildkit/solver/errdefs/subrequest.go | 41 - .../moby/buildkit/solver/errdefs/vertex.go | 36 - .../moby/buildkit/solver/pb/caps.go | 18 +- .../moby/buildkit/solver/pb/ops.pb.go | 625 ++++---- .../moby/buildkit/solver/pb/ops.proto | 5 + .../moby/buildkit/util/apicaps/caps.go | 7 + .../moby/buildkit/util/apicaps/pb/caps.pb.go | 5 +- .../buildkit/util/gitutil/git_protocol.go | 46 + .../util/progress/progressui/printer.go | 1 - .../util/sshutil/transport_validation.go | 2 +- .../moby/buildkit/util/stack/stack.pb.go | 4 +- 44 files changed, 695 insertions(+), 3228 deletions(-) delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/jsonpb.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/struct/struct.proto rename vendor/github.com/moby/buildkit/{solver => frontend/gateway}/errdefs/exit.go (79%) delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/context.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/errdefs.proto delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/fronetendcap.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/generate.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/op.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/solve.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/source.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/subrequest.go delete mode 100644 vendor/github.com/moby/buildkit/solver/errdefs/vertex.go create mode 100644 vendor/github.com/moby/buildkit/util/gitutil/git_protocol.go diff --git a/vendor.conf b/vendor.conf index 8e3957db4d..c5b43f7167 100755 --- a/vendor.conf +++ b/vendor.conf @@ -47,7 +47,7 @@ github.com/Microsoft/go-winio 5c2e05d71961716a6c392a06ada4 github.com/Microsoft/hcsshim e811ee705ec77df2ae28857ade553043fb564d91 # v0.8.16 github.com/miekg/pkcs11 210dc1e16747c5ba98a03bcbcf728c38086ea357 # v1.0.3 github.com/mitchellh/mapstructure d16e9488127408e67948eb43b6d3fbb9f222da10 # v1.3.2 -github.com/moby/buildkit 8142d66b5ebde79846b869fba30d9d30633e74aa # v0.8.1 +github.com/moby/buildkit 9f254e18360a24c2ae47b26f772c3c89533bcbb7 # master / v0.9.0-dev github.com/moby/sys b0f1fd7235275d01bd35cc4421e884e522395f45 # mountinfo/v0.4.1 (latest tag, either mount/vXXX, mountinfo/vXXX or symlink/vXXX) github.com/moby/term 3f7ff695adc6a35abc925370dd0a4dafb48ec64d github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go deleted file mode 100644 index f0d66befbb..0000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go +++ /dev/null @@ -1,1290 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2015 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// 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 -// OWNER 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. - -/* -Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON. -It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json. - -This package produces a different output than the standard "encoding/json" package, -which does not operate correctly on protocol buffers. -*/ -package jsonpb - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - - stpb "github.com/golang/protobuf/ptypes/struct" -) - -const secondInNanos = int64(time.Second / time.Nanosecond) -const maxSecondsInDuration = 315576000000 - -// Marshaler is a configurable object for converting between -// protocol buffer objects and a JSON representation for them. -type Marshaler struct { - // Whether to render enum values as integers, as opposed to string values. - EnumsAsInts bool - - // Whether to render fields with zero values. - EmitDefaults bool - - // A string to indent each level by. The presence of this field will - // also cause a space to appear between the field separator and - // value, and for newlines to be appear between fields and array - // elements. - Indent string - - // Whether to use the original (.proto) name for fields. - OrigName bool - - // A custom URL resolver to use when marshaling Any messages to JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// AnyResolver takes a type URL, present in an Any message, and resolves it into -// an instance of the associated message. -type AnyResolver interface { - Resolve(typeUrl string) (proto.Message, error) -} - -func defaultResolveAny(typeUrl string) (proto.Message, error) { - // Only the part of typeUrl after the last slash is relevant. - mname := typeUrl - if slash := strings.LastIndex(mname, "/"); slash >= 0 { - mname = mname[slash+1:] - } - mt := proto.MessageType(mname) - if mt == nil { - return nil, fmt.Errorf("unknown message type %q", mname) - } - return reflect.New(mt.Elem()).Interface().(proto.Message), nil -} - -// JSONPBMarshaler is implemented by protobuf messages that customize the -// way they are marshaled to JSON. Messages that implement this should -// also implement JSONPBUnmarshaler so that the custom format can be -// parsed. -// -// The JSON marshaling must follow the proto to JSON specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBMarshaler interface { - MarshalJSONPB(*Marshaler) ([]byte, error) -} - -// JSONPBUnmarshaler is implemented by protobuf messages that customize -// the way they are unmarshaled from JSON. Messages that implement this -// should also implement JSONPBMarshaler so that the custom format can be -// produced. -// -// The JSON unmarshaling must follow the JSON to proto specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBUnmarshaler interface { - UnmarshalJSONPB(*Unmarshaler, []byte) error -} - -// Marshal marshals a protocol buffer into JSON. -func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error { - v := reflect.ValueOf(pb) - if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { - return errors.New("Marshal called with nil") - } - // Check for unset required fields first. - if err := checkRequiredFields(pb); err != nil { - return err - } - writer := &errWriter{writer: out} - return m.marshalObject(writer, pb, "", "") -} - -// MarshalToString converts a protocol buffer object to JSON string. -func (m *Marshaler) MarshalToString(pb proto.Message) (string, error) { - var buf bytes.Buffer - if err := m.Marshal(&buf, pb); err != nil { - return "", err - } - return buf.String(), nil -} - -type int32Slice []int32 - -var nonFinite = map[string]float64{ - `"NaN"`: math.NaN(), - `"Infinity"`: math.Inf(1), - `"-Infinity"`: math.Inf(-1), -} - -// For sorting extensions ids to ensure stable output. -func (s int32Slice) Len() int { return len(s) } -func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } -func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -type wkt interface { - XXX_WellKnownType() string -} - -var ( - wktType = reflect.TypeOf((*wkt)(nil)).Elem() - messageType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// marshalObject writes a struct to the Writer. -func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeURL string) error { - if jsm, ok := v.(JSONPBMarshaler); ok { - b, err := jsm.MarshalJSONPB(m) - if err != nil { - return err - } - if typeURL != "" { - // we are marshaling this object to an Any type - var js map[string]*json.RawMessage - if err = json.Unmarshal(b, &js); err != nil { - return fmt.Errorf("type %T produced invalid JSON: %v", v, err) - } - turl, err := json.Marshal(typeURL) - if err != nil { - return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) - } - js["@type"] = (*json.RawMessage)(&turl) - if m.Indent != "" { - b, err = json.MarshalIndent(js, indent, m.Indent) - } else { - b, err = json.Marshal(js) - } - if err != nil { - return err - } - } - - out.write(string(b)) - return out.err - } - - s := reflect.ValueOf(v).Elem() - - // Handle well-known types. - if wkt, ok := v.(wkt); ok { - switch wkt.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - // "Wrappers use the same representation in JSON - // as the wrapped primitive type, ..." - sprop := proto.GetProperties(s.Type()) - return m.marshalValue(out, sprop.Prop[0], s.Field(0), indent) - case "Any": - // Any is a bit more involved. - return m.marshalAny(out, v, indent) - case "Duration": - s, ns := s.Field(0).Int(), s.Field(1).Int() - if s < -maxSecondsInDuration || s > maxSecondsInDuration { - return fmt.Errorf("seconds out of range %v", s) - } - if ns <= -secondInNanos || ns >= secondInNanos { - return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) - } - if (s > 0 && ns < 0) || (s < 0 && ns > 0) { - return errors.New("signs of seconds and nanos do not match") - } - // Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision, followed by the suffix "s". - f := "%d.%09d" - if ns < 0 { - ns = -ns - if s == 0 { - f = "-%d.%09d" - } - } - x := fmt.Sprintf(f, s, ns) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`s"`) - return out.err - case "Struct", "ListValue": - // Let marshalValue handle the `Struct.fields` map or the `ListValue.values` slice. - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent) - case "Timestamp": - // "RFC 3339, where generated output will always be Z-normalized - // and uses 0, 3, 6 or 9 fractional digits." - s, ns := s.Field(0).Int(), s.Field(1).Int() - if ns < 0 || ns >= secondInNanos { - return fmt.Errorf("ns out of range [0, %v)", secondInNanos) - } - t := time.Unix(s, ns).UTC() - // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`Z"`) - return out.err - case "Value": - // Value has a single oneof. - kind := s.Field(0) - if kind.IsNil() { - // "absence of any variant indicates an error" - return errors.New("nil Value") - } - // oneof -> *T -> T -> T.F - x := kind.Elem().Elem().Field(0) - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, x, indent) - } - } - - out.write("{") - if m.Indent != "" { - out.write("\n") - } - - firstField := true - - if typeURL != "" { - if err := m.marshalTypeURL(out, indent, typeURL); err != nil { - return err - } - firstField = false - } - - for i := 0; i < s.NumField(); i++ { - value := s.Field(i) - valueField := s.Type().Field(i) - if strings.HasPrefix(valueField.Name, "XXX_") { - continue - } - - // IsNil will panic on most value kinds. - switch value.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface: - if value.IsNil() { - continue - } - } - - if !m.EmitDefaults { - switch value.Kind() { - case reflect.Bool: - if !value.Bool() { - continue - } - case reflect.Int32, reflect.Int64: - if value.Int() == 0 { - continue - } - case reflect.Uint32, reflect.Uint64: - if value.Uint() == 0 { - continue - } - case reflect.Float32, reflect.Float64: - if value.Float() == 0 { - continue - } - case reflect.String: - if value.Len() == 0 { - continue - } - case reflect.Map, reflect.Ptr, reflect.Slice: - if value.IsNil() { - continue - } - } - } - - // Oneof fields need special handling. - if valueField.Tag.Get("protobuf_oneof") != "" { - // value is an interface containing &T{real_value}. - sv := value.Elem().Elem() // interface -> *T -> T - value = sv.Field(0) - valueField = sv.Type().Field(0) - } - prop := jsonProperties(valueField, m.OrigName) - if !firstField { - m.writeSep(out) - } - if err := m.marshalField(out, prop, value, indent); err != nil { - return err - } - firstField = false - } - - // Handle proto2 extensions. - if ep, ok := v.(proto.Message); ok { - extensions := proto.RegisteredExtensions(v) - // Sort extensions for stable output. - ids := make([]int32, 0, len(extensions)) - for id, desc := range extensions { - if !proto.HasExtension(ep, desc) { - continue - } - ids = append(ids, id) - } - sort.Sort(int32Slice(ids)) - for _, id := range ids { - desc := extensions[id] - if desc == nil { - // unknown extension - continue - } - ext, extErr := proto.GetExtension(ep, desc) - if extErr != nil { - return extErr - } - value := reflect.ValueOf(ext) - var prop proto.Properties - prop.Parse(desc.Tag) - prop.JSONName = fmt.Sprintf("[%s]", desc.Name) - if !firstField { - m.writeSep(out) - } - if err := m.marshalField(out, &prop, value, indent); err != nil { - return err - } - firstField = false - } - - } - - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err -} - -func (m *Marshaler) writeSep(out *errWriter) { - if m.Indent != "" { - out.write(",\n") - } else { - out.write(",") - } -} - -func (m *Marshaler) marshalAny(out *errWriter, any proto.Message, indent string) error { - // "If the Any contains a value that has a special JSON mapping, - // it will be converted as follows: {"@type": xxx, "value": yyy}. - // Otherwise, the value will be converted into a JSON object, - // and the "@type" field will be inserted to indicate the actual data type." - v := reflect.ValueOf(any).Elem() - turl := v.Field(0).String() - val := v.Field(1).Bytes() - - var msg proto.Message - var err error - if m.AnyResolver != nil { - msg, err = m.AnyResolver.Resolve(turl) - } else { - msg, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if err := proto.Unmarshal(val, msg); err != nil { - return err - } - - if _, ok := msg.(wkt); ok { - out.write("{") - if m.Indent != "" { - out.write("\n") - } - if err := m.marshalTypeURL(out, indent, turl); err != nil { - return err - } - m.writeSep(out) - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - out.write(`"value": `) - } else { - out.write(`"value":`) - } - if err := m.marshalObject(out, msg, indent+m.Indent, ""); err != nil { - return err - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err - } - - return m.marshalObject(out, msg, indent, turl) -} - -func (m *Marshaler) marshalTypeURL(out *errWriter, indent, typeURL string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"@type":`) - if m.Indent != "" { - out.write(" ") - } - b, err := json.Marshal(typeURL) - if err != nil { - return err - } - out.write(string(b)) - return out.err -} - -// marshalField writes field description and value to the Writer. -func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"`) - out.write(prop.JSONName) - out.write(`":`) - if m.Indent != "" { - out.write(" ") - } - if err := m.marshalValue(out, prop, v, indent); err != nil { - return err - } - return nil -} - -// marshalValue writes the value to the Writer. -func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - var err error - v = reflect.Indirect(v) - - // Handle nil pointer - if v.Kind() == reflect.Invalid { - out.write("null") - return out.err - } - - // Handle repeated elements. - if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 { - out.write("[") - comma := "" - for i := 0; i < v.Len(); i++ { - sliceVal := v.Index(i) - out.write(comma) - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil { - return err - } - comma = "," - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write("]") - return out.err - } - - // Handle well-known types. - // Most are handled up in marshalObject (because 99% are messages). - if v.Type().Implements(wktType) { - wkt := v.Interface().(wkt) - switch wkt.XXX_WellKnownType() { - case "NullValue": - out.write("null") - return out.err - } - } - - // Handle enumerations. - if !m.EnumsAsInts && prop.Enum != "" { - // Unknown enum values will are stringified by the proto library as their - // value. Such values should _not_ be quoted or they will be interpreted - // as an enum string instead of their value. - enumStr := v.Interface().(fmt.Stringer).String() - var valStr string - if v.Kind() == reflect.Ptr { - valStr = strconv.Itoa(int(v.Elem().Int())) - } else { - valStr = strconv.Itoa(int(v.Int())) - } - isKnownEnum := enumStr != valStr - if isKnownEnum { - out.write(`"`) - } - out.write(enumStr) - if isKnownEnum { - out.write(`"`) - } - return out.err - } - - // Handle nested messages. - if v.Kind() == reflect.Struct { - return m.marshalObject(out, v.Addr().Interface().(proto.Message), indent+m.Indent, "") - } - - // Handle maps. - // Since Go randomizes map iteration, we sort keys for stable output. - if v.Kind() == reflect.Map { - out.write(`{`) - keys := v.MapKeys() - sort.Sort(mapKeys(keys)) - for i, k := range keys { - if i > 0 { - out.write(`,`) - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - - // TODO handle map key prop properly - b, err := json.Marshal(k.Interface()) - if err != nil { - return err - } - s := string(b) - - // If the JSON is not a string value, encode it again to make it one. - if !strings.HasPrefix(s, `"`) { - b, err := json.Marshal(s) - if err != nil { - return err - } - s = string(b) - } - - out.write(s) - out.write(`:`) - if m.Indent != "" { - out.write(` `) - } - - vprop := prop - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := m.marshalValue(out, vprop, v.MapIndex(k), indent+m.Indent); err != nil { - return err - } - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write(`}`) - return out.err - } - - // Handle non-finite floats, e.g. NaN, Infinity and -Infinity. - if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { - f := v.Float() - var sval string - switch { - case math.IsInf(f, 1): - sval = `"Infinity"` - case math.IsInf(f, -1): - sval = `"-Infinity"` - case math.IsNaN(f): - sval = `"NaN"` - } - if sval != "" { - out.write(sval) - return out.err - } - } - - // Default handling defers to the encoding/json library. - b, err := json.Marshal(v.Interface()) - if err != nil { - return err - } - needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64) - if needToQuote { - out.write(`"`) - } - out.write(string(b)) - if needToQuote { - out.write(`"`) - } - return out.err -} - -// Unmarshaler is a configurable object for converting from a JSON -// representation to a protocol buffer object. -type Unmarshaler struct { - // Whether to allow messages to contain unknown fields, as opposed to - // failing to unmarshal. - AllowUnknownFields bool - - // A custom URL resolver to use when unmarshaling Any messages from JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - inputValue := json.RawMessage{} - if err := dec.Decode(&inputValue); err != nil { - return err - } - if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil { - return err - } - return checkRequiredFields(pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func (u *Unmarshaler) Unmarshal(r io.Reader, pb proto.Message) error { - dec := json.NewDecoder(r) - return u.UnmarshalNext(dec, pb) -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - return new(Unmarshaler).UnmarshalNext(dec, pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func Unmarshal(r io.Reader, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(r, pb) -} - -// UnmarshalString will populate the fields of a protocol buffer based -// on a JSON string. This function is lenient and will decode any options -// permutations of the related Marshaler. -func UnmarshalString(str string, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(strings.NewReader(str), pb) -} - -// unmarshalValue converts/copies a value into the target. -// prop may be nil. -func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.Properties) error { - targetType := target.Type() - - // Allocate memory for pointer fields. - if targetType.Kind() == reflect.Ptr { - // If input value is "null" and target is a pointer type, then the field should be treated as not set - // UNLESS the target is structpb.Value, in which case it should be set to structpb.NullValue. - _, isJSONPBUnmarshaler := target.Interface().(JSONPBUnmarshaler) - if string(inputValue) == "null" && targetType != reflect.TypeOf(&stpb.Value{}) && !isJSONPBUnmarshaler { - return nil - } - target.Set(reflect.New(targetType.Elem())) - - return u.unmarshalValue(target.Elem(), inputValue, prop) - } - - if jsu, ok := target.Addr().Interface().(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, []byte(inputValue)) - } - - // Handle well-known types that are not pointers. - if w, ok := target.Addr().Interface().(wkt); ok { - switch w.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - return u.unmarshalValue(target.Field(0), inputValue, prop) - case "Any": - // Use json.RawMessage pointer type instead of value to support pre-1.8 version. - // 1.8 changed RawMessage.MarshalJSON from pointer type to value type, see - // https://github.com/golang/go/issues/14493 - var jsonFields map[string]*json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - val, ok := jsonFields["@type"] - if !ok || val == nil { - return errors.New("Any JSON doesn't have '@type'") - } - - var turl string - if err := json.Unmarshal([]byte(*val), &turl); err != nil { - return fmt.Errorf("can't unmarshal Any's '@type': %q", *val) - } - target.Field(0).SetString(turl) - - var m proto.Message - var err error - if u.AnyResolver != nil { - m, err = u.AnyResolver.Resolve(turl) - } else { - m, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if _, ok := m.(wkt); ok { - val, ok := jsonFields["value"] - if !ok { - return errors.New("Any JSON doesn't have 'value'") - } - - if err := u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } else { - delete(jsonFields, "@type") - nestedProto, err := json.Marshal(jsonFields) - if err != nil { - return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err) - } - - if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } - - b, err := proto.Marshal(m) - if err != nil { - return fmt.Errorf("can't marshal proto %T into Any.Value: %v", m, err) - } - target.Field(1).SetBytes(b) - - return nil - case "Duration": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - d, err := time.ParseDuration(unq) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - ns := d.Nanoseconds() - s := ns / 1e9 - ns %= 1e9 - target.Field(0).SetInt(s) - target.Field(1).SetInt(ns) - return nil - case "Timestamp": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - t, err := time.Parse(time.RFC3339Nano, unq) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - - target.Field(0).SetInt(t.Unix()) - target.Field(1).SetInt(int64(t.Nanosecond())) - return nil - case "Struct": - var m map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &m); err != nil { - return fmt.Errorf("bad StructValue: %v", err) - } - - target.Field(0).Set(reflect.ValueOf(map[string]*stpb.Value{})) - for k, jv := range m { - pv := &stpb.Value{} - if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil { - return fmt.Errorf("bad value in StructValue for key %q: %v", k, err) - } - target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv)) - } - return nil - case "ListValue": - var s []json.RawMessage - if err := json.Unmarshal(inputValue, &s); err != nil { - return fmt.Errorf("bad ListValue: %v", err) - } - - target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s)))) - for i, sv := range s { - if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil { - return err - } - } - return nil - case "Value": - ivStr := string(inputValue) - if ivStr == "null" { - target.Field(0).Set(reflect.ValueOf(&stpb.Value_NullValue{})) - } else if v, err := strconv.ParseFloat(ivStr, 0); err == nil { - target.Field(0).Set(reflect.ValueOf(&stpb.Value_NumberValue{v})) - } else if v, err := unquote(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&stpb.Value_StringValue{v})) - } else if v, err := strconv.ParseBool(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&stpb.Value_BoolValue{v})) - } else if err := json.Unmarshal(inputValue, &[]json.RawMessage{}); err == nil { - lv := &stpb.ListValue{} - target.Field(0).Set(reflect.ValueOf(&stpb.Value_ListValue{lv})) - return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop) - } else if err := json.Unmarshal(inputValue, &map[string]json.RawMessage{}); err == nil { - sv := &stpb.Struct{} - target.Field(0).Set(reflect.ValueOf(&stpb.Value_StructValue{sv})) - return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop) - } else { - return fmt.Errorf("unrecognized type for Value %q", ivStr) - } - return nil - } - } - - // Handle enums, which have an underlying type of int32, - // and may appear as strings. - // The case of an enum appearing as a number is handled - // at the bottom of this function. - if inputValue[0] == '"' && prop != nil && prop.Enum != "" { - vmap := proto.EnumValueMap(prop.Enum) - // Don't need to do unquoting; valid enum names - // are from a limited character set. - s := inputValue[1 : len(inputValue)-1] - n, ok := vmap[string(s)] - if !ok { - return fmt.Errorf("unknown value %q for enum %s", s, prop.Enum) - } - if target.Kind() == reflect.Ptr { // proto2 - target.Set(reflect.New(targetType.Elem())) - target = target.Elem() - } - if targetType.Kind() != reflect.Int32 { - return fmt.Errorf("invalid target %q for enum %s", targetType.Kind(), prop.Enum) - } - target.SetInt(int64(n)) - return nil - } - - // Handle nested messages. - if targetType.Kind() == reflect.Struct { - var jsonFields map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - consumeField := func(prop *proto.Properties) (json.RawMessage, bool) { - // Be liberal in what names we accept; both orig_name and camelName are okay. - fieldNames := acceptedJSONFieldNames(prop) - - vOrig, okOrig := jsonFields[fieldNames.orig] - vCamel, okCamel := jsonFields[fieldNames.camel] - if !okOrig && !okCamel { - return nil, false - } - // If, for some reason, both are present in the data, favour the camelName. - var raw json.RawMessage - if okOrig { - raw = vOrig - delete(jsonFields, fieldNames.orig) - } - if okCamel { - raw = vCamel - delete(jsonFields, fieldNames.camel) - } - return raw, true - } - - sprops := proto.GetProperties(targetType) - for i := 0; i < target.NumField(); i++ { - ft := target.Type().Field(i) - if strings.HasPrefix(ft.Name, "XXX_") { - continue - } - - valueForField, ok := consumeField(sprops.Prop[i]) - if !ok { - continue - } - - if err := u.unmarshalValue(target.Field(i), valueForField, sprops.Prop[i]); err != nil { - return err - } - } - // Check for any oneof fields. - if len(jsonFields) > 0 { - for _, oop := range sprops.OneofTypes { - raw, ok := consumeField(oop.Prop) - if !ok { - continue - } - nv := reflect.New(oop.Type.Elem()) - target.Field(oop.Field).Set(nv) - if err := u.unmarshalValue(nv.Elem().Field(0), raw, oop.Prop); err != nil { - return err - } - } - } - // Handle proto2 extensions. - if len(jsonFields) > 0 { - if ep, ok := target.Addr().Interface().(proto.Message); ok { - for _, ext := range proto.RegisteredExtensions(ep) { - name := fmt.Sprintf("[%s]", ext.Name) - raw, ok := jsonFields[name] - if !ok { - continue - } - delete(jsonFields, name) - nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem()) - if err := u.unmarshalValue(nv.Elem(), raw, nil); err != nil { - return err - } - if err := proto.SetExtension(ep, ext, nv.Interface()); err != nil { - return err - } - } - } - } - if !u.AllowUnknownFields && len(jsonFields) > 0 { - // Pick any field to be the scapegoat. - var f string - for fname := range jsonFields { - f = fname - break - } - return fmt.Errorf("unknown field %q in %v", f, targetType) - } - return nil - } - - // Handle arrays (which aren't encoded bytes) - if targetType.Kind() == reflect.Slice && targetType.Elem().Kind() != reflect.Uint8 { - var slc []json.RawMessage - if err := json.Unmarshal(inputValue, &slc); err != nil { - return err - } - if slc != nil { - l := len(slc) - target.Set(reflect.MakeSlice(targetType, l, l)) - for i := 0; i < l; i++ { - if err := u.unmarshalValue(target.Index(i), slc[i], prop); err != nil { - return err - } - } - } - return nil - } - - // Handle maps (whose keys are always strings) - if targetType.Kind() == reflect.Map { - var mp map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &mp); err != nil { - return err - } - if mp != nil { - target.Set(reflect.MakeMap(targetType)) - for ks, raw := range mp { - // Unmarshal map key. The core json library already decoded the key into a - // string, so we handle that specially. Other types were quoted post-serialization. - var k reflect.Value - if targetType.Key().Kind() == reflect.String { - k = reflect.ValueOf(ks) - } else { - k = reflect.New(targetType.Key()).Elem() - var kprop *proto.Properties - if prop != nil && prop.MapKeyProp != nil { - kprop = prop.MapKeyProp - } - if err := u.unmarshalValue(k, json.RawMessage(ks), kprop); err != nil { - return err - } - } - - // Unmarshal map value. - v := reflect.New(targetType.Elem()).Elem() - var vprop *proto.Properties - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := u.unmarshalValue(v, raw, vprop); err != nil { - return err - } - target.SetMapIndex(k, v) - } - } - return nil - } - - // Non-finite numbers can be encoded as strings. - isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isFloat { - if num, ok := nonFinite[string(inputValue)]; ok { - target.SetFloat(num) - return nil - } - } - - // integers & floats can be encoded as strings. In this case we drop - // the quotes and proceed as normal. - isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 || - targetType.Kind() == reflect.Int32 || targetType.Kind() == reflect.Uint32 || - targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isNum && strings.HasPrefix(string(inputValue), `"`) { - inputValue = inputValue[1 : len(inputValue)-1] - } - - // Use the encoding/json for parsing other value types. - return json.Unmarshal(inputValue, target.Addr().Interface()) -} - -func unquote(s string) (string, error) { - var ret string - err := json.Unmarshal([]byte(s), &ret) - return ret, err -} - -// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute. -func jsonProperties(f reflect.StructField, origName bool) *proto.Properties { - var prop proto.Properties - prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) - if origName || prop.JSONName == "" { - prop.JSONName = prop.OrigName - } - return &prop -} - -type fieldNames struct { - orig, camel string -} - -func acceptedJSONFieldNames(prop *proto.Properties) fieldNames { - opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName} - if prop.JSONName != "" { - opts.camel = prop.JSONName - } - return opts -} - -// Writer wrapper inspired by https://blog.golang.org/errors-are-values -type errWriter struct { - writer io.Writer - err error -} - -func (w *errWriter) write(str string) { - if w.err != nil { - return - } - _, w.err = w.writer.Write([]byte(str)) -} - -// Map fields may have key types of non-float scalars, strings and enums. -// The easiest way to sort them in some deterministic order is to use fmt. -// If this turns out to be inefficient we can always consider other options, -// such as doing a Schwartzian transform. -// -// Numeric keys are sorted in numeric order per -// https://developers.google.com/protocol-buffers/docs/proto#maps. -type mapKeys []reflect.Value - -func (s mapKeys) Len() int { return len(s) } -func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s mapKeys) Less(i, j int) bool { - if k := s[i].Kind(); k == s[j].Kind() { - switch k { - case reflect.String: - return s[i].String() < s[j].String() - case reflect.Int32, reflect.Int64: - return s[i].Int() < s[j].Int() - case reflect.Uint32, reflect.Uint64: - return s[i].Uint() < s[j].Uint() - } - } - return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) -} - -// checkRequiredFields returns an error if any required field in the given proto message is not set. -// This function is used by both Marshal and Unmarshal. While required fields only exist in a -// proto2 message, a proto3 message can contain proto2 message(s). -func checkRequiredFields(pb proto.Message) error { - // Most well-known type messages do not contain required fields. The "Any" type may contain - // a message that has required fields. - // - // When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value - // field in order to transform that into JSON, and that should have returned an error if a - // required field is not set in the embedded message. - // - // When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the - // embedded message to store the serialized message in Any.Value field, and that should have - // returned an error if a required field is not set. - if _, ok := pb.(wkt); ok { - return nil - } - - v := reflect.ValueOf(pb) - // Skip message if it is not a struct pointer. - if v.Kind() != reflect.Ptr { - return nil - } - v = v.Elem() - if v.Kind() != reflect.Struct { - return nil - } - - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - sfield := v.Type().Field(i) - - if sfield.PkgPath != "" { - // blank PkgPath means the field is exported; skip if not exported - continue - } - - if strings.HasPrefix(sfield.Name, "XXX_") { - continue - } - - // Oneof field is an interface implemented by wrapper structs containing the actual oneof - // field, i.e. an interface containing &T{real_value}. - if sfield.Tag.Get("protobuf_oneof") != "" { - if field.Kind() != reflect.Interface { - continue - } - v := field.Elem() - if v.Kind() != reflect.Ptr || v.IsNil() { - continue - } - v = v.Elem() - if v.Kind() != reflect.Struct || v.NumField() < 1 { - continue - } - field = v.Field(0) - sfield = v.Type().Field(0) - } - - protoTag := sfield.Tag.Get("protobuf") - if protoTag == "" { - continue - } - var prop proto.Properties - prop.Init(sfield.Type, sfield.Name, protoTag, &sfield) - - switch field.Kind() { - case reflect.Map: - if field.IsNil() { - continue - } - // Check each map value. - keys := field.MapKeys() - for _, k := range keys { - v := field.MapIndex(k) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Slice: - // Handle non-repeated type, e.g. bytes. - if !prop.Repeated { - if prop.Required && field.IsNil() { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - - // Handle repeated type. - if field.IsNil() { - continue - } - // Check each slice item. - for i := 0; i < field.Len(); i++ { - v := field.Index(i) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Ptr: - if field.IsNil() { - if prop.Required { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - if err := checkRequiredFieldsInValue(field); err != nil { - return err - } - } - } - - // Handle proto2 extensions. - for _, ext := range proto.RegisteredExtensions(pb) { - if !proto.HasExtension(pb, ext) { - continue - } - ep, err := proto.GetExtension(pb, ext) - if err != nil { - return err - } - err = checkRequiredFieldsInValue(reflect.ValueOf(ep)) - if err != nil { - return err - } - } - - return nil -} - -func checkRequiredFieldsInValue(v reflect.Value) error { - if v.Type().Implements(messageType) { - return checkRequiredFields(v.Interface().(proto.Message)) - } - return nil -} diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go b/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go deleted file mode 100644 index d82d6176b5..0000000000 --- a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/struct.proto - -package structpb - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// 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.ProtoPackageIsVersion3 // please upgrade the proto package - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -type NullValue int32 - -const ( - // Null value. - NullValue_NULL_VALUE NullValue = 0 -) - -var NullValue_name = map[int32]string{ - 0: "NULL_VALUE", -} - -var NullValue_value = map[string]int32{ - "NULL_VALUE": 0, -} - -func (x NullValue) String() string { - return proto.EnumName(NullValue_name, int32(x)) -} - -func (NullValue) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{0} -} - -func (NullValue) XXX_WellKnownType() string { return "NullValue" } - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -type Struct struct { - // Unordered map of dynamically typed values. - Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,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 *Struct) Reset() { *m = Struct{} } -func (m *Struct) String() string { return proto.CompactTextString(m) } -func (*Struct) ProtoMessage() {} -func (*Struct) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{0} -} - -func (*Struct) XXX_WellKnownType() string { return "Struct" } - -func (m *Struct) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Struct.Unmarshal(m, b) -} -func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Struct.Marshal(b, m, deterministic) -} -func (m *Struct) XXX_Merge(src proto.Message) { - xxx_messageInfo_Struct.Merge(m, src) -} -func (m *Struct) XXX_Size() int { - return xxx_messageInfo_Struct.Size(m) -} -func (m *Struct) XXX_DiscardUnknown() { - xxx_messageInfo_Struct.DiscardUnknown(m) -} - -var xxx_messageInfo_Struct proto.InternalMessageInfo - -func (m *Struct) GetFields() map[string]*Value { - if m != nil { - return m.Fields - } - return nil -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of that -// variants, absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -type Value struct { - // The kind of value. - // - // Types that are valid to be assigned to Kind: - // *Value_NullValue - // *Value_NumberValue - // *Value_StringValue - // *Value_BoolValue - // *Value_StructValue - // *Value_ListValue - Kind isValue_Kind `protobuf_oneof:"kind"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Value) Reset() { *m = Value{} } -func (m *Value) String() string { return proto.CompactTextString(m) } -func (*Value) ProtoMessage() {} -func (*Value) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{1} -} - -func (*Value) XXX_WellKnownType() string { return "Value" } - -func (m *Value) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Value.Unmarshal(m, b) -} -func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Value.Marshal(b, m, deterministic) -} -func (m *Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_Value.Merge(m, src) -} -func (m *Value) XXX_Size() int { - return xxx_messageInfo_Value.Size(m) -} -func (m *Value) XXX_DiscardUnknown() { - xxx_messageInfo_Value.DiscardUnknown(m) -} - -var xxx_messageInfo_Value proto.InternalMessageInfo - -type isValue_Kind interface { - isValue_Kind() -} - -type Value_NullValue struct { - NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Value_NumberValue struct { - NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` -} - -type Value_StringValue struct { - StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Value_BoolValue struct { - BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Value_StructValue struct { - StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` -} - -type Value_ListValue struct { - ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` -} - -func (*Value_NullValue) isValue_Kind() {} - -func (*Value_NumberValue) isValue_Kind() {} - -func (*Value_StringValue) isValue_Kind() {} - -func (*Value_BoolValue) isValue_Kind() {} - -func (*Value_StructValue) isValue_Kind() {} - -func (*Value_ListValue) isValue_Kind() {} - -func (m *Value) GetKind() isValue_Kind { - if m != nil { - return m.Kind - } - return nil -} - -func (m *Value) GetNullValue() NullValue { - if x, ok := m.GetKind().(*Value_NullValue); ok { - return x.NullValue - } - return NullValue_NULL_VALUE -} - -func (m *Value) GetNumberValue() float64 { - if x, ok := m.GetKind().(*Value_NumberValue); ok { - return x.NumberValue - } - return 0 -} - -func (m *Value) GetStringValue() string { - if x, ok := m.GetKind().(*Value_StringValue); ok { - return x.StringValue - } - return "" -} - -func (m *Value) GetBoolValue() bool { - if x, ok := m.GetKind().(*Value_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (m *Value) GetStructValue() *Struct { - if x, ok := m.GetKind().(*Value_StructValue); ok { - return x.StructValue - } - return nil -} - -func (m *Value) GetListValue() *ListValue { - if x, ok := m.GetKind().(*Value_ListValue); ok { - return x.ListValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Value) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Value_NullValue)(nil), - (*Value_NumberValue)(nil), - (*Value_StringValue)(nil), - (*Value_BoolValue)(nil), - (*Value_StructValue)(nil), - (*Value_ListValue)(nil), - } -} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -type ListValue struct { - // Repeated field of dynamically typed values. - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListValue) Reset() { *m = ListValue{} } -func (m *ListValue) String() string { return proto.CompactTextString(m) } -func (*ListValue) ProtoMessage() {} -func (*ListValue) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{2} -} - -func (*ListValue) XXX_WellKnownType() string { return "ListValue" } - -func (m *ListValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListValue.Unmarshal(m, b) -} -func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListValue.Marshal(b, m, deterministic) -} -func (m *ListValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListValue.Merge(m, src) -} -func (m *ListValue) XXX_Size() int { - return xxx_messageInfo_ListValue.Size(m) -} -func (m *ListValue) XXX_DiscardUnknown() { - xxx_messageInfo_ListValue.DiscardUnknown(m) -} - -var xxx_messageInfo_ListValue proto.InternalMessageInfo - -func (m *ListValue) GetValues() []*Value { - if m != nil { - return m.Values - } - return nil -} - -func init() { - proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value) - proto.RegisterType((*Struct)(nil), "google.protobuf.Struct") - proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry") - proto.RegisterType((*Value)(nil), "google.protobuf.Value") - proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue") -} - -func init() { - proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_df322afd6c9fb402) -} - -var fileDescriptor_df322afd6c9fb402 = []byte{ - // 417 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0xc7, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa2, 0xa1, 0x7b, 0x09, - 0x22, 0x29, 0xd6, 0x8b, 0x18, 0x2f, 0x06, 0xd6, 0x5d, 0x30, 0x2c, 0x31, 0xba, 0x15, 0xbc, 0x94, - 0x26, 0x4d, 0x63, 0xe8, 0x74, 0x26, 0x24, 0x33, 0x4a, 0x8f, 0x7e, 0x0b, 0xcf, 0x1e, 0x3d, 0xfa, - 0xe9, 0x3c, 0xca, 0xcc, 0x24, 0xa9, 0xb4, 0xf4, 0x94, 0xbc, 0xf7, 0x7e, 0xef, 0x3f, 0xef, 0xff, - 0x66, 0xe0, 0x71, 0xc1, 0x58, 0x41, 0xf2, 0x49, 0x55, 0x33, 0xce, 0x52, 0xb1, 0x9a, 0x34, 0xbc, - 0x16, 0x19, 0xf7, 0x55, 0x8c, 0xef, 0xe9, 0xaa, 0xdf, 0x55, 0xc7, 0x3f, 0x11, 0x58, 0x1f, 0x15, - 0x81, 0x03, 0xb0, 0x56, 0x65, 0x4e, 0x96, 0xcd, 0x08, 0xb9, 0xa6, 0xe7, 0x4c, 0x2f, 0xfc, 0x3d, - 0xd8, 0xd7, 0xa0, 0xff, 0x4e, 0x51, 0x97, 0x94, 0xd7, 0xdb, 0xa4, 0x6d, 0x39, 0xff, 0x00, 0xce, - 0x7f, 0x69, 0x7c, 0x06, 0xe6, 0x3a, 0xdf, 0x8e, 0x90, 0x8b, 0x3c, 0x3b, 0x91, 0xbf, 0xf8, 0x39, - 0x0c, 0xbf, 0x2d, 0x88, 0xc8, 0x47, 0x86, 0x8b, 0x3c, 0x67, 0xfa, 0xe0, 0x40, 0x7c, 0x26, 0xab, - 0x89, 0x86, 0x5e, 0x1b, 0xaf, 0xd0, 0xf8, 0x8f, 0x01, 0x43, 0x95, 0xc4, 0x01, 0x00, 0x15, 0x84, - 0xcc, 0xb5, 0x80, 0x14, 0x3d, 0x9d, 0x9e, 0x1f, 0x08, 0xdc, 0x08, 0x42, 0x14, 0x7f, 0x3d, 0x48, - 0x6c, 0xda, 0x05, 0xf8, 0x02, 0xee, 0x52, 0xb1, 0x49, 0xf3, 0x7a, 0xbe, 0x3b, 0x1f, 0x5d, 0x0f, - 0x12, 0x47, 0x67, 0x7b, 0xa8, 0xe1, 0x75, 0x49, 0x8b, 0x16, 0x32, 0xe5, 0xe0, 0x12, 0xd2, 0x59, - 0x0d, 0x3d, 0x05, 0x48, 0x19, 0xeb, 0xc6, 0x38, 0x71, 0x91, 0x77, 0x47, 0x1e, 0x25, 0x73, 0x1a, - 0x78, 0xa3, 0x54, 0x44, 0xc6, 0x5b, 0x64, 0xa8, 0xac, 0x3e, 0x3c, 0xb2, 0xc7, 0x56, 0x5e, 0x64, - 0xbc, 0x77, 0x49, 0xca, 0xa6, 0xeb, 0xb5, 0x54, 0xef, 0xa1, 0xcb, 0xa8, 0x6c, 0x78, 0xef, 0x92, - 0x74, 0x41, 0x68, 0xc1, 0xc9, 0xba, 0xa4, 0xcb, 0x71, 0x00, 0x76, 0x4f, 0x60, 0x1f, 0x2c, 0x25, - 0xd6, 0xdd, 0xe8, 0xb1, 0xa5, 0xb7, 0xd4, 0xb3, 0x47, 0x60, 0xf7, 0x4b, 0xc4, 0xa7, 0x00, 0x37, - 0xb7, 0x51, 0x34, 0x9f, 0xbd, 0x8d, 0x6e, 0x2f, 0xcf, 0x06, 0xe1, 0x0f, 0x04, 0xf7, 0x33, 0xb6, - 0xd9, 0x97, 0x08, 0x1d, 0xed, 0x26, 0x96, 0x71, 0x8c, 0xbe, 0xbc, 0x28, 0x4a, 0xfe, 0x55, 0xa4, - 0x7e, 0xc6, 0x36, 0x93, 0x82, 0x91, 0x05, 0x2d, 0x76, 0x4f, 0xb1, 0xe2, 0xdb, 0x2a, 0x6f, 0xda, - 0x17, 0x19, 0xe8, 0x4f, 0x95, 0xfe, 0x45, 0xe8, 0x97, 0x61, 0x5e, 0xc5, 0xe1, 0x6f, 0xe3, 0xc9, - 0x95, 0x16, 0x8f, 0xbb, 0xf9, 0x3e, 0xe7, 0x84, 0xbc, 0xa7, 0xec, 0x3b, 0xfd, 0x24, 0x3b, 0x53, - 0x4b, 0x49, 0xbd, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x1b, 0x59, 0xf8, 0xe5, 0x02, 0x00, - 0x00, -} diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto b/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto deleted file mode 100644 index ed990e31d9..0000000000 --- a/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// 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 -// OWNER 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. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "StructProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -message Struct { - // Unordered map of dynamically typed values. - map fields = 1; -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of that -// variants, absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -message Value { - // The kind of value. - oneof kind { - // Represents a null value. - NullValue null_value = 1; - // Represents a double value. - double number_value = 2; - // Represents a string value. - string string_value = 3; - // Represents a boolean value. - bool bool_value = 4; - // Represents a structured value. - Struct struct_value = 5; - // Represents a repeated `Value`. - ListValue list_value = 6; - } -} - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -enum NullValue { - // Null value. - NULL_VALUE = 0; -} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -message ListValue { - // Repeated field of dynamically typed values. - repeated Value values = 1; -} diff --git a/vendor/github.com/moby/buildkit/README.md b/vendor/github.com/moby/buildkit/README.md index 2ea64c78ba..635366f2fe 100644 --- a/vendor/github.com/moby/buildkit/README.md +++ b/vendor/github.com/moby/buildkit/README.md @@ -60,6 +60,7 @@ You don't need to read this document unless you want to use the full-featured st - [`--export-cache` options](#--export-cache-options) - [`--import-cache` options](#--import-cache-options) - [Consistent hashing](#consistent-hashing) +- [Systemd socket activation](#systemd-socket-activation) - [Expose BuildKit as a TCP service](#expose-buildkit-as-a-tcp-service) - [Load balancing](#load-balancing) - [Containerizing BuildKit](#containerizing-buildkit) @@ -85,6 +86,7 @@ BuildKit is used by the following projects: - [the Sanic build tool](https://github.com/distributed-containers-inc/sanic) - [vab](https://github.com/stellarproject/vab) - [Rio](https://github.com/rancher/rio) +- [kim](https://github.com/rancher/kim) - [PouchContainer](https://github.com/alibaba/pouch) - [Docker buildx](https://github.com/docker/buildx) - [Okteto Cloud](https://okteto.com/) @@ -126,6 +128,9 @@ By default, the OCI (runc) worker is used. You can set `--oci-worker=false --con We are open to adding more backends. +To start the buildkitd daemon using systemd socket activiation, you can install the buildkit systemd unit files. +See [Systemd socket activation](#systemd-socket-activation) + 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). @@ -370,6 +375,24 @@ consider client-side load balancing using consistent hashing. See [`./examples/kubernetes/consistenthash`](./examples/kubernetes/consistenthash). +## Metadata + +To output build metadata such as the image digest, pass the `--metadata-file` flag. +The metadata will be written as a JSON object to the specified file. +The directory of the specified file must already exist and be writable. + +``` +buildctl build ... --metadata-file metadata.json +``` + +``` +{"containerimage.digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14",...} +``` + +## Systemd socket activation + +On Systemd based systems, you can communicate with the daemon via [Systemd socket activation](http://0pointer.de/blog/projects/socket-activation.html), use `buildkitd --addr fd://`. +You can find examples of using Systemd socket activation with BuildKit and Systemd in [`./examples/systemd`](./examples/systemd). ## Expose BuildKit as a TCP service The `buildkitd` daemon can listen the gRPC API on a TCP socket. 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 fdc10596f7..d020e8df77 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 @@ -3233,10 +3233,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -3319,10 +3316,7 @@ func (m *DiskUsageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -3407,10 +3401,7 @@ func (m *DiskUsageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -3756,10 +3747,7 @@ func (m *UsageRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -4020,7 +4008,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -4211,7 +4199,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -4405,7 +4393,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -4422,10 +4410,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -4650,7 +4635,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -4735,10 +4720,7 @@ func (m *CacheOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -4931,7 +4913,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -4948,10 +4930,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -5112,7 +5091,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -5129,10 +5108,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -5215,10 +5191,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -5371,10 +5344,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -5645,10 +5615,7 @@ func (m *Vertex) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -5938,10 +5905,7 @@ func (m *VertexStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -6110,10 +6074,7 @@ func (m *VertexLog) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -6198,10 +6159,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -6284,10 +6242,7 @@ func (m *ListWorkersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -6372,10 +6327,7 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { 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 fe10b6ac0d..84a4680c4b 100644 --- a/vendor/github.com/moby/buildkit/api/services/control/control.proto +++ b/vendor/github.com/moby/buildkit/api/services/control/control.proto @@ -2,9 +2,6 @@ syntax = "proto3"; package moby.buildkit.v1; -// The control API is currently considered experimental and may break in a backwards -// incompatible way. - import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "github.com/moby/buildkit/solver/pb/ops.proto"; 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 728cccf759..54cbd605e1 100644 --- a/vendor/github.com/moby/buildkit/api/types/worker.pb.go +++ b/vendor/github.com/moby/buildkit/api/types/worker.pb.go @@ -595,7 +595,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWorker } if (iNdEx + skippy) > postIndex { @@ -680,10 +680,7 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWorker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWorker } if (iNdEx + skippy) > l { @@ -824,10 +821,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWorker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWorker } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/client/llb/exec.go b/vendor/github.com/moby/buildkit/client/llb/exec.go index decc0d7407..54182e3ff8 100644 --- a/vendor/github.com/moby/buildkit/client/llb/exec.go +++ b/vendor/github.com/moby/buildkit/client/llb/exec.go @@ -233,6 +233,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, [] HttpsProxy: p.HTTPSProxy, FtpProxy: p.FTPProxy, NoProxy: p.NoProxy, + AllProxy: p.AllProxy, } addCap(&e.constraints, pb.CapExecMetaProxy) } @@ -645,6 +646,7 @@ type ProxyEnv struct { HTTPSProxy string FTPProxy string NoProxy string + AllProxy string } type CacheMountSharingMode int diff --git a/vendor/github.com/moby/buildkit/client/llb/fileop.go b/vendor/github.com/moby/buildkit/client/llb/fileop.go index a2342db693..1f43974cb0 100644 --- a/vendor/github.com/moby/buildkit/client/llb/fileop.go +++ b/vendor/github.com/moby/buildkit/client/llb/fileop.go @@ -56,6 +56,10 @@ type subAction interface { toProtoAction(context.Context, string, pb.InputIndex) (pb.IsFileAction, error) } +type capAdder interface { + addCaps(*FileOp) +} + type FileAction struct { state *State prev *FileAction @@ -427,6 +431,8 @@ type CopyInfo struct { Mode *os.FileMode FollowSymlinks bool CopyDirContentsOnly bool + IncludePatterns []string + ExcludePatterns []string AttemptUnpack bool CreateDestPath bool AllowWildcard bool @@ -458,6 +464,8 @@ func (a *fileActionCopy) toProtoAction(ctx context.Context, parent string, base Src: src, Dest: normalizePath(parent, a.dest, true), Owner: a.info.ChownOpt.marshal(base), + IncludePatterns: a.info.IncludePatterns, + ExcludePatterns: a.info.ExcludePatterns, AllowWildcard: a.info.AllowWildcard, AllowEmptyWildcard: a.info.AllowEmptyWildcard, FollowSymlink: a.info.FollowSymlinks, @@ -496,6 +504,12 @@ func (a *fileActionCopy) sourcePath(ctx context.Context) (string, error) { return p, nil } +func (a *fileActionCopy) addCaps(f *FileOp) { + if len(a.info.IncludePatterns) != 0 || len(a.info.ExcludePatterns) != 0 { + addCap(&f.constraints, pb.CapFileCopyIncludeExcludePatterns) + } +} + type CreatedTime time.Time func WithCreatedTime(t time.Time) CreatedTime { @@ -682,6 +696,10 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, [] pop.Inputs = state.inputs for i, st := range state.actions { + if adder, isCapAdder := st.action.(capAdder); isCapAdder { + adder.addCaps(f) + } + output := pb.OutputIndex(-1) if i+1 == len(state.actions) { output = 0 diff --git a/vendor/github.com/moby/buildkit/client/llb/source.go b/vendor/github.com/moby/buildkit/client/llb/source.go index ddd6097ad4..7d389e8bda 100644 --- a/vendor/github.com/moby/buildkit/client/llb/source.go +++ b/vendor/github.com/moby/buildkit/client/llb/source.go @@ -11,6 +11,7 @@ import ( "github.com/docker/distribution/reference" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/apicaps" + "github.com/moby/buildkit/util/gitutil" "github.com/moby/buildkit/util/sshutil" digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" @@ -198,52 +199,14 @@ type ImageInfo struct { RecordType string } -const ( - gitProtocolHTTP = iota + 1 - gitProtocolHTTPS - gitProtocolSSH - gitProtocolGit - gitProtocolUnknown -) - -func getGitProtocol(remote string) (string, int) { - prefixes := map[string]int{ - "http://": gitProtocolHTTP, - "https://": gitProtocolHTTPS, - "git://": gitProtocolGit, - "ssh://": gitProtocolSSH, - } - protocolType := gitProtocolUnknown - for prefix, potentialType := range prefixes { - if strings.HasPrefix(remote, prefix) { - remote = strings.TrimPrefix(remote, prefix) - protocolType = potentialType - } - } - - if protocolType == gitProtocolUnknown && sshutil.IsSSHTransport(remote) { - protocolType = gitProtocolSSH - } - - // remove name from ssh - if protocolType == gitProtocolSSH { - parts := strings.SplitN(remote, "@", 2) - if len(parts) == 2 { - remote = parts[1] - } - } - - return remote, protocolType -} - func Git(remote, ref string, opts ...GitOption) State { url := strings.Split(remote, "#")[0] var protocolType int - remote, protocolType = getGitProtocol(remote) + remote, protocolType = gitutil.ParseProtocol(remote) var sshHost string - if protocolType == gitProtocolSSH { + if protocolType == gitutil.SSHProtocol { parts := strings.SplitN(remote, ":", 2) if len(parts) == 2 { sshHost = parts[0] @@ -251,7 +214,7 @@ func Git(remote, ref string, opts ...GitOption) State { remote = parts[0] + "/" + parts[1] } } - if protocolType == gitProtocolUnknown { + if protocolType == gitutil.UnknownProtocol { url = "https://" + url } @@ -289,7 +252,7 @@ func Git(remote, ref string, opts ...GitOption) State { addCap(&gi.Constraints, pb.CapSourceGitHTTPAuth) } } - if protocolType == gitProtocolSSH { + if protocolType == gitutil.SSHProtocol { if gi.KnownSSHHosts != "" { attrs[pb.AttrKnownSSHHosts] = gi.KnownSSHHosts } else if sshHost != "" { diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/exit.go b/vendor/github.com/moby/buildkit/frontend/gateway/errdefs/exit.go similarity index 79% rename from vendor/github.com/moby/buildkit/solver/errdefs/exit.go rename to vendor/github.com/moby/buildkit/frontend/gateway/errdefs/exit.go index 696fe25563..f98a148de4 100644 --- a/vendor/github.com/moby/buildkit/solver/errdefs/exit.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/errdefs/exit.go @@ -3,13 +3,13 @@ package errdefs import "fmt" const ( - // ContainerdUnknownExitStatus is returned when containerd is unable to - // determine the exit status of a process. This can happen if the process never starts + // UnknownExitStatus might be returned in (*ExitError).ExitCode via + // ContainerProcess.Wait. This can happen if the process never starts // or if an error was encountered when obtaining the exit status, it is set to 255. // // This const is defined here to prevent importing github.com/containerd/containerd // and corresponds with https://github.com/containerd/containerd/blob/40b22ef0741028917761d8c5d5d29e0d19038836/task.go#L52-L55 - ContainerdUnknownExitStatus = 255 + UnknownExitStatus = 255 ) // ExitError will be returned when the container process exits with a non-zero 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 84a2767306..e8a370b7a4 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go @@ -16,9 +16,9 @@ import ( "github.com/golang/protobuf/ptypes/any" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/frontend/gateway/client" + "github.com/moby/buildkit/frontend/gateway/errdefs" pb "github.com/moby/buildkit/frontend/gateway/pb" "github.com/moby/buildkit/identity" - "github.com/moby/buildkit/solver/errdefs" opspb "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/apicaps" "github.com/moby/buildkit/util/grpcerrors" @@ -882,7 +882,7 @@ func (ctr *container) Start(ctx context.Context, req client.StartRequest) (clien Message: exit.Error.Message, Details: convertGogoAny(exit.Error.Details), })) - if exit.Code != errdefs.ContainerdUnknownExitStatus { + if exit.Code != errdefs.UnknownExitStatus { exitError = &errdefs.ExitError{ExitCode: exit.Code, Err: exitError} } } else if serverDone := msg.GetDone(); serverDone != nil { 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 a700d48ec6..06fcb98ea4 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 @@ -5577,7 +5577,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -5594,10 +5594,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -5758,7 +5755,7 @@ func (m *RefMapDeprecated) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -5775,10 +5772,7 @@ func (m *RefMapDeprecated) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -5897,10 +5891,7 @@ func (m *Ref) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6063,7 +6054,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -6080,10 +6071,7 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6206,10 +6194,7 @@ func (m *ReturnRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6260,10 +6245,7 @@ func (m *ReturnResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6314,10 +6296,7 @@ func (m *InputsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6480,7 +6459,7 @@ func (m *InputsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -6497,10 +6476,7 @@ func (m *InputsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6683,10 +6659,7 @@ func (m *ResolveImageConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -6803,10 +6776,7 @@ func (m *ResolveImageConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -7035,7 +7005,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -7324,7 +7294,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -7361,10 +7331,7 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -7557,7 +7524,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > postIndex { @@ -7574,10 +7541,7 @@ func (m *CacheOptionsEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -7696,10 +7660,7 @@ func (m *SolveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -7850,10 +7811,7 @@ func (m *ReadFileRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -7942,10 +7900,7 @@ func (m *FileRange) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8030,10 +7985,7 @@ func (m *ReadFileResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8180,10 +8132,7 @@ func (m *ReadDirRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8268,10 +8217,7 @@ func (m *ReadDirResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8386,10 +8332,7 @@ func (m *StatFileRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8476,10 +8419,7 @@ func (m *StatFileResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8530,10 +8470,7 @@ func (m *PingRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8686,10 +8623,7 @@ func (m *PongResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8897,10 +8831,7 @@ func (m *NewContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -8951,10 +8882,7 @@ func (m *NewContainerResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9037,10 +8965,7 @@ func (m *ReleaseContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9091,10 +9016,7 @@ func (m *ReleaseContainerResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9387,10 +9309,7 @@ func (m *ExecMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9624,10 +9543,7 @@ func (m *InitMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9733,10 +9649,7 @@ func (m *ExitMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9787,10 +9700,7 @@ func (m *StartedMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9841,10 +9751,7 @@ func (m *DoneMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -9968,10 +9875,7 @@ func (m *FdMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { @@ -10060,10 +9964,7 @@ func (m *ResizeMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGateway - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGateway } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/go.mod b/vendor/github.com/moby/buildkit/go.mod index 07d7129245..c00473bf13 100644 --- a/vendor/github.com/moby/buildkit/go.mod +++ b/vendor/github.com/moby/buildkit/go.mod @@ -3,30 +3,30 @@ module github.com/moby/buildkit go 1.13 require ( - github.com/AkihiroSuda/containerd-fuse-overlayfs v1.0.0 github.com/BurntSushi/toml v0.3.1 - github.com/Microsoft/go-winio v0.4.15 - github.com/Microsoft/hcsshim v0.8.10 + github.com/Microsoft/go-winio v0.4.17 + github.com/Microsoft/hcsshim v0.8.16 github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58 // indirect - github.com/containerd/console v1.0.1 - github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc - github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe - github.com/containerd/go-cni v1.0.1 - github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0 - github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116 - github.com/containerd/typeurl v1.0.1 - github.com/coreos/go-systemd/v22 v22.1.0 - github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible + github.com/containerd/console v1.0.2 + github.com/containerd/containerd v1.5.2 + github.com/containerd/continuity v0.1.0 + github.com/containerd/fuse-overlayfs-snapshotter v1.0.2 + github.com/containerd/go-cni v1.0.2 + github.com/containerd/go-runc v1.0.0 + github.com/containerd/stargz-snapshotter v0.6.4 + github.com/containerd/typeurl v1.0.2 + github.com/coreos/go-systemd/v22 v22.3.2 + github.com/docker/cli v20.10.7+incompatible github.com/docker/distribution v2.7.1+incompatible - github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible + // docker: the actual version is replaced in replace() + github.com/docker/docker v20.10.7+incompatible // master (v21.xx-dev) github.com/docker/go-connections v0.4.0 - github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f github.com/gofrs/flock v0.7.3 - github.com/gogo/googleapis v1.3.2 - github.com/gogo/protobuf v1.3.1 + github.com/gogo/googleapis v1.4.0 + github.com/gogo/protobuf v1.3.2 // protobuf: the actual version is replaced in replace() - github.com/golang/protobuf v1.4.2 - github.com/google/go-cmp v0.4.1 + github.com/golang/protobuf v1.4.3 + github.com/google/go-cmp v0.5.4 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/gorilla/mux v1.8.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 @@ -34,46 +34,50 @@ require ( github.com/hashicorp/go-immutable-radix v1.0.0 github.com/hashicorp/golang-lru v0.5.3 github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c // indirect - github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07 // indirect + github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee // indirect github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea github.com/mitchellh/hashstructure v1.0.0 github.com/moby/locker v1.0.1 - github.com/moby/sys/mount v0.1.1 // indirect; force more current version of sys/mount than go mod selects automatically - github.com/moby/sys/mountinfo v0.4.0 // indirect; force more current version of sys/mountinfo than go mod selects automatically - github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2 // indirect + github.com/moby/sys/mount v0.2.0 // indirect + github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf // indirect github.com/morikuni/aec v1.0.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 - github.com/opencontainers/runc v1.0.0-rc92 - github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6 + github.com/opencontainers/runc v1.0.0-rc93 + github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d + github.com/opencontainers/selinux v1.8.0 github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 github.com/pkg/profile v1.5.0 github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 - github.com/sirupsen/logrus v1.7.0 - github.com/stretchr/testify v1.5.1 - github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 + github.com/sirupsen/logrus v1.8.1 + github.com/stretchr/testify v1.7.0 + github.com/tonistiigi/fsutil v0.0.0-20210609172227-d72af97c0eaf github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/uber/jaeger-lib v2.2.0+incompatible // indirect github.com/urfave/cli v1.22.2 go.etcd.io/bbolt v1.3.5 - golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 - golang.org/x/net v0.0.0-20200707034311-ab3426394381 - golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a - golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 + golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // genproto: the actual version is replaced in replace() - google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece - google.golang.org/grpc v1.29.1 + google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a + // grpc: the actual version is replaced in replace() + google.golang.org/grpc v1.35.0 ) replace ( + github.com/docker/docker => github.com/docker/docker v20.10.3-0.20210609100121-ef4d47340142+incompatible // protobuf: corresponds to containerd github.com/golang/protobuf => github.com/golang/protobuf v1.3.5 github.com/hashicorp/go-immutable-radix => github.com/tonistiigi/go-immutable-radix v0.0.0-20170803185627-826af9ccf0fe github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305 // genproto: corresponds to containerd google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 + // grpc: corresponds to protobuf + google.golang.org/grpc => google.golang.org/grpc v1.30.0 ) diff --git a/vendor/github.com/moby/buildkit/session/auth/auth.go b/vendor/github.com/moby/buildkit/session/auth/auth.go index 864ed5dd7f..85e6f68053 100644 --- a/vendor/github.com/moby/buildkit/session/auth/auth.go +++ b/vendor/github.com/moby/buildkit/session/auth/auth.go @@ -52,8 +52,8 @@ func CredentialsFunc(sm *session.Manager, g session.Group) func(string) (session } } -func FetchToken(req *FetchTokenRequest, sm *session.Manager, g session.Group) (resp *FetchTokenResponse, err error) { - err = sm.Any(context.TODO(), g, func(ctx context.Context, id string, c session.Caller) error { +func FetchToken(ctx context.Context, req *FetchTokenRequest, sm *session.Manager, g session.Group) (resp *FetchTokenResponse, err error) { + err = sm.Any(ctx, g, func(ctx context.Context, id string, c session.Caller) error { client := NewAuthClient(c.Conn()) resp, err = client.FetchToken(ctx, req) @@ -68,9 +68,9 @@ func FetchToken(req *FetchTokenRequest, sm *session.Manager, g session.Group) (r return resp, nil } -func VerifyTokenAuthority(host string, pubKey *[32]byte, sm *session.Manager, g session.Group) (sessionID string, ok bool, err error) { +func VerifyTokenAuthority(ctx context.Context, host string, pubKey *[32]byte, sm *session.Manager, g session.Group) (sessionID string, ok bool, err error) { var verified bool - err = sm.Any(context.TODO(), g, func(ctx context.Context, id string, c session.Caller) error { + err = sm.Any(ctx, g, func(ctx context.Context, id string, c session.Caller) error { client := NewAuthClient(c.Conn()) payload := make([]byte, 32) @@ -100,8 +100,8 @@ func VerifyTokenAuthority(host string, pubKey *[32]byte, sm *session.Manager, g return sessionID, verified, nil } -func GetTokenAuthority(host string, sm *session.Manager, g session.Group) (sessionID string, pubKey *[32]byte, err error) { - err = sm.Any(context.TODO(), g, func(ctx context.Context, id string, c session.Caller) error { +func GetTokenAuthority(ctx context.Context, host string, sm *session.Manager, g session.Group) (sessionID string, pubKey *[32]byte, err error) { + err = sm.Any(ctx, g, func(ctx context.Context, id string, c session.Caller) error { client := NewAuthClient(c.Conn()) resp, err := client.GetTokenAuthority(ctx, &GetTokenAuthorityRequest{ 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 ffe60e93df..e23a07fc8a 100644 --- a/vendor/github.com/moby/buildkit/session/auth/auth.pb.go +++ b/vendor/github.com/moby/buildkit/session/auth/auth.pb.go @@ -1651,10 +1651,7 @@ func (m *CredentialsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -1768,10 +1765,7 @@ func (m *CredentialsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -1981,10 +1975,7 @@ func (m *FetchTokenRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -2104,10 +2095,7 @@ func (m *FetchTokenResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -2223,10 +2211,7 @@ func (m *GetTokenAuthorityRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -2310,10 +2295,7 @@ func (m *GetTokenAuthorityResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -2463,10 +2445,7 @@ func (m *VerifyTokenAuthorityRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -2550,10 +2529,7 @@ func (m *VerifyTokenAuthorityResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/session/auth/authprovider/tokenseed.go b/vendor/github.com/moby/buildkit/session/auth/authprovider/tokenseed.go index c3dd125eed..3186fbf1f0 100644 --- a/vendor/github.com/moby/buildkit/session/auth/authprovider/tokenseed.go +++ b/vendor/github.com/moby/buildkit/session/auth/authprovider/tokenseed.go @@ -53,9 +53,8 @@ func (ts *tokenSeeds) getSeed(host string) ([]byte, error) { return nil, err } } else { - if err := json.Unmarshal(dt, &ts.m); err != nil { - return nil, errors.Wrapf(err, "failed to parse %s", fp) - } + // ignore error in case of crash during previous marshal + _ = json.Unmarshal(dt, &ts.m) } v, ok := ts.m[host] if !ok { diff --git a/vendor/github.com/moby/buildkit/session/filesync/diffcopy.go b/vendor/github.com/moby/buildkit/session/filesync/diffcopy.go index c3104dbfa0..a03326f6d5 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/diffcopy.go +++ b/vendor/github.com/moby/buildkit/session/filesync/diffcopy.go @@ -70,7 +70,7 @@ func (wc *streamWriterCloser) Close() error { return nil } -func recvDiffCopy(ds grpc.ClientStream, dest string, cu CacheUpdater, progress progressCb, filter func(string, *fstypes.Stat) bool) error { +func recvDiffCopy(ds grpc.ClientStream, dest string, cu CacheUpdater, progress progressCb, filter func(string, *fstypes.Stat) bool) (err error) { st := time.Now() defer func() { logrus.Debugf("diffcopy took: %v", time.Since(st)) @@ -82,6 +82,12 @@ func recvDiffCopy(ds grpc.ClientStream, dest string, cu CacheUpdater, progress p cf = cu.HandleChange ch = cu.ContentHasher() } + defer func() { + // tracing wrapper requires close trigger even on clean eof + if err == nil { + ds.CloseSend() + } + }() return errors.WithStack(fsutil.Receive(ds.Context(), ds, dest, fsutil.ReceiveOpt{ NotifyHashed: cf, ContentHasher: ch, 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 993834a6e6..6110307abb 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go +++ b/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go @@ -8,6 +8,7 @@ import ( context "context" fmt "fmt" proto "github.com/gogo/protobuf/proto" + types "github.com/tonistiigi/fsutil/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -80,21 +81,25 @@ func init() { func init() { proto.RegisterFile("filesync.proto", fileDescriptor_d1042549f1f24495) } var fileDescriptor_d1042549f1f24495 = []byte{ - // 217 bytes of a gzipped FileDescriptorProto + // 281 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, + 0xd4, 0x83, 0x0b, 0x96, 0x19, 0x4a, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0x97, 0xe4, 0xe7, 0x65, 0x16, 0x97, 0x64, 0x66, 0xa6, 0x67, 0xea, 0xa7, 0x15, 0x97, + 0x96, 0x64, 0xe6, 0xe8, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x97, 0x67, 0x16, 0xa5, 0x42, 0x0c, + 0x50, 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, 0x8d, 0x9a, 0x19, 0xb9, 0x38, 0xdc, 0x32, 0x73, 0x52, 0x83, 0x2b, 0xf3, 0x92, 0x85, 0xac, + 0xb8, 0x38, 0x5c, 0x32, 0xd3, 0xd2, 0x9c, 0xf3, 0x0b, 0x2a, 0x85, 0x44, 0xf4, 0x20, 0xc6, 0xea, + 0x81, 0x8d, 0xd5, 0x0b, 0x48, 0x4c, 0xce, 0x4e, 0x2d, 0x91, 0xc2, 0x2a, 0xaa, 0xc1, 0x68, 0xc0, + 0x28, 0x64, 0xcd, 0xc5, 0x19, 0x92, 0x58, 0x14, 0x5c, 0x52, 0x94, 0x9a, 0x98, 0x4b, 0xaa, 0x66, + 0xa3, 0x28, 0xa8, 0x23, 0x52, 0xf3, 0x52, 0x84, 0xfc, 0x90, 0x1c, 0x21, 0xa7, 0x87, 0x1e, 0x06, + 0x7a, 0xc8, 0x3e, 0x92, 0x22, 0x20, 0x0f, 0x32, 0xdb, 0xc9, 0xee, 0xc2, 0x43, 0x39, 0x86, 0x1b, + 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, + 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, + 0xc3, 0x87, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, + 0x1c, 0x43, 0x14, 0x07, 0xcc, 0xcc, 0x24, 0x36, 0x70, 0x60, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xe6, 0x17, 0x63, 0x59, 0x9f, 0x01, 0x00, 0x00, } func (this *BytesMessage) Equal(that interface{}) bool { @@ -174,8 +179,8 @@ func (c *fileSyncClient) DiffCopy(ctx context.Context, opts ...grpc.CallOption) } type FileSync_DiffCopyClient interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ClientStream } @@ -183,12 +188,12 @@ type fileSyncDiffCopyClient struct { grpc.ClientStream } -func (x *fileSyncDiffCopyClient) Send(m *BytesMessage) error { +func (x *fileSyncDiffCopyClient) Send(m *types.Packet) error { return x.ClientStream.SendMsg(m) } -func (x *fileSyncDiffCopyClient) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncDiffCopyClient) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -205,8 +210,8 @@ func (c *fileSyncClient) TarStream(ctx context.Context, opts ...grpc.CallOption) } type FileSync_TarStreamClient interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ClientStream } @@ -214,12 +219,12 @@ type fileSyncTarStreamClient struct { grpc.ClientStream } -func (x *fileSyncTarStreamClient) Send(m *BytesMessage) error { +func (x *fileSyncTarStreamClient) Send(m *types.Packet) error { return x.ClientStream.SendMsg(m) } -func (x *fileSyncTarStreamClient) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncTarStreamClient) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -252,8 +257,8 @@ func _FileSync_DiffCopy_Handler(srv interface{}, stream grpc.ServerStream) error } type FileSync_DiffCopyServer interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ServerStream } @@ -261,12 +266,12 @@ type fileSyncDiffCopyServer struct { grpc.ServerStream } -func (x *fileSyncDiffCopyServer) Send(m *BytesMessage) error { +func (x *fileSyncDiffCopyServer) Send(m *types.Packet) error { return x.ServerStream.SendMsg(m) } -func (x *fileSyncDiffCopyServer) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncDiffCopyServer) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } @@ -278,8 +283,8 @@ func _FileSync_TarStream_Handler(srv interface{}, stream grpc.ServerStream) erro } type FileSync_TarStreamServer interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ServerStream } @@ -287,12 +292,12 @@ type fileSyncTarStreamServer struct { grpc.ServerStream } -func (x *fileSyncTarStreamServer) Send(m *BytesMessage) error { +func (x *fileSyncTarStreamServer) Send(m *types.Packet) error { return x.ServerStream.SendMsg(m) } -func (x *fileSyncTarStreamServer) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncTarStreamServer) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } @@ -571,10 +576,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthFilesync - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthFilesync } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/session/filesync/filesync.proto b/vendor/github.com/moby/buildkit/session/filesync/filesync.proto index 0ae2937368..9e39179285 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/filesync.proto +++ b/vendor/github.com/moby/buildkit/session/filesync/filesync.proto @@ -4,9 +4,11 @@ package moby.filesync.v1; option go_package = "filesync"; +import "github.com/tonistiigi/fsutil/types/wire.proto"; + service FileSync{ - rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage); - rpc TarStream(stream BytesMessage) returns (stream BytesMessage); + rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet); + rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet); } service FileSend{ @@ -17,4 +19,4 @@ service FileSend{ // BytesMessage contains a chunk of byte data message BytesMessage{ bytes data = 1; -} \ No newline at end of file +} diff --git a/vendor/github.com/moby/buildkit/session/filesync/generate.go b/vendor/github.com/moby/buildkit/session/filesync/generate.go index 261e876272..fbd72742b8 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/generate.go +++ b/vendor/github.com/moby/buildkit/session/filesync/generate.go @@ -1,3 +1,3 @@ package filesync -//go:generate protoc --gogoslick_out=plugins=grpc:. filesync.proto +//go:generate protoc -I=. -I=../../vendor/ -I=../../vendor/github.com/tonistiigi/fsutil/types/ --gogoslick_out=plugins=grpc:. filesync.proto 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 eb49bebee6..3fadef0f89 100644 --- a/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go +++ b/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go @@ -678,7 +678,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSecrets } if (iNdEx + skippy) > postIndex { @@ -695,10 +695,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSecrets - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSecrets } if (iNdEx + skippy) > l { @@ -782,10 +779,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSecrets - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSecrets } if (iNdEx + skippy) > l { 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 62adbe6dd8..d2bda697c8 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go @@ -676,10 +676,7 @@ func (m *BytesMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSsh - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSsh } if (iNdEx + skippy) > l { @@ -761,10 +758,7 @@ func (m *CheckAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSsh - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSsh } if (iNdEx + skippy) > l { @@ -814,10 +808,7 @@ func (m *CheckAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSsh - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSsh } if (iNdEx + skippy) > l { 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 f8ed2811da..981eb96f56 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go @@ -35,7 +35,11 @@ func NewSSHAgentProvider(confs []AgentConfig) (session.Attachable, error) { } if conf.Paths[0] == "" { - return nil, errors.Errorf("invalid empty ssh agent socket, make sure SSH_AUTH_SOCK is set") + p, err := getFallbackAgentPath() + if err != nil { + return nil, errors.Wrap(err, "invalid empty ssh agent socket") + } + conf.Paths[0] = p } src, err := toAgentSource(conf.Paths) @@ -56,7 +60,20 @@ func NewSSHAgentProvider(confs []AgentConfig) (session.Attachable, error) { type source struct { agent agent.Agent - socket string + socket *socketDialer +} + +type socketDialer struct { + path string + dialer func(string) (net.Conn, error) +} + +func (s socketDialer) Dial() (net.Conn, error) { + return s.dialer(s.path) +} + +func (s socketDialer) String() string { + return s.path } type socketProvider struct { @@ -94,8 +111,8 @@ func (sp *socketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) var a agent.Agent - if src.socket != "" { - conn, err := net.DialTimeout("unix", src.socket, time.Second) + if src.socket != nil { + conn, err := src.socket.Dial() if err != nil { return errors.Wrapf(err, "failed to connect to %s", src.socket) } @@ -124,21 +141,24 @@ func (sp *socketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) func toAgentSource(paths []string) (source, error) { var keys bool - var socket string + var socket *socketDialer a := agent.NewKeyring() for _, p := range paths { - if socket != "" { + if socket != nil { return source{}, errors.New("only single socket allowed") } + + if parsed := getWindowsPipeDialer(p); parsed != nil { + socket = parsed + continue + } + fi, err := os.Stat(p) if err != nil { return source{}, errors.WithStack(err) } if fi.Mode()&os.ModeSocket > 0 { - if keys { - return source{}, errors.Errorf("invalid combination of keys and sockets") - } - socket = p + socket = &socketDialer{path: p, dialer: unixSocketDialer} continue } @@ -160,7 +180,7 @@ func toAgentSource(paths []string) (source, error) { if keys { return source{}, errors.Errorf("invalid combination of keys and sockets") } - socket = p + socket = &socketDialer{path: p, dialer: unixSocketDialer} continue } @@ -173,13 +193,20 @@ func toAgentSource(paths []string) (source, error) { keys = true } - if socket != "" { + if socket != nil { + if keys { + return source{}, errors.Errorf("invalid combination of keys and sockets") + } return source{socket: socket}, nil } return source{agent: a}, nil } +func unixSocketDialer(path string) (net.Conn, error) { + return net.DialTimeout("unix", path, 2*time.Second) +} + func sockPair() (io.ReadWriteCloser, io.ReadWriteCloser) { pr1, pw1 := io.Pipe() pr2, pw2 := io.Pipe() diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/context.go b/vendor/github.com/moby/buildkit/solver/errdefs/context.go deleted file mode 100644 index ea6bdfbf09..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/context.go +++ /dev/null @@ -1,13 +0,0 @@ -package errdefs - -import ( - "context" - "errors" - - "github.com/moby/buildkit/util/grpcerrors" - "google.golang.org/grpc/codes" -) - -func IsCanceled(err error) bool { - return errors.Is(err, context.Canceled) || grpcerrors.Code(err) == codes.Canceled -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go b/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go deleted file mode 100644 index 5da34b6e59..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: errdefs.proto - -package errdefs - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - pb "github.com/moby/buildkit/solver/pb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Vertex struct { - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -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_689dc58a5060aff5, []int{0} -} -func (m *Vertex) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Vertex.Unmarshal(m, b) -} -func (m *Vertex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Vertex.Marshal(b, m, deterministic) -} -func (m *Vertex) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vertex.Merge(m, src) -} -func (m *Vertex) XXX_Size() int { - return xxx_messageInfo_Vertex.Size(m) -} -func (m *Vertex) XXX_DiscardUnknown() { - xxx_messageInfo_Vertex.DiscardUnknown(m) -} - -var xxx_messageInfo_Vertex proto.InternalMessageInfo - -func (m *Vertex) GetDigest() string { - if m != nil { - return m.Digest - } - return "" -} - -type Source struct { - Info *pb.SourceInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` - Ranges []*pb.Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Source) Reset() { *m = Source{} } -func (m *Source) String() string { return proto.CompactTextString(m) } -func (*Source) ProtoMessage() {} -func (*Source) Descriptor() ([]byte, []int) { - return fileDescriptor_689dc58a5060aff5, []int{1} -} -func (m *Source) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Source.Unmarshal(m, b) -} -func (m *Source) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Source.Marshal(b, m, deterministic) -} -func (m *Source) XXX_Merge(src proto.Message) { - xxx_messageInfo_Source.Merge(m, src) -} -func (m *Source) XXX_Size() int { - return xxx_messageInfo_Source.Size(m) -} -func (m *Source) XXX_DiscardUnknown() { - xxx_messageInfo_Source.DiscardUnknown(m) -} - -var xxx_messageInfo_Source proto.InternalMessageInfo - -func (m *Source) GetInfo() *pb.SourceInfo { - if m != nil { - return m.Info - } - return nil -} - -func (m *Source) GetRanges() []*pb.Range { - if m != nil { - return m.Ranges - } - return nil -} - -type FrontendCap struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FrontendCap) Reset() { *m = FrontendCap{} } -func (m *FrontendCap) String() string { return proto.CompactTextString(m) } -func (*FrontendCap) ProtoMessage() {} -func (*FrontendCap) Descriptor() ([]byte, []int) { - return fileDescriptor_689dc58a5060aff5, []int{2} -} -func (m *FrontendCap) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FrontendCap.Unmarshal(m, b) -} -func (m *FrontendCap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FrontendCap.Marshal(b, m, deterministic) -} -func (m *FrontendCap) XXX_Merge(src proto.Message) { - xxx_messageInfo_FrontendCap.Merge(m, src) -} -func (m *FrontendCap) XXX_Size() int { - return xxx_messageInfo_FrontendCap.Size(m) -} -func (m *FrontendCap) XXX_DiscardUnknown() { - xxx_messageInfo_FrontendCap.DiscardUnknown(m) -} - -var xxx_messageInfo_FrontendCap proto.InternalMessageInfo - -func (m *FrontendCap) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Subrequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Subrequest) Reset() { *m = Subrequest{} } -func (m *Subrequest) String() string { return proto.CompactTextString(m) } -func (*Subrequest) ProtoMessage() {} -func (*Subrequest) Descriptor() ([]byte, []int) { - return fileDescriptor_689dc58a5060aff5, []int{3} -} -func (m *Subrequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Subrequest.Unmarshal(m, b) -} -func (m *Subrequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Subrequest.Marshal(b, m, deterministic) -} -func (m *Subrequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subrequest.Merge(m, src) -} -func (m *Subrequest) XXX_Size() int { - return xxx_messageInfo_Subrequest.Size(m) -} -func (m *Subrequest) XXX_DiscardUnknown() { - xxx_messageInfo_Subrequest.DiscardUnknown(m) -} - -var xxx_messageInfo_Subrequest proto.InternalMessageInfo - -func (m *Subrequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Solve struct { - InputIDs []string `protobuf:"bytes,1,rep,name=inputIDs,proto3" json:"inputIDs,omitempty"` - MountIDs []string `protobuf:"bytes,2,rep,name=mountIDs,proto3" json:"mountIDs,omitempty"` - Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` - // Types that are valid to be assigned to Subject: - // *Solve_File - // *Solve_Cache - Subject isSolve_Subject `protobuf_oneof:"subject"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Solve) Reset() { *m = Solve{} } -func (m *Solve) String() string { return proto.CompactTextString(m) } -func (*Solve) ProtoMessage() {} -func (*Solve) Descriptor() ([]byte, []int) { - return fileDescriptor_689dc58a5060aff5, []int{4} -} -func (m *Solve) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Solve.Unmarshal(m, b) -} -func (m *Solve) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Solve.Marshal(b, m, deterministic) -} -func (m *Solve) XXX_Merge(src proto.Message) { - xxx_messageInfo_Solve.Merge(m, src) -} -func (m *Solve) XXX_Size() int { - return xxx_messageInfo_Solve.Size(m) -} -func (m *Solve) XXX_DiscardUnknown() { - xxx_messageInfo_Solve.DiscardUnknown(m) -} - -var xxx_messageInfo_Solve proto.InternalMessageInfo - -type isSolve_Subject interface { - isSolve_Subject() -} - -type Solve_File struct { - File *FileAction `protobuf:"bytes,4,opt,name=file,proto3,oneof" json:"file,omitempty"` -} -type Solve_Cache struct { - Cache *ContentCache `protobuf:"bytes,5,opt,name=cache,proto3,oneof" json:"cache,omitempty"` -} - -func (*Solve_File) isSolve_Subject() {} -func (*Solve_Cache) isSolve_Subject() {} - -func (m *Solve) GetSubject() isSolve_Subject { - if m != nil { - return m.Subject - } - return nil -} - -func (m *Solve) GetInputIDs() []string { - if m != nil { - return m.InputIDs - } - return nil -} - -func (m *Solve) GetMountIDs() []string { - if m != nil { - return m.MountIDs - } - return nil -} - -func (m *Solve) GetOp() *pb.Op { - if m != nil { - return m.Op - } - return nil -} - -func (m *Solve) GetFile() *FileAction { - if x, ok := m.GetSubject().(*Solve_File); ok { - return x.File - } - return nil -} - -func (m *Solve) GetCache() *ContentCache { - if x, ok := m.GetSubject().(*Solve_Cache); ok { - return x.Cache - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Solve) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Solve_File)(nil), - (*Solve_Cache)(nil), - } -} - -type FileAction struct { - // Index of the file action that failed the exec. - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -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_689dc58a5060aff5, []int{5} -} -func (m *FileAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileAction.Unmarshal(m, b) -} -func (m *FileAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileAction.Marshal(b, m, deterministic) -} -func (m *FileAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileAction.Merge(m, src) -} -func (m *FileAction) XXX_Size() int { - return xxx_messageInfo_FileAction.Size(m) -} -func (m *FileAction) XXX_DiscardUnknown() { - xxx_messageInfo_FileAction.DiscardUnknown(m) -} - -var xxx_messageInfo_FileAction proto.InternalMessageInfo - -func (m *FileAction) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -type ContentCache struct { - // Original index of result that failed the slow cache calculation. - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContentCache) Reset() { *m = ContentCache{} } -func (m *ContentCache) String() string { return proto.CompactTextString(m) } -func (*ContentCache) ProtoMessage() {} -func (*ContentCache) Descriptor() ([]byte, []int) { - return fileDescriptor_689dc58a5060aff5, []int{6} -} -func (m *ContentCache) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContentCache.Unmarshal(m, b) -} -func (m *ContentCache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContentCache.Marshal(b, m, deterministic) -} -func (m *ContentCache) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContentCache.Merge(m, src) -} -func (m *ContentCache) XXX_Size() int { - return xxx_messageInfo_ContentCache.Size(m) -} -func (m *ContentCache) XXX_DiscardUnknown() { - xxx_messageInfo_ContentCache.DiscardUnknown(m) -} - -var xxx_messageInfo_ContentCache proto.InternalMessageInfo - -func (m *ContentCache) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -func init() { - proto.RegisterType((*Vertex)(nil), "errdefs.Vertex") - proto.RegisterType((*Source)(nil), "errdefs.Source") - proto.RegisterType((*FrontendCap)(nil), "errdefs.FrontendCap") - proto.RegisterType((*Subrequest)(nil), "errdefs.Subrequest") - proto.RegisterType((*Solve)(nil), "errdefs.Solve") - proto.RegisterType((*FileAction)(nil), "errdefs.FileAction") - proto.RegisterType((*ContentCache)(nil), "errdefs.ContentCache") -} - -func init() { proto.RegisterFile("errdefs.proto", fileDescriptor_689dc58a5060aff5) } - -var fileDescriptor_689dc58a5060aff5 = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcd, 0x8e, 0xd3, 0x30, - 0x14, 0x85, 0x27, 0xbf, 0x43, 0x6e, 0x81, 0x85, 0x81, 0x51, 0x34, 0xab, 0x8c, 0xc5, 0xa2, 0x48, - 0x90, 0x48, 0xc3, 0x13, 0x40, 0xd1, 0x68, 0x66, 0x55, 0xc9, 0x95, 0xd8, 0xc7, 0xc9, 0x4d, 0x6b, - 0x48, 0x6c, 0xe3, 0xd8, 0xa8, 0xbc, 0x1b, 0x0f, 0x87, 0xe2, 0xa4, 0x65, 0x16, 0xdd, 0xe5, 0xe4, - 0xfb, 0x7c, 0xed, 0x63, 0xc3, 0x2b, 0x34, 0xa6, 0xc5, 0x6e, 0x2c, 0xb5, 0x51, 0x56, 0x91, 0xeb, - 0x25, 0xde, 0x7e, 0xdc, 0x0b, 0x7b, 0x70, 0xbc, 0x6c, 0xd4, 0x50, 0x0d, 0x8a, 0xff, 0xa9, 0xb8, - 0x13, 0x7d, 0xfb, 0x53, 0xd8, 0x6a, 0x54, 0xfd, 0x6f, 0x34, 0x95, 0xe6, 0x95, 0xd2, 0xcb, 0x32, - 0x5a, 0x40, 0xfa, 0x1d, 0x8d, 0xc5, 0x23, 0xb9, 0x81, 0xb4, 0x15, 0x7b, 0x1c, 0x6d, 0x1e, 0x14, - 0xc1, 0x3a, 0x63, 0x4b, 0xa2, 0x5b, 0x48, 0x77, 0xca, 0x99, 0x06, 0x09, 0x85, 0x58, 0xc8, 0x4e, - 0x79, 0xbe, 0xba, 0x7f, 0x5d, 0x6a, 0x5e, 0xce, 0xe4, 0x49, 0x76, 0x8a, 0x79, 0x46, 0xee, 0x20, - 0x35, 0xb5, 0xdc, 0xe3, 0x98, 0x87, 0x45, 0xb4, 0x5e, 0xdd, 0x67, 0x93, 0xc5, 0xa6, 0x3f, 0x6c, - 0x01, 0xf4, 0x0e, 0x56, 0x0f, 0x46, 0x49, 0x8b, 0xb2, 0xdd, 0xd4, 0x9a, 0x10, 0x88, 0x65, 0x3d, - 0xe0, 0xb2, 0xab, 0xff, 0xa6, 0x05, 0xc0, 0xce, 0x71, 0x83, 0xbf, 0x1c, 0x8e, 0xf6, 0xa2, 0xf1, - 0x37, 0x80, 0x64, 0x37, 0xf5, 0x21, 0xb7, 0xf0, 0x42, 0x48, 0xed, 0xec, 0xd3, 0xb7, 0x31, 0x0f, - 0x8a, 0x68, 0x9d, 0xb1, 0x73, 0x9e, 0xd8, 0xa0, 0x9c, 0xf4, 0x2c, 0x9c, 0xd9, 0x29, 0x93, 0x1b, - 0x08, 0x95, 0xce, 0x23, 0xdf, 0x25, 0x9d, 0x4e, 0xb9, 0xd5, 0x2c, 0x54, 0x9a, 0x7c, 0x80, 0xb8, - 0x13, 0x3d, 0xe6, 0xb1, 0x27, 0x6f, 0xca, 0xd3, 0x35, 0x3f, 0x88, 0x1e, 0xbf, 0x34, 0x56, 0x28, - 0xf9, 0x78, 0xc5, 0xbc, 0x42, 0x3e, 0x41, 0xd2, 0xd4, 0xcd, 0x01, 0xf3, 0xc4, 0xbb, 0xef, 0xce, - 0xee, 0xc6, 0xd7, 0xb3, 0x9b, 0x09, 0x3e, 0x5e, 0xb1, 0xd9, 0xfa, 0x9a, 0xc1, 0xf5, 0xe8, 0xf8, - 0x0f, 0x6c, 0x2c, 0xa5, 0x00, 0xff, 0xe7, 0x91, 0xb7, 0x90, 0x08, 0xd9, 0xe2, 0xd1, 0x37, 0x8c, - 0xd8, 0x1c, 0xe8, 0x7b, 0x78, 0xf9, 0x7c, 0xce, 0x65, 0x8b, 0xa7, 0xfe, 0x1d, 0x3f, 0xff, 0x0b, - 0x00, 0x00, 0xff, 0xff, 0x1e, 0xfa, 0x9c, 0x6f, 0x0f, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.proto b/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.proto deleted file mode 100644 index d4b9177540..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -package errdefs; - -import "github.com/moby/buildkit/solver/pb/ops.proto"; - -message Vertex { - string digest = 1; -} - -message Source { - pb.SourceInfo info = 1; - repeated pb.Range ranges = 2; -} - -message FrontendCap { - string name = 1; -} - -message Subrequest { - string name = 1; -} - -message Solve { - repeated string inputIDs = 1; - repeated string mountIDs = 2; - pb.Op op = 3; - - oneof subject { - FileAction file = 4; - ContentCache cache = 5; - } -} - -message FileAction { - // Index of the file action that failed the exec. - int64 index = 1; -} - -message ContentCache { - // Original index of result that failed the slow cache calculation. - int64 index = 1; -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/fronetendcap.go b/vendor/github.com/moby/buildkit/solver/errdefs/fronetendcap.go deleted file mode 100644 index e8af9ff233..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/fronetendcap.go +++ /dev/null @@ -1,41 +0,0 @@ -package errdefs - -import ( - fmt "fmt" - - "github.com/containerd/typeurl" - "github.com/moby/buildkit/util/grpcerrors" -) - -func init() { - typeurl.Register((*FrontendCap)(nil), "github.com/moby/buildkit", "errdefs.FrontendCap+json") -} - -type UnsupportedFrontendCapError struct { - FrontendCap - error -} - -func (e *UnsupportedFrontendCapError) Error() string { - msg := fmt.Sprintf("unsupported frontend capability %s", e.FrontendCap.Name) - if e.error != nil { - msg += ": " + e.error.Error() - } - return msg -} - -func (e *UnsupportedFrontendCapError) Unwrap() error { - return e.error -} - -func (e *UnsupportedFrontendCapError) ToProto() grpcerrors.TypedErrorProto { - return &e.FrontendCap -} - -func NewUnsupportedFrontendCapError(name string) error { - return &UnsupportedFrontendCapError{FrontendCap: FrontendCap{Name: name}} -} - -func (v *FrontendCap) WrapError(err error) error { - return &UnsupportedFrontendCapError{error: err, FrontendCap: *v} -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/generate.go b/vendor/github.com/moby/buildkit/solver/errdefs/generate.go deleted file mode 100644 index e0dc24cd3b..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/generate.go +++ /dev/null @@ -1,3 +0,0 @@ -package errdefs - -//go:generate protoc -I=. -I=../../vendor/ -I=../../../../../ --gogo_out=. errdefs.proto diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/op.go b/vendor/github.com/moby/buildkit/solver/errdefs/op.go deleted file mode 100644 index 61068b6e46..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/op.go +++ /dev/null @@ -1,20 +0,0 @@ -package errdefs - -import "github.com/moby/buildkit/solver/pb" - -type OpError struct { - error - Op *pb.Op -} - -func (e *OpError) Unwrap() error { - return e.error -} - -func WithOp(err error, iface interface{}) error { - op, ok := iface.(*pb.Op) - if err == nil || !ok { - return err - } - return &OpError{error: err, Op: op} -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/solve.go b/vendor/github.com/moby/buildkit/solver/errdefs/solve.go deleted file mode 100644 index 97ce5a3f92..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/solve.go +++ /dev/null @@ -1,74 +0,0 @@ -package errdefs - -import ( - "bytes" - "errors" - - "github.com/containerd/typeurl" - "github.com/golang/protobuf/jsonpb" - "github.com/moby/buildkit/solver/pb" - "github.com/moby/buildkit/util/grpcerrors" -) - -func init() { - typeurl.Register((*Solve)(nil), "github.com/moby/buildkit", "errdefs.Solve+json") -} - -//nolint:golint -type IsSolve_Subject isSolve_Subject - -// SolveError will be returned when an error is encountered during a solve that -// has an exec op. -type SolveError struct { - Solve - Err error -} - -func (e *SolveError) Error() string { - return e.Err.Error() -} - -func (e *SolveError) Unwrap() error { - return e.Err -} - -func (e *SolveError) ToProto() grpcerrors.TypedErrorProto { - return &e.Solve -} - -func WithSolveError(err error, subject IsSolve_Subject, inputIDs, mountIDs []string) error { - if err == nil { - return nil - } - var ( - oe *OpError - op *pb.Op - ) - if errors.As(err, &oe) { - op = oe.Op - } - return &SolveError{ - Err: err, - Solve: Solve{ - InputIDs: inputIDs, - MountIDs: mountIDs, - Op: op, - Subject: subject, - }, - } -} - -func (v *Solve) WrapError(err error) error { - return &SolveError{Err: err, Solve: *v} -} - -func (v *Solve) MarshalJSON() ([]byte, error) { - m := jsonpb.Marshaler{} - buf := new(bytes.Buffer) - err := m.Marshal(buf, v) - return buf.Bytes(), err -} - -func (v *Solve) UnmarshalJSON(b []byte) error { - return jsonpb.Unmarshal(bytes.NewReader(b), v) -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/source.go b/vendor/github.com/moby/buildkit/solver/errdefs/source.go deleted file mode 100644 index 6c1f364957..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/source.go +++ /dev/null @@ -1,128 +0,0 @@ -package errdefs - -import ( - "fmt" - "io" - "strings" - - pb "github.com/moby/buildkit/solver/pb" - "github.com/moby/buildkit/util/grpcerrors" - "github.com/pkg/errors" -) - -func WithSource(err error, src Source) error { - if err == nil { - return nil - } - return &ErrorSource{Source: src, error: err} -} - -type ErrorSource struct { - Source - error -} - -func (e *ErrorSource) Unwrap() error { - return e.error -} - -func (e *ErrorSource) ToProto() grpcerrors.TypedErrorProto { - return &e.Source -} - -func Sources(err error) []*Source { - var out []*Source - var es *ErrorSource - if errors.As(err, &es) { - out = Sources(es.Unwrap()) - out = append(out, &es.Source) - } - return out -} - -func (s *Source) WrapError(err error) error { - return &ErrorSource{error: err, Source: *s} -} - -func (s *Source) Print(w io.Writer) error { - si := s.Info - if si == nil { - return nil - } - lines := strings.Split(string(si.Data), "\n") - - start, end, ok := getStartEndLine(s.Ranges) - if !ok { - return nil - } - if start > len(lines) || start < 1 { - return nil - } - if end > len(lines) { - end = len(lines) - } - - pad := 2 - if end == start { - pad = 4 - } - var p int - - prepadStart := start - for { - if p >= pad { - break - } - if start > 1 { - start-- - p++ - } - if end != len(lines) { - end++ - p++ - } - p++ - } - - fmt.Fprintf(w, "%s:%d\n--------------------\n", si.Filename, prepadStart) - for i := start; i <= end; i++ { - pfx := " " - if containsLine(s.Ranges, i) { - pfx = ">>>" - } - fmt.Fprintf(w, " %3d | %s %s\n", i, pfx, lines[i-1]) - } - fmt.Fprintf(w, "--------------------\n") - return nil -} - -func containsLine(rr []*pb.Range, l int) bool { - for _, r := range rr { - e := r.End.Line - if e < r.Start.Line { - e = r.Start.Line - } - if r.Start.Line <= int32(l) && e >= int32(l) { - return true - } - } - return false -} - -func getStartEndLine(rr []*pb.Range) (start int, end int, ok bool) { - first := true - for _, r := range rr { - e := r.End.Line - if e < r.Start.Line { - e = r.Start.Line - } - if first || int(r.Start.Line) < start { - start = int(r.Start.Line) - } - if int(e) > end { - end = int(e) - } - first = false - } - return start, end, !first -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/subrequest.go b/vendor/github.com/moby/buildkit/solver/errdefs/subrequest.go deleted file mode 100644 index b30eab3f66..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/subrequest.go +++ /dev/null @@ -1,41 +0,0 @@ -package errdefs - -import ( - fmt "fmt" - - "github.com/containerd/typeurl" - "github.com/moby/buildkit/util/grpcerrors" -) - -func init() { - typeurl.Register((*Subrequest)(nil), "github.com/moby/buildkit", "errdefs.Subrequest+json") -} - -type UnsupportedSubrequestError struct { - Subrequest - error -} - -func (e *UnsupportedSubrequestError) Error() string { - msg := fmt.Sprintf("unsupported request %s", e.Subrequest.Name) - if e.error != nil { - msg += ": " + e.error.Error() - } - return msg -} - -func (e *UnsupportedSubrequestError) Unwrap() error { - return e.error -} - -func (e *UnsupportedSubrequestError) ToProto() grpcerrors.TypedErrorProto { - return &e.Subrequest -} - -func NewUnsupportedSubrequestError(name string) error { - return &UnsupportedSubrequestError{Subrequest: Subrequest{Name: name}} -} - -func (v *Subrequest) WrapError(err error) error { - return &UnsupportedSubrequestError{error: err, Subrequest: *v} -} diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/vertex.go b/vendor/github.com/moby/buildkit/solver/errdefs/vertex.go deleted file mode 100644 index 4ec375165d..0000000000 --- a/vendor/github.com/moby/buildkit/solver/errdefs/vertex.go +++ /dev/null @@ -1,36 +0,0 @@ -package errdefs - -import ( - "github.com/containerd/typeurl" - "github.com/moby/buildkit/util/grpcerrors" - digest "github.com/opencontainers/go-digest" -) - -func init() { - typeurl.Register((*Vertex)(nil), "github.com/moby/buildkit", "errdefs.Vertex+json") - typeurl.Register((*Source)(nil), "github.com/moby/buildkit", "errdefs.Source+json") -} - -type VertexError struct { - Vertex - error -} - -func (e *VertexError) Unwrap() error { - return e.error -} - -func (e *VertexError) ToProto() grpcerrors.TypedErrorProto { - return &e.Vertex -} - -func WrapVertex(err error, dgst digest.Digest) error { - if err == nil { - return nil - } - return &VertexError{Vertex: Vertex{Digest: dgst.String()}, error: err} -} - -func (v *Vertex) WrapError(err error) error { - return &VertexError{error: err, Vertex: *v} -} diff --git a/vendor/github.com/moby/buildkit/solver/pb/caps.go b/vendor/github.com/moby/buildkit/solver/pb/caps.go index 5f9bc51808..aa9e39f9b7 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/caps.go +++ b/vendor/github.com/moby/buildkit/solver/pb/caps.go @@ -25,6 +25,7 @@ const ( CapSourceGitHTTPAuth apicaps.CapID = "source.git.httpauth" CapSourceGitKnownSSHHosts apicaps.CapID = "source.git.knownsshhosts" CapSourceGitMountSSHSock apicaps.CapID = "source.git.mountsshsock" + CapSourceGitSubdir apicaps.CapID = "source.git.subdir" CapSourceHTTP apicaps.CapID = "source.http" CapSourceHTTPChecksum apicaps.CapID = "source.http.checksum" @@ -50,8 +51,9 @@ const ( CapExecMetaSecurityDeviceWhitelistV1 apicaps.CapID = "exec.meta.security.devices.v1" - CapFileBase apicaps.CapID = "file.base" - CapFileRmWildcard apicaps.CapID = "file.rm.wildcard" + CapFileBase apicaps.CapID = "file.base" + CapFileRmWildcard apicaps.CapID = "file.rm.wildcard" + CapFileCopyIncludeExcludePatterns apicaps.CapID = "file.copy.includeexcludepatterns" CapConstraints apicaps.CapID = "constraints" CapPlatform apicaps.CapID = "platform" @@ -152,6 +154,12 @@ func init() { Status: apicaps.CapStatusExperimental, }) + Caps.Init(apicaps.Cap{ + ID: CapSourceGitSubdir, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + Caps.Init(apicaps.Cap{ ID: CapSourceHTTP, Enabled: true, @@ -288,6 +296,12 @@ func init() { Status: apicaps.CapStatusExperimental, }) + Caps.Init(apicaps.Cap{ + ID: CapFileCopyIncludeExcludePatterns, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) + Caps.Init(apicaps.Cap{ ID: CapConstraints, Enabled: true, 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 93023b37f4..77feeac781 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go +++ b/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go @@ -1409,6 +1409,7 @@ type ProxyEnv struct { HttpsProxy string `protobuf:"bytes,2,opt,name=https_proxy,json=httpsProxy,proto3" json:"https_proxy,omitempty"` FtpProxy string `protobuf:"bytes,3,opt,name=ftp_proxy,json=ftpProxy,proto3" json:"ftp_proxy,omitempty"` NoProxy string `protobuf:"bytes,4,opt,name=no_proxy,json=noProxy,proto3" json:"no_proxy,omitempty"` + AllProxy string `protobuf:"bytes,5,opt,name=all_proxy,json=allProxy,proto3" json:"all_proxy,omitempty"` } func (m *ProxyEnv) Reset() { *m = ProxyEnv{} } @@ -1468,6 +1469,13 @@ func (m *ProxyEnv) GetNoProxy() string { return "" } +func (m *ProxyEnv) GetAllProxy() string { + if m != nil { + return m.AllProxy + } + return "" +} + // WorkerConstraints defines conditions for the worker type WorkerConstraints struct { Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` @@ -1791,6 +1799,10 @@ type FileActionCopy struct { AllowEmptyWildcard bool `protobuf:"varint,10,opt,name=allowEmptyWildcard,proto3" json:"allowEmptyWildcard,omitempty"` // optional created time override Timestamp int64 `protobuf:"varint,11,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // include only files/dirs matching at least one of these patterns + IncludePatterns []string `protobuf:"bytes,12,rep,name=include_patterns,json=includePatterns,proto3" json:"include_patterns,omitempty"` + // exclude files/dir matching any of these patterns (even if they match an include pattern) + ExcludePatterns []string `protobuf:"bytes,13,rep,name=exclude_patterns,json=excludePatterns,proto3" json:"exclude_patterns,omitempty"` } func (m *FileActionCopy) Reset() { *m = FileActionCopy{} } @@ -1899,6 +1911,20 @@ func (m *FileActionCopy) GetTimestamp() int64 { return 0 } +func (m *FileActionCopy) GetIncludePatterns() []string { + if m != nil { + return m.IncludePatterns + } + return nil +} + +func (m *FileActionCopy) GetExcludePatterns() []string { + if m != nil { + return m.ExcludePatterns + } + return nil +} + type FileActionMkFile struct { // path for the new file Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` @@ -2332,146 +2358,149 @@ func init() { func init() { proto.RegisterFile("ops.proto", fileDescriptor_8de16154b2733812) } var fileDescriptor_8de16154b2733812 = []byte{ - // 2217 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0x17, 0xbf, 0xc9, 0x47, 0x49, 0x66, 0x27, 0x4e, 0xc2, 0xa8, 0xae, 0xa4, 0x6c, 0xdc, 0x40, - 0x96, 0x6d, 0x0a, 0x50, 0x80, 0x38, 0x08, 0x8a, 0xa2, 0xe2, 0x87, 0x21, 0xc6, 0xb6, 0x28, 0x0c, - 0xfd, 0xd1, 0x9b, 0xb1, 0x5a, 0x0e, 0xa9, 0x85, 0xc8, 0x9d, 0xc5, 0xec, 0xd0, 0x16, 0x2f, 0x3d, - 0xf8, 0x2f, 0x08, 0x50, 0xa0, 0xb7, 0x16, 0xe8, 0xa5, 0x7f, 0x41, 0xaf, 0x3d, 0x16, 0xc8, 0x31, - 0x87, 0x1e, 0x82, 0x1e, 0xd2, 0xc2, 0xbe, 0xf7, 0x3f, 0x28, 0x50, 0xbc, 0x37, 0xb3, 0x1f, 0x94, - 0x65, 0xd8, 0x46, 0x8b, 0x9e, 0x76, 0xe6, 0xbd, 0xdf, 0xbc, 0x79, 0xf3, 0xbe, 0xe6, 0xcd, 0x42, - 0x4d, 0x86, 0x51, 0x2b, 0x54, 0x52, 0x4b, 0x96, 0x0f, 0x4f, 0x36, 0x6e, 0x4f, 0x7c, 0x7d, 0x3a, - 0x3f, 0x69, 0x79, 0x72, 0xb6, 0x37, 0x91, 0x13, 0xb9, 0x47, 0xac, 0x93, 0xf9, 0x98, 0x66, 0x34, - 0xa1, 0x91, 0x59, 0xe2, 0xfc, 0x31, 0x0f, 0xf9, 0x41, 0xc8, 0x3e, 0x85, 0xb2, 0x1f, 0x84, 0x73, - 0x1d, 0x35, 0x73, 0xdb, 0x85, 0x9d, 0xfa, 0x7e, 0xad, 0x15, 0x9e, 0xb4, 0xfa, 0x48, 0xe1, 0x96, - 0xc1, 0xb6, 0xa1, 0x28, 0xce, 0x85, 0xd7, 0xcc, 0x6f, 0xe7, 0x76, 0xea, 0xfb, 0x80, 0x80, 0xde, - 0xb9, 0xf0, 0x06, 0xe1, 0xe1, 0x0a, 0x27, 0x0e, 0xfb, 0x1c, 0xca, 0x91, 0x9c, 0x2b, 0x4f, 0x34, - 0x0b, 0x84, 0x59, 0x45, 0xcc, 0x90, 0x28, 0x84, 0xb2, 0x5c, 0x94, 0x34, 0xf6, 0xa7, 0xa2, 0x59, - 0x4c, 0x25, 0xdd, 0xf5, 0xa7, 0x06, 0x43, 0x1c, 0xf6, 0x19, 0x94, 0x4e, 0xe6, 0xfe, 0x74, 0xd4, - 0x2c, 0x11, 0xa4, 0x8e, 0x90, 0x36, 0x12, 0x08, 0x63, 0x78, 0x6c, 0x07, 0xaa, 0xe1, 0xd4, 0xd5, - 0x63, 0xa9, 0x66, 0x4d, 0x48, 0x37, 0x3c, 0xb6, 0x34, 0x9e, 0x70, 0xd9, 0x1d, 0xa8, 0x7b, 0x32, - 0x88, 0xb4, 0x72, 0xfd, 0x40, 0x47, 0xcd, 0x3a, 0x81, 0x3f, 0x44, 0xf0, 0x13, 0xa9, 0xce, 0x84, - 0xea, 0xa4, 0x4c, 0x9e, 0x45, 0xb6, 0x8b, 0x90, 0x97, 0xa1, 0xf3, 0xbb, 0x1c, 0x54, 0x63, 0xa9, - 0xcc, 0x81, 0xd5, 0x03, 0xe5, 0x9d, 0xfa, 0x5a, 0x78, 0x7a, 0xae, 0x44, 0x33, 0xb7, 0x9d, 0xdb, - 0xa9, 0xf1, 0x25, 0x1a, 0x5b, 0x87, 0xfc, 0x60, 0x48, 0x86, 0xaa, 0xf1, 0xfc, 0x60, 0xc8, 0x9a, - 0x50, 0x79, 0xec, 0x2a, 0xdf, 0x0d, 0x34, 0x59, 0xa6, 0xc6, 0xe3, 0x29, 0xbb, 0x06, 0xb5, 0xc1, - 0xf0, 0xb1, 0x50, 0x91, 0x2f, 0x03, 0xb2, 0x47, 0x8d, 0xa7, 0x04, 0xb6, 0x09, 0x30, 0x18, 0xde, - 0x15, 0x2e, 0x0a, 0x8d, 0x9a, 0xa5, 0xed, 0xc2, 0x4e, 0x8d, 0x67, 0x28, 0xce, 0x6f, 0xa0, 0x44, - 0x3e, 0x62, 0xdf, 0x40, 0x79, 0xe4, 0x4f, 0x44, 0xa4, 0x8d, 0x3a, 0xed, 0xfd, 0xef, 0x7e, 0xdc, - 0x5a, 0xf9, 0xfb, 0x8f, 0x5b, 0xbb, 0x99, 0x60, 0x90, 0xa1, 0x08, 0x3c, 0x19, 0x68, 0xd7, 0x0f, - 0x84, 0x8a, 0xf6, 0x26, 0xf2, 0xb6, 0x59, 0xd2, 0xea, 0xd2, 0x87, 0x5b, 0x09, 0xec, 0x06, 0x94, - 0xfc, 0x60, 0x24, 0xce, 0x49, 0xff, 0x42, 0xfb, 0x03, 0x2b, 0xaa, 0x3e, 0x98, 0xeb, 0x70, 0xae, - 0xfb, 0xc8, 0xe2, 0x06, 0xe1, 0xfc, 0x21, 0x07, 0x65, 0x13, 0x03, 0xec, 0x1a, 0x14, 0x67, 0x42, - 0xbb, 0xb4, 0x7f, 0x7d, 0xbf, 0x8a, 0xb6, 0x7d, 0x20, 0xb4, 0xcb, 0x89, 0x8a, 0xe1, 0x35, 0x93, - 0x73, 0xb4, 0x7d, 0x3e, 0x0d, 0xaf, 0x07, 0x48, 0xe1, 0x96, 0xc1, 0x7e, 0x0e, 0x95, 0x40, 0xe8, - 0xe7, 0x52, 0x9d, 0x91, 0x8d, 0xd6, 0x8d, 0xd3, 0x8f, 0x84, 0x7e, 0x20, 0x47, 0x82, 0xc7, 0x3c, - 0x76, 0x0b, 0xaa, 0x91, 0xf0, 0xe6, 0xca, 0xd7, 0x0b, 0xb2, 0xd7, 0xfa, 0x7e, 0x83, 0xa2, 0xcc, - 0xd2, 0x08, 0x9c, 0x20, 0x9c, 0xbf, 0xe6, 0xa0, 0x88, 0x6a, 0x30, 0x06, 0x45, 0x57, 0x4d, 0x4c, - 0x74, 0xd7, 0x38, 0x8d, 0x59, 0x03, 0x0a, 0x22, 0x78, 0x46, 0x1a, 0xd5, 0x38, 0x0e, 0x91, 0xe2, - 0x3d, 0x1f, 0x59, 0x1f, 0xe1, 0x10, 0xd7, 0xcd, 0x23, 0xa1, 0xac, 0x6b, 0x68, 0xcc, 0x6e, 0x40, - 0x2d, 0x54, 0xf2, 0x7c, 0xf1, 0x14, 0x57, 0x97, 0x32, 0x81, 0x87, 0xc4, 0x5e, 0xf0, 0x8c, 0x57, - 0x43, 0x3b, 0x62, 0xbb, 0x00, 0xe2, 0x5c, 0x2b, 0xf7, 0x50, 0x46, 0x3a, 0x6a, 0x96, 0xe9, 0xec, - 0x14, 0xef, 0x48, 0xe8, 0x1f, 0xf3, 0x0c, 0x97, 0x6d, 0x40, 0xf5, 0x54, 0x46, 0x3a, 0x70, 0x67, - 0xa2, 0x59, 0xa1, 0xed, 0x92, 0xb9, 0xf3, 0xaf, 0x3c, 0x94, 0xc8, 0x5c, 0x6c, 0x07, 0xbd, 0x13, - 0xce, 0x8d, 0xa3, 0x0b, 0x6d, 0x66, 0xbd, 0x03, 0x14, 0x07, 0x89, 0x73, 0x30, 0x26, 0x36, 0xd0, - 0x52, 0x53, 0xe1, 0x69, 0xa9, 0x6c, 0x28, 0x26, 0x73, 0x3c, 0xd6, 0x08, 0xa3, 0xc5, 0x9c, 0x94, - 0xc6, 0xec, 0x26, 0x94, 0x25, 0xb9, 0x98, 0x0e, 0xfb, 0x06, 0xc7, 0x5b, 0x08, 0x0a, 0x57, 0xc2, - 0x1d, 0xc9, 0x60, 0xba, 0x20, 0x13, 0x54, 0x79, 0x32, 0x67, 0x37, 0xa1, 0x46, 0x3e, 0x7d, 0xb8, - 0x08, 0x45, 0xb3, 0x4c, 0x3e, 0x5a, 0x4b, 0xfc, 0x8d, 0x44, 0x9e, 0xf2, 0x31, 0x89, 0x3d, 0xd7, - 0x3b, 0x15, 0x83, 0x50, 0x37, 0xaf, 0xa6, 0xb6, 0xec, 0x58, 0x1a, 0x4f, 0xb8, 0x28, 0x36, 0x12, - 0x9e, 0x12, 0x1a, 0xa1, 0x1f, 0x12, 0x74, 0xcd, 0xba, 0xde, 0x10, 0x79, 0xca, 0x67, 0x0e, 0x94, - 0x87, 0xc3, 0x43, 0x44, 0x7e, 0x94, 0x16, 0x19, 0x43, 0xe1, 0x96, 0x63, 0xce, 0x10, 0xcd, 0xa7, - 0xba, 0xdf, 0x6d, 0x7e, 0x6c, 0x0c, 0x14, 0xcf, 0x9d, 0x3e, 0x54, 0x63, 0x15, 0x30, 0x9b, 0xfb, - 0x5d, 0x9b, 0xe7, 0xf9, 0x7e, 0x97, 0xdd, 0x86, 0x4a, 0x74, 0xea, 0x2a, 0x3f, 0x98, 0x90, 0x5d, - 0xd7, 0xf7, 0x3f, 0x48, 0x34, 0x1e, 0x1a, 0x3a, 0xee, 0x12, 0x63, 0x1c, 0x09, 0xb5, 0x44, 0xc5, - 0xd7, 0x64, 0x35, 0xa0, 0x30, 0xf7, 0x47, 0x24, 0x67, 0x8d, 0xe3, 0x10, 0x29, 0x13, 0xdf, 0xc4, - 0xe0, 0x1a, 0xc7, 0x21, 0x3a, 0x6b, 0x26, 0x47, 0xa6, 0x5c, 0xae, 0x71, 0x1a, 0xa3, 0xee, 0x32, - 0xd4, 0xbe, 0x0c, 0xdc, 0x69, 0x6c, 0xff, 0x78, 0xee, 0x4c, 0xe3, 0xb3, 0xff, 0x5f, 0x76, 0xfb, - 0x6d, 0x0e, 0xaa, 0x71, 0x8d, 0xc7, 0x82, 0xe5, 0x8f, 0x44, 0xa0, 0xfd, 0xb1, 0x2f, 0x94, 0xdd, - 0x38, 0x43, 0x61, 0xb7, 0xa1, 0xe4, 0x6a, 0xad, 0xe2, 0x32, 0xf0, 0x71, 0xf6, 0x82, 0x68, 0x1d, - 0x20, 0xa7, 0x17, 0x68, 0xb5, 0xe0, 0x06, 0xb5, 0xf1, 0x15, 0x40, 0x4a, 0x44, 0x5d, 0xcf, 0xc4, - 0xc2, 0x4a, 0xc5, 0x21, 0xbb, 0x0a, 0xa5, 0x67, 0xee, 0x74, 0x2e, 0x6c, 0x7c, 0x9b, 0xc9, 0xd7, - 0xf9, 0xaf, 0x72, 0xce, 0x5f, 0xf2, 0x50, 0xb1, 0x17, 0x06, 0xbb, 0x05, 0x15, 0xba, 0x30, 0xac, - 0x46, 0x97, 0x27, 0x4d, 0x0c, 0x61, 0x7b, 0xc9, 0x4d, 0x98, 0xd1, 0xd1, 0x8a, 0x32, 0x37, 0xa2, - 0xd5, 0x31, 0xbd, 0x17, 0x0b, 0x23, 0x31, 0xb6, 0x57, 0xde, 0x3a, 0xa2, 0xbb, 0x62, 0xec, 0x07, - 0x3e, 0xda, 0x87, 0x23, 0x8b, 0xdd, 0x8a, 0x4f, 0x5d, 0x24, 0x89, 0x1f, 0x65, 0x25, 0xbe, 0x7e, - 0xe8, 0x3e, 0xd4, 0x33, 0xdb, 0x5c, 0x72, 0xea, 0xeb, 0xd9, 0x53, 0xdb, 0x2d, 0x49, 0x9c, 0xb9, - 0xaf, 0x53, 0x2b, 0xfc, 0x17, 0xf6, 0xfb, 0x12, 0x20, 0x15, 0xf9, 0xee, 0x45, 0xc7, 0x79, 0x51, - 0x00, 0x18, 0x84, 0x58, 0x72, 0x47, 0x2e, 0xd5, 0xfd, 0x55, 0x7f, 0x12, 0x48, 0x25, 0x9e, 0x52, - 0x1a, 0xd3, 0xfa, 0x2a, 0xaf, 0x1b, 0x1a, 0x65, 0x0c, 0x3b, 0x80, 0xfa, 0x48, 0x44, 0x9e, 0xf2, - 0x29, 0xa0, 0xac, 0xd1, 0xb7, 0xf0, 0x4c, 0xa9, 0x9c, 0x56, 0x37, 0x45, 0x18, 0x5b, 0x65, 0xd7, - 0xb0, 0x7d, 0x58, 0x15, 0xe7, 0xa1, 0x54, 0xda, 0xee, 0x62, 0xfa, 0x8a, 0x2b, 0xa6, 0x43, 0x41, - 0x3a, 0xed, 0xc4, 0xeb, 0x22, 0x9d, 0x30, 0x17, 0x8a, 0x9e, 0x1b, 0x9a, 0x4b, 0xb5, 0xbe, 0xdf, - 0xbc, 0xb0, 0x5f, 0xc7, 0x0d, 0x8d, 0xd1, 0xda, 0x5f, 0xe0, 0x59, 0x5f, 0xfc, 0x63, 0xeb, 0x66, - 0xe6, 0x26, 0x9d, 0xc9, 0x93, 0xc5, 0x1e, 0xc5, 0xcb, 0x99, 0xaf, 0xf7, 0xe6, 0xda, 0x9f, 0xee, - 0xb9, 0xa1, 0x8f, 0xe2, 0x70, 0x61, 0xbf, 0xcb, 0x49, 0xf4, 0xc6, 0x2f, 0xa1, 0x71, 0x51, 0xef, - 0xf7, 0xf1, 0xc1, 0xc6, 0x1d, 0xa8, 0x25, 0x7a, 0xbc, 0x6d, 0x61, 0x35, 0xeb, 0xbc, 0x3f, 0xe7, - 0xa0, 0x6c, 0xb2, 0x8a, 0xdd, 0x81, 0xda, 0x54, 0x7a, 0x2e, 0x2a, 0x10, 0xb7, 0x76, 0x9f, 0xa4, - 0x49, 0xd7, 0xba, 0x1f, 0xf3, 0x8c, 0x55, 0x53, 0x2c, 0x06, 0x99, 0x1f, 0x8c, 0x65, 0x9c, 0x05, - 0xeb, 0xe9, 0xa2, 0x7e, 0x30, 0x96, 0xdc, 0x30, 0x37, 0xee, 0xc1, 0xfa, 0xb2, 0x88, 0x4b, 0xf4, - 0xfc, 0x6c, 0x39, 0x5c, 0xa9, 0x66, 0x27, 0x8b, 0xb2, 0x6a, 0xdf, 0x81, 0x5a, 0x42, 0x67, 0xbb, - 0xaf, 0x2b, 0xbe, 0x9a, 0x5d, 0x99, 0xd1, 0xd5, 0x99, 0x02, 0xa4, 0xaa, 0x61, 0xb1, 0xc2, 0x1e, - 0x92, 0xee, 0x51, 0xa3, 0x46, 0x32, 0xa7, 0x7b, 0xcf, 0xd5, 0x2e, 0xa9, 0xb2, 0xca, 0x69, 0xcc, - 0x5a, 0x00, 0xa3, 0x24, 0x61, 0xdf, 0x90, 0xc6, 0x19, 0x84, 0x33, 0x80, 0x6a, 0xac, 0x04, 0xdb, - 0x86, 0x7a, 0x64, 0x77, 0xc6, 0x8e, 0x09, 0xb7, 0x2b, 0xf1, 0x2c, 0x09, 0x3b, 0x1f, 0xe5, 0x06, - 0x13, 0xb1, 0xd4, 0xf9, 0x70, 0xa4, 0x70, 0xcb, 0x70, 0x9e, 0x40, 0x89, 0x08, 0x98, 0x66, 0x91, - 0x76, 0x95, 0xb6, 0x4d, 0x94, 0x69, 0x2a, 0x64, 0x44, 0xdb, 0xb6, 0x8b, 0x18, 0x88, 0xdc, 0x00, - 0xd8, 0x75, 0x6c, 0x5d, 0x46, 0xd6, 0xa2, 0x97, 0xe1, 0x90, 0xed, 0xfc, 0x02, 0xaa, 0x31, 0x19, - 0x4f, 0x7e, 0xdf, 0x0f, 0x84, 0x55, 0x91, 0xc6, 0xd8, 0x7c, 0x76, 0x4e, 0x5d, 0xe5, 0x7a, 0x5a, - 0x98, 0x16, 0xa1, 0xc4, 0x53, 0x82, 0xf3, 0x19, 0xd4, 0x33, 0xd9, 0x83, 0xe1, 0xf6, 0x98, 0xdc, - 0x68, 0x72, 0xd8, 0x4c, 0x9c, 0x17, 0xd8, 0x1a, 0xc7, 0xdd, 0xce, 0xcf, 0x00, 0x4e, 0xb5, 0x0e, - 0x9f, 0x52, 0xfb, 0x63, 0x6d, 0x5f, 0x43, 0x0a, 0x21, 0xd8, 0x16, 0xd4, 0x71, 0x12, 0x59, 0xbe, - 0x89, 0x77, 0x5a, 0x11, 0x19, 0xc0, 0x4f, 0xa1, 0x36, 0x4e, 0x96, 0x17, 0xac, 0xeb, 0xe2, 0xd5, - 0x9f, 0x40, 0x35, 0x90, 0x96, 0x67, 0xba, 0xb1, 0x4a, 0x20, 0x89, 0xe5, 0xdc, 0x84, 0x9f, 0xbc, - 0xd6, 0xc7, 0xb3, 0x8f, 0xa0, 0x3c, 0xf6, 0xa7, 0x9a, 0x8a, 0x3e, 0x36, 0x78, 0x76, 0xe6, 0xfc, - 0x3b, 0x07, 0x90, 0x7a, 0x16, 0xe3, 0x15, 0xab, 0x37, 0x62, 0x56, 0x4d, 0xb5, 0x9e, 0x42, 0x75, - 0x66, 0xeb, 0x80, 0xf5, 0xd9, 0xb5, 0xe5, 0x68, 0x68, 0xc5, 0x65, 0xc2, 0x54, 0x88, 0x7d, 0x5b, - 0x21, 0xde, 0xa7, 0xd7, 0x4e, 0x76, 0xa0, 0x46, 0x25, 0xfb, 0x66, 0x82, 0x34, 0xd1, 0xb8, 0xe5, - 0x6c, 0xdc, 0x83, 0xb5, 0xa5, 0x2d, 0xdf, 0xf1, 0x4e, 0x48, 0xeb, 0x59, 0x36, 0xcb, 0x6e, 0x41, - 0xd9, 0x34, 0x9f, 0x18, 0x12, 0x38, 0xb2, 0x62, 0x68, 0x4c, 0x1d, 0xc3, 0x71, 0xfc, 0x72, 0xe9, - 0x1f, 0x3b, 0xfb, 0x50, 0x36, 0x4f, 0x33, 0xb6, 0x03, 0x15, 0xd7, 0x33, 0xe9, 0x98, 0x29, 0x09, - 0xc8, 0x3c, 0x20, 0x32, 0x8f, 0xd9, 0xce, 0xdf, 0xf2, 0x00, 0x29, 0xfd, 0x3d, 0x3a, 0xd6, 0xaf, - 0x61, 0x3d, 0x12, 0x9e, 0x0c, 0x46, 0xae, 0x5a, 0x10, 0xd7, 0x3e, 0x41, 0x2e, 0x5b, 0x72, 0x01, - 0x99, 0xe9, 0x5e, 0x0b, 0x6f, 0xef, 0x5e, 0x77, 0xa0, 0xe8, 0xc9, 0x70, 0x61, 0x2f, 0x0a, 0xb6, - 0x7c, 0x90, 0x8e, 0x0c, 0x17, 0xf8, 0x10, 0x45, 0x04, 0x6b, 0x41, 0x79, 0x76, 0x46, 0x8f, 0x55, - 0xd3, 0xe8, 0x5f, 0x5d, 0xc6, 0x3e, 0x38, 0xc3, 0x31, 0x3e, 0x6d, 0x0d, 0x8a, 0xdd, 0x84, 0xd2, - 0xec, 0x6c, 0xe4, 0x2b, 0xea, 0x7b, 0xeb, 0xa6, 0x33, 0xcc, 0xc2, 0xbb, 0xbe, 0xc2, 0x07, 0x2c, - 0x61, 0x98, 0x03, 0x79, 0x35, 0xa3, 0x5e, 0xbf, 0x6e, 0x5e, 0x31, 0x19, 0x6b, 0xce, 0x0e, 0x57, - 0x78, 0x5e, 0xcd, 0xda, 0x55, 0x28, 0x1b, 0xbb, 0x3a, 0x7f, 0x2a, 0xc0, 0xfa, 0xb2, 0x96, 0x18, - 0x07, 0x91, 0xf2, 0xe2, 0x38, 0x88, 0x94, 0x97, 0x34, 0xf6, 0xf9, 0x4c, 0x63, 0xef, 0x40, 0x49, - 0x3e, 0x0f, 0x84, 0xca, 0xbe, 0xca, 0x3b, 0xa7, 0xf2, 0x79, 0x80, 0x6d, 0xaa, 0x61, 0x2d, 0x75, - 0x7d, 0x25, 0xdb, 0xf5, 0x5d, 0x87, 0xb5, 0xb1, 0x9c, 0x4e, 0xe5, 0xf3, 0xe1, 0x62, 0x36, 0xf5, - 0x83, 0x33, 0xdb, 0xfa, 0x2d, 0x13, 0xd9, 0x0e, 0x5c, 0x19, 0xf9, 0x0a, 0xd5, 0xe9, 0xc8, 0x40, - 0x8b, 0x80, 0xde, 0x39, 0x88, 0xbb, 0x48, 0x66, 0xdf, 0xc0, 0xb6, 0xab, 0xb5, 0x98, 0x85, 0xfa, - 0x51, 0x10, 0xba, 0xde, 0x59, 0x57, 0x7a, 0x94, 0xb3, 0xb3, 0xd0, 0xd5, 0xfe, 0x89, 0x3f, 0xc5, - 0x27, 0x5d, 0x85, 0x96, 0xbe, 0x15, 0xc7, 0x3e, 0x87, 0x75, 0x4f, 0x09, 0x57, 0x8b, 0xae, 0x88, - 0xf4, 0xb1, 0xab, 0x4f, 0x9b, 0x55, 0x5a, 0x79, 0x81, 0x8a, 0x67, 0x70, 0x51, 0xdb, 0x27, 0xfe, - 0x74, 0xe4, 0xb9, 0x6a, 0xd4, 0xac, 0x99, 0x33, 0x2c, 0x11, 0x59, 0x0b, 0x18, 0x11, 0x7a, 0xb3, - 0x50, 0x2f, 0x12, 0x28, 0x10, 0xf4, 0x12, 0x0e, 0x16, 0x4e, 0xed, 0xcf, 0x44, 0xa4, 0xdd, 0x59, - 0x48, 0x7f, 0x13, 0x0a, 0x3c, 0x25, 0x38, 0xdf, 0xe6, 0xa0, 0x71, 0x31, 0x44, 0xd0, 0xc0, 0x21, - 0xaa, 0x69, 0x93, 0x0d, 0xc7, 0x89, 0xd1, 0xf3, 0x19, 0xa3, 0xc7, 0x37, 0x54, 0x21, 0x73, 0x43, - 0x25, 0x0e, 0x2c, 0xbe, 0xd9, 0x81, 0x4b, 0x2a, 0x95, 0x2e, 0xaa, 0xf4, 0xfb, 0x1c, 0x5c, 0xb9, - 0x10, 0x86, 0xef, 0xac, 0xd1, 0x36, 0xd4, 0x67, 0xee, 0x99, 0x38, 0x76, 0x15, 0x39, 0xb7, 0x60, - 0x5a, 0xb8, 0x0c, 0xe9, 0x7f, 0xa0, 0x5f, 0x00, 0xab, 0xd9, 0xd8, 0xbf, 0x54, 0xb7, 0xd8, 0x95, - 0x47, 0x52, 0xdf, 0x95, 0x73, 0x7b, 0xfb, 0xc5, 0xae, 0x8c, 0x89, 0xaf, 0x3b, 0xbc, 0x70, 0x89, - 0xc3, 0x9d, 0x23, 0xa8, 0xc6, 0x0a, 0xb2, 0x2d, 0xfb, 0xc4, 0xcf, 0xa5, 0xbf, 0x9a, 0x1e, 0x45, - 0x42, 0xa1, 0xee, 0xe6, 0xbd, 0xff, 0x29, 0x94, 0x26, 0x4a, 0xce, 0x43, 0x5b, 0x5b, 0x97, 0x10, - 0x86, 0xe3, 0x0c, 0xa1, 0x62, 0x29, 0x6c, 0x17, 0xca, 0x27, 0x8b, 0xa3, 0xb8, 0xf9, 0xb0, 0x89, - 0x8d, 0xf3, 0x91, 0x45, 0x60, 0xb5, 0x30, 0x08, 0x76, 0x15, 0x8a, 0x27, 0x8b, 0x7e, 0xd7, 0x3c, - 0xc8, 0xb0, 0xe6, 0xe0, 0xac, 0x5d, 0x36, 0x0a, 0x39, 0xf7, 0x61, 0x35, 0xbb, 0x0e, 0x8d, 0x92, - 0x69, 0x6a, 0x68, 0x9c, 0x16, 0xd7, 0xfc, 0x5b, 0x8a, 0xeb, 0xee, 0x0e, 0x54, 0xec, 0xcf, 0x14, - 0x56, 0x83, 0xd2, 0xa3, 0xa3, 0x61, 0xef, 0x61, 0x63, 0x85, 0x55, 0xa1, 0x78, 0x38, 0x18, 0x3e, - 0x6c, 0xe4, 0x70, 0x74, 0x34, 0x38, 0xea, 0x35, 0xf2, 0xbb, 0x37, 0x60, 0x35, 0xfb, 0x3b, 0x85, - 0xd5, 0xa1, 0x32, 0x3c, 0x38, 0xea, 0xb6, 0x07, 0xbf, 0x6e, 0xac, 0xb0, 0x55, 0xa8, 0xf6, 0x8f, - 0x86, 0xbd, 0xce, 0x23, 0xde, 0x6b, 0xe4, 0x76, 0x7f, 0x05, 0xb5, 0xe4, 0x55, 0x8f, 0x12, 0xda, - 0xfd, 0xa3, 0x6e, 0x63, 0x85, 0x01, 0x94, 0x87, 0xbd, 0x0e, 0xef, 0xa1, 0xdc, 0x0a, 0x14, 0x86, - 0xc3, 0xc3, 0x46, 0x1e, 0x77, 0xed, 0x1c, 0x74, 0x0e, 0x7b, 0x8d, 0x02, 0x0e, 0x1f, 0x3e, 0x38, - 0xbe, 0x3b, 0x6c, 0x14, 0x77, 0xbf, 0x84, 0x2b, 0x17, 0x5e, 0xce, 0xb4, 0xfa, 0xf0, 0x80, 0xf7, - 0x50, 0x52, 0x1d, 0x2a, 0xc7, 0xbc, 0xff, 0xf8, 0xe0, 0x61, 0xaf, 0x91, 0x43, 0xc6, 0xfd, 0x41, - 0xe7, 0x5e, 0xaf, 0xdb, 0xc8, 0xb7, 0xaf, 0x7d, 0xf7, 0x72, 0x33, 0xf7, 0xfd, 0xcb, 0xcd, 0xdc, - 0x0f, 0x2f, 0x37, 0x73, 0xff, 0x7c, 0xb9, 0x99, 0xfb, 0xf6, 0xd5, 0xe6, 0xca, 0xf7, 0xaf, 0x36, - 0x57, 0x7e, 0x78, 0xb5, 0xb9, 0x72, 0x52, 0xa6, 0x9f, 0x9b, 0x5f, 0xfc, 0x27, 0x00, 0x00, 0xff, - 0xff, 0xa4, 0x50, 0x4f, 0x17, 0x1c, 0x15, 0x00, 0x00, + // 2267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6e, 0x1c, 0xc7, + 0xf1, 0xe7, 0x7e, 0xef, 0xd6, 0x2e, 0xa9, 0xfd, 0xb7, 0x65, 0x7b, 0xcd, 0xbf, 0x42, 0xd2, 0x63, + 0xc7, 0xa0, 0x28, 0x69, 0x09, 0xd0, 0x80, 0x65, 0x18, 0x41, 0x10, 0xee, 0x87, 0xc0, 0xb5, 0x25, + 0x2e, 0xd1, 0x2b, 0xc9, 0xb9, 0x09, 0xc3, 0xd9, 0x26, 0x39, 0xe0, 0xec, 0xf4, 0xa0, 0xa7, 0x57, + 0xe2, 0x5e, 0x72, 0xf0, 0x13, 0x18, 0x08, 0x90, 0x5b, 0x12, 0xe4, 0x1d, 0x72, 0xcd, 0x31, 0x80, + 0x8f, 0x3e, 0xe4, 0x60, 0xe4, 0xe0, 0x04, 0xd2, 0x3d, 0x4f, 0x90, 0x00, 0x41, 0x55, 0xf7, 0x7c, + 0x2c, 0x45, 0x41, 0x12, 0x12, 0xe4, 0x34, 0xdd, 0x55, 0xbf, 0xaa, 0xae, 0xae, 0xaa, 0xae, 0xae, + 0x1e, 0x68, 0xc8, 0x28, 0xee, 0x46, 0x4a, 0x6a, 0xc9, 0x8a, 0xd1, 0xf1, 0xfa, 0x9d, 0x53, 0x5f, + 0x9f, 0xcd, 0x8f, 0xbb, 0x9e, 0x9c, 0xed, 0x9e, 0xca, 0x53, 0xb9, 0x4b, 0xac, 0xe3, 0xf9, 0x09, + 0xcd, 0x68, 0x42, 0x23, 0x23, 0xe2, 0xfc, 0xa1, 0x08, 0xc5, 0x71, 0xc4, 0x3e, 0x84, 0xaa, 0x1f, + 0x46, 0x73, 0x1d, 0x77, 0x0a, 0x5b, 0xa5, 0xed, 0xe6, 0x5e, 0xa3, 0x1b, 0x1d, 0x77, 0x47, 0x48, + 0xe1, 0x96, 0xc1, 0xb6, 0xa0, 0x2c, 0x2e, 0x84, 0xd7, 0x29, 0x6e, 0x15, 0xb6, 0x9b, 0x7b, 0x80, + 0x80, 0xe1, 0x85, 0xf0, 0xc6, 0xd1, 0xc1, 0x0a, 0x27, 0x0e, 0xfb, 0x04, 0xaa, 0xb1, 0x9c, 0x2b, + 0x4f, 0x74, 0x4a, 0x84, 0x69, 0x21, 0x66, 0x42, 0x14, 0x42, 0x59, 0x2e, 0x6a, 0x3a, 0xf1, 0x03, + 0xd1, 0x29, 0x67, 0x9a, 0xee, 0xf9, 0x81, 0xc1, 0x10, 0x87, 0x7d, 0x04, 0x95, 0xe3, 0xb9, 0x1f, + 0x4c, 0x3b, 0x15, 0x82, 0x34, 0x11, 0xd2, 0x43, 0x02, 0x61, 0x0c, 0x8f, 0x6d, 0x43, 0x3d, 0x0a, + 0x5c, 0x7d, 0x22, 0xd5, 0xac, 0x03, 0xd9, 0x82, 0x47, 0x96, 0xc6, 0x53, 0x2e, 0xbb, 0x0b, 0x4d, + 0x4f, 0x86, 0xb1, 0x56, 0xae, 0x1f, 0xea, 0xb8, 0xd3, 0x24, 0xf0, 0xbb, 0x08, 0xfe, 0x5a, 0xaa, + 0x73, 0xa1, 0xfa, 0x19, 0x93, 0xe7, 0x91, 0xbd, 0x32, 0x14, 0x65, 0xe4, 0xfc, 0xa6, 0x00, 0xf5, + 0x44, 0x2b, 0x73, 0xa0, 0xb5, 0xaf, 0xbc, 0x33, 0x5f, 0x0b, 0x4f, 0xcf, 0x95, 0xe8, 0x14, 0xb6, + 0x0a, 0xdb, 0x0d, 0xbe, 0x44, 0x63, 0x6b, 0x50, 0x1c, 0x4f, 0xc8, 0x51, 0x0d, 0x5e, 0x1c, 0x4f, + 0x58, 0x07, 0x6a, 0x8f, 0x5d, 0xe5, 0xbb, 0xa1, 0x26, 0xcf, 0x34, 0x78, 0x32, 0x65, 0x37, 0xa0, + 0x31, 0x9e, 0x3c, 0x16, 0x2a, 0xf6, 0x65, 0x48, 0xfe, 0x68, 0xf0, 0x8c, 0xc0, 0x36, 0x00, 0xc6, + 0x93, 0x7b, 0xc2, 0x45, 0xa5, 0x71, 0xa7, 0xb2, 0x55, 0xda, 0x6e, 0xf0, 0x1c, 0xc5, 0xf9, 0x15, + 0x54, 0x28, 0x46, 0xec, 0x4b, 0xa8, 0x4e, 0xfd, 0x53, 0x11, 0x6b, 0x63, 0x4e, 0x6f, 0xef, 0xbb, + 0x1f, 0x37, 0x57, 0xfe, 0xfa, 0xe3, 0xe6, 0x4e, 0x2e, 0x19, 0x64, 0x24, 0x42, 0x4f, 0x86, 0xda, + 0xf5, 0x43, 0xa1, 0xe2, 0xdd, 0x53, 0x79, 0xc7, 0x88, 0x74, 0x07, 0xf4, 0xe1, 0x56, 0x03, 0xbb, + 0x09, 0x15, 0x3f, 0x9c, 0x8a, 0x0b, 0xb2, 0xbf, 0xd4, 0x7b, 0xc7, 0xaa, 0x6a, 0x8e, 0xe7, 0x3a, + 0x9a, 0xeb, 0x11, 0xb2, 0xb8, 0x41, 0x38, 0xbf, 0x2b, 0x40, 0xd5, 0xe4, 0x00, 0xbb, 0x01, 0xe5, + 0x99, 0xd0, 0x2e, 0xad, 0xdf, 0xdc, 0xab, 0xa3, 0x6f, 0x1f, 0x08, 0xed, 0x72, 0xa2, 0x62, 0x7a, + 0xcd, 0xe4, 0x1c, 0x7d, 0x5f, 0xcc, 0xd2, 0xeb, 0x01, 0x52, 0xb8, 0x65, 0xb0, 0x9f, 0x42, 0x2d, + 0x14, 0xfa, 0x99, 0x54, 0xe7, 0xe4, 0xa3, 0x35, 0x13, 0xf4, 0x43, 0xa1, 0x1f, 0xc8, 0xa9, 0xe0, + 0x09, 0x8f, 0xdd, 0x86, 0x7a, 0x2c, 0xbc, 0xb9, 0xf2, 0xf5, 0x82, 0xfc, 0xb5, 0xb6, 0xd7, 0xa6, + 0x2c, 0xb3, 0x34, 0x02, 0xa7, 0x08, 0xe7, 0xcf, 0x05, 0x28, 0xa3, 0x19, 0x8c, 0x41, 0xd9, 0x55, + 0xa7, 0x26, 0xbb, 0x1b, 0x9c, 0xc6, 0xac, 0x0d, 0x25, 0x11, 0x3e, 0x25, 0x8b, 0x1a, 0x1c, 0x87, + 0x48, 0xf1, 0x9e, 0x4d, 0x6d, 0x8c, 0x70, 0x88, 0x72, 0xf3, 0x58, 0x28, 0x1b, 0x1a, 0x1a, 0xb3, + 0x9b, 0xd0, 0x88, 0x94, 0xbc, 0x58, 0x3c, 0x41, 0xe9, 0x4a, 0x2e, 0xf1, 0x90, 0x38, 0x0c, 0x9f, + 0xf2, 0x7a, 0x64, 0x47, 0x6c, 0x07, 0x40, 0x5c, 0x68, 0xe5, 0x1e, 0xc8, 0x58, 0xc7, 0x9d, 0x2a, + 0xed, 0x9d, 0xf2, 0x1d, 0x09, 0xa3, 0x23, 0x9e, 0xe3, 0xb2, 0x75, 0xa8, 0x9f, 0xc9, 0x58, 0x87, + 0xee, 0x4c, 0x74, 0x6a, 0xb4, 0x5c, 0x3a, 0x77, 0xfe, 0x51, 0x84, 0x0a, 0xb9, 0x8b, 0x6d, 0x63, + 0x74, 0xa2, 0xb9, 0x09, 0x74, 0xa9, 0xc7, 0x6c, 0x74, 0x80, 0xf2, 0x20, 0x0d, 0x0e, 0xe6, 0xc4, + 0x3a, 0x7a, 0x2a, 0x10, 0x9e, 0x96, 0xca, 0xa6, 0x62, 0x3a, 0xc7, 0x6d, 0x4d, 0x31, 0x5b, 0xcc, + 0x4e, 0x69, 0xcc, 0x6e, 0x41, 0x55, 0x52, 0x88, 0x69, 0xb3, 0xaf, 0x08, 0xbc, 0x85, 0xa0, 0x72, + 0x25, 0xdc, 0xa9, 0x0c, 0x83, 0x05, 0xb9, 0xa0, 0xce, 0xd3, 0x39, 0xbb, 0x05, 0x0d, 0x8a, 0xe9, + 0xc3, 0x45, 0x24, 0x3a, 0x55, 0x8a, 0xd1, 0x6a, 0x1a, 0x6f, 0x24, 0xf2, 0x8c, 0x8f, 0x87, 0xd8, + 0x73, 0xbd, 0x33, 0x31, 0x8e, 0x74, 0xe7, 0x7a, 0xe6, 0xcb, 0xbe, 0xa5, 0xf1, 0x94, 0x8b, 0x6a, + 0x63, 0xe1, 0x29, 0xa1, 0x11, 0xfa, 0x2e, 0x41, 0x57, 0x6d, 0xe8, 0x0d, 0x91, 0x67, 0x7c, 0xe6, + 0x40, 0x75, 0x32, 0x39, 0x40, 0xe4, 0x7b, 0x59, 0x91, 0x31, 0x14, 0x6e, 0x39, 0x66, 0x0f, 0xf1, + 0x3c, 0xd0, 0xa3, 0x41, 0xe7, 0x7d, 0xe3, 0xa0, 0x64, 0xee, 0x8c, 0xa0, 0x9e, 0x98, 0x80, 0xa7, + 0x79, 0x34, 0xb0, 0xe7, 0xbc, 0x38, 0x1a, 0xb0, 0x3b, 0x50, 0x8b, 0xcf, 0x5c, 0xe5, 0x87, 0xa7, + 0xe4, 0xd7, 0xb5, 0xbd, 0x77, 0x52, 0x8b, 0x27, 0x86, 0x8e, 0xab, 0x24, 0x18, 0x47, 0x42, 0x23, + 0x35, 0xf1, 0x25, 0x5d, 0x6d, 0x28, 0xcd, 0xfd, 0x29, 0xe9, 0x59, 0xe5, 0x38, 0x44, 0xca, 0xa9, + 0x6f, 0x72, 0x70, 0x95, 0xe3, 0x10, 0x83, 0x35, 0x93, 0x53, 0x53, 0x2e, 0x57, 0x39, 0x8d, 0xd1, + 0x76, 0x19, 0x69, 0x5f, 0x86, 0x6e, 0x90, 0xf8, 0x3f, 0x99, 0x3b, 0x41, 0xb2, 0xf7, 0xff, 0xc9, + 0x6a, 0xbf, 0x2e, 0x40, 0x3d, 0xa9, 0xf1, 0x58, 0xb0, 0xfc, 0xa9, 0x08, 0xb5, 0x7f, 0xe2, 0x0b, + 0x65, 0x17, 0xce, 0x51, 0xd8, 0x1d, 0xa8, 0xb8, 0x5a, 0xab, 0xa4, 0x0c, 0xbc, 0x9f, 0xbf, 0x20, + 0xba, 0xfb, 0xc8, 0x19, 0x86, 0x5a, 0x2d, 0xb8, 0x41, 0xad, 0x7f, 0x0e, 0x90, 0x11, 0xd1, 0xd6, + 0x73, 0xb1, 0xb0, 0x5a, 0x71, 0xc8, 0xae, 0x43, 0xe5, 0xa9, 0x1b, 0xcc, 0x85, 0xcd, 0x6f, 0x33, + 0xf9, 0xa2, 0xf8, 0x79, 0xc1, 0xf9, 0x53, 0x11, 0x6a, 0xf6, 0xc2, 0x60, 0xb7, 0xa1, 0x46, 0x17, + 0x86, 0xb5, 0xe8, 0xea, 0x43, 0x93, 0x40, 0xd8, 0x6e, 0x7a, 0x13, 0xe6, 0x6c, 0xb4, 0xaa, 0xcc, + 0x8d, 0x68, 0x6d, 0xcc, 0xee, 0xc5, 0xd2, 0x54, 0x9c, 0xd8, 0x2b, 0x6f, 0x0d, 0xd1, 0x03, 0x71, + 0xe2, 0x87, 0x3e, 0xfa, 0x87, 0x23, 0x8b, 0xdd, 0x4e, 0x76, 0x5d, 0x26, 0x8d, 0xef, 0xe5, 0x35, + 0xbe, 0xbc, 0xe9, 0x11, 0x34, 0x73, 0xcb, 0x5c, 0xb1, 0xeb, 0x8f, 0xf3, 0xbb, 0xb6, 0x4b, 0x92, + 0x3a, 0x73, 0x5f, 0x67, 0x5e, 0xf8, 0x0f, 0xfc, 0xf7, 0x19, 0x40, 0xa6, 0xf2, 0xcd, 0x8b, 0x8e, + 0xf3, 0x4d, 0x09, 0x60, 0x1c, 0x61, 0xc9, 0x9d, 0xba, 0x54, 0xf7, 0x5b, 0xfe, 0x69, 0x28, 0x95, + 0x78, 0x42, 0xc7, 0x98, 0xe4, 0xeb, 0xbc, 0x69, 0x68, 0x74, 0x62, 0xd8, 0x3e, 0x34, 0xa7, 0x22, + 0xf6, 0x94, 0x4f, 0x09, 0x65, 0x9d, 0xbe, 0x89, 0x7b, 0xca, 0xf4, 0x74, 0x07, 0x19, 0xc2, 0xf8, + 0x2a, 0x2f, 0xc3, 0xf6, 0xa0, 0x25, 0x2e, 0x22, 0xa9, 0xb4, 0x5d, 0xc5, 0xf4, 0x15, 0xd7, 0x4c, + 0x87, 0x82, 0x74, 0x5a, 0x89, 0x37, 0x45, 0x36, 0x61, 0x2e, 0x94, 0x3d, 0x37, 0x32, 0x97, 0x6a, + 0x73, 0xaf, 0x73, 0x69, 0xbd, 0xbe, 0x1b, 0x19, 0xa7, 0xf5, 0x3e, 0xc5, 0xbd, 0x7e, 0xf3, 0xb7, + 0xcd, 0x5b, 0xb9, 0x9b, 0x74, 0x26, 0x8f, 0x17, 0xbb, 0x94, 0x2f, 0xe7, 0xbe, 0xde, 0x9d, 0x6b, + 0x3f, 0xd8, 0x75, 0x23, 0x1f, 0xd5, 0xa1, 0xe0, 0x68, 0xc0, 0x49, 0xf5, 0xfa, 0xcf, 0xa1, 0x7d, + 0xd9, 0xee, 0xb7, 0x89, 0xc1, 0xfa, 0x5d, 0x68, 0xa4, 0x76, 0xbc, 0x4e, 0xb0, 0x9e, 0x0f, 0xde, + 0x1f, 0x0b, 0x50, 0x35, 0xa7, 0x8a, 0xdd, 0x85, 0x46, 0x20, 0x3d, 0x17, 0x0d, 0x48, 0x5a, 0xbb, + 0x0f, 0xb2, 0x43, 0xd7, 0xbd, 0x9f, 0xf0, 0x8c, 0x57, 0x33, 0x2c, 0x26, 0x99, 0x1f, 0x9e, 0xc8, + 0xe4, 0x14, 0xac, 0x65, 0x42, 0xa3, 0xf0, 0x44, 0x72, 0xc3, 0x5c, 0xff, 0x0a, 0xd6, 0x96, 0x55, + 0x5c, 0x61, 0xe7, 0x47, 0xcb, 0xe9, 0x4a, 0x35, 0x3b, 0x15, 0xca, 0x9b, 0x7d, 0x17, 0x1a, 0x29, + 0x9d, 0xed, 0xbc, 0x6c, 0x78, 0x2b, 0x2f, 0x99, 0xb3, 0xd5, 0x09, 0x00, 0x32, 0xd3, 0xb0, 0x58, + 0x61, 0x0f, 0x49, 0xf7, 0xa8, 0x31, 0x23, 0x9d, 0xd3, 0xbd, 0xe7, 0x6a, 0x97, 0x4c, 0x69, 0x71, + 0x1a, 0xb3, 0x2e, 0xc0, 0x34, 0x3d, 0xb0, 0xaf, 0x38, 0xc6, 0x39, 0x84, 0x33, 0x86, 0x7a, 0x62, + 0x04, 0xdb, 0x82, 0x66, 0x6c, 0x57, 0xc6, 0x8e, 0x09, 0x97, 0xab, 0xf0, 0x3c, 0x09, 0x3b, 0x1f, + 0xe5, 0x86, 0xa7, 0x62, 0xa9, 0xf3, 0xe1, 0x48, 0xe1, 0x96, 0xe1, 0x7c, 0x0d, 0x15, 0x22, 0xe0, + 0x31, 0x8b, 0xb5, 0xab, 0xb4, 0x6d, 0xa2, 0x4c, 0x53, 0x21, 0x63, 0x5a, 0xb6, 0x57, 0xc6, 0x44, + 0xe4, 0x06, 0xc0, 0x3e, 0xc6, 0xd6, 0x65, 0x6a, 0x3d, 0x7a, 0x15, 0x0e, 0xd9, 0xce, 0xcf, 0xa0, + 0x9e, 0x90, 0x71, 0xe7, 0xf7, 0xfd, 0x50, 0x58, 0x13, 0x69, 0x8c, 0xcd, 0x67, 0xff, 0xcc, 0x55, + 0xae, 0xa7, 0x85, 0x69, 0x11, 0x2a, 0x3c, 0x23, 0x38, 0x1f, 0x41, 0x33, 0x77, 0x7a, 0x30, 0xdd, + 0x1e, 0x53, 0x18, 0xcd, 0x19, 0x36, 0x13, 0xe7, 0xf7, 0xd8, 0x1a, 0x27, 0xdd, 0xce, 0x4f, 0x00, + 0xce, 0xb4, 0x8e, 0x9e, 0x50, 0xfb, 0x63, 0x7d, 0xdf, 0x40, 0x0a, 0x21, 0xd8, 0x26, 0x34, 0x71, + 0x12, 0x5b, 0xbe, 0xc9, 0x77, 0x92, 0x88, 0x0d, 0xe0, 0xff, 0xa1, 0x71, 0x92, 0x8a, 0x97, 0x6c, + 0xe8, 0x12, 0xe9, 0x0f, 0xa0, 0x1e, 0x4a, 0xcb, 0x33, 0xdd, 0x58, 0x2d, 0x94, 0xa9, 0x9c, 0x1b, + 0x04, 0x96, 0x57, 0x31, 0x72, 0x6e, 0x10, 0x10, 0xd3, 0xb9, 0x05, 0xff, 0xf7, 0x52, 0x93, 0xcf, + 0xde, 0x83, 0xea, 0x89, 0x1f, 0x68, 0xba, 0x11, 0xb0, 0xfb, 0xb3, 0x33, 0xe7, 0x5f, 0x05, 0x80, + 0x2c, 0xec, 0x98, 0xcc, 0x58, 0xda, 0x11, 0xd3, 0x32, 0xa5, 0x3c, 0x80, 0xfa, 0xcc, 0x16, 0x09, + 0x1b, 0xd0, 0x1b, 0xcb, 0xa9, 0xd2, 0x4d, 0x6a, 0x88, 0x29, 0x1f, 0x7b, 0xb6, 0x7c, 0xbc, 0x4d, + 0x23, 0x9e, 0xae, 0x40, 0x5d, 0x4c, 0xfe, 0x41, 0x05, 0xd9, 0x29, 0xe4, 0x96, 0xb3, 0xfe, 0x15, + 0xac, 0x2e, 0x2d, 0xf9, 0x86, 0x17, 0x46, 0x56, 0xec, 0xf2, 0x47, 0xf0, 0x36, 0x54, 0x4d, 0x67, + 0x8a, 0xf9, 0x82, 0x23, 0xab, 0x86, 0xc6, 0xd4, 0x4e, 0x1c, 0x25, 0xcf, 0x9a, 0xd1, 0x91, 0xb3, + 0x07, 0x55, 0xf3, 0x6e, 0x63, 0xdb, 0x50, 0x73, 0x3d, 0x73, 0x56, 0x73, 0xf5, 0x02, 0x99, 0xfb, + 0x44, 0xe6, 0x09, 0xdb, 0xf9, 0x4b, 0x11, 0x20, 0xa3, 0xbf, 0x45, 0x3b, 0xfb, 0x05, 0xac, 0xc5, + 0xc2, 0x93, 0xe1, 0xd4, 0x55, 0x0b, 0xe2, 0xda, 0xf7, 0xc9, 0x55, 0x22, 0x97, 0x90, 0xb9, 0xd6, + 0xb6, 0xf4, 0xfa, 0xd6, 0x76, 0x1b, 0xca, 0x9e, 0x8c, 0x16, 0xf6, 0x16, 0x61, 0xcb, 0x1b, 0xe9, + 0xcb, 0x68, 0x81, 0xaf, 0x54, 0x44, 0xb0, 0x2e, 0x54, 0x67, 0xe7, 0xf4, 0x92, 0x35, 0xaf, 0x80, + 0xeb, 0xcb, 0xd8, 0x07, 0xe7, 0x38, 0xc6, 0x77, 0xaf, 0x41, 0xb1, 0x5b, 0x50, 0x99, 0x9d, 0x4f, + 0x7d, 0x45, 0x4d, 0x71, 0xd3, 0xb4, 0x8d, 0x79, 0xf8, 0xc0, 0x57, 0xf8, 0xba, 0x25, 0x0c, 0x73, + 0xa0, 0xa8, 0x66, 0xf4, 0x10, 0x68, 0x9a, 0x27, 0x4e, 0xce, 0x9b, 0xb3, 0x83, 0x15, 0x5e, 0x54, + 0xb3, 0x5e, 0x1d, 0xaa, 0xc6, 0xaf, 0xce, 0x3f, 0x4b, 0xb0, 0xb6, 0x6c, 0x25, 0xe6, 0x41, 0xac, + 0xbc, 0x24, 0x0f, 0x62, 0xe5, 0xa5, 0x5d, 0x7f, 0x31, 0xd7, 0xf5, 0x3b, 0x50, 0x91, 0xcf, 0x42, + 0xa1, 0xf2, 0x4f, 0xf6, 0xfe, 0x99, 0x7c, 0x16, 0x62, 0x0f, 0x6b, 0x58, 0x4b, 0x2d, 0x61, 0xc5, + 0xb6, 0x84, 0x1f, 0xc3, 0xea, 0x89, 0x0c, 0x02, 0xf9, 0x6c, 0xb2, 0x98, 0x05, 0x7e, 0x78, 0x6e, + 0xfb, 0xc2, 0x65, 0x22, 0xdb, 0x86, 0x6b, 0x53, 0x5f, 0xa1, 0x39, 0x7d, 0x19, 0x6a, 0x11, 0xd2, + 0x23, 0x08, 0x71, 0x97, 0xc9, 0xec, 0x4b, 0xd8, 0x72, 0xb5, 0x16, 0xb3, 0x48, 0x3f, 0x0a, 0x23, + 0xd7, 0x3b, 0x1f, 0x48, 0x8f, 0xce, 0xec, 0x2c, 0x72, 0xb5, 0x7f, 0xec, 0x07, 0xf8, 0xde, 0xab, + 0x91, 0xe8, 0x6b, 0x71, 0xec, 0x13, 0x58, 0xf3, 0x94, 0x70, 0xb5, 0x18, 0x88, 0x58, 0x1f, 0xb9, + 0xfa, 0xac, 0x53, 0x27, 0xc9, 0x4b, 0x54, 0xdc, 0x83, 0x8b, 0xd6, 0x7e, 0xed, 0x07, 0x53, 0xcf, + 0x55, 0xd3, 0x4e, 0xc3, 0xec, 0x61, 0x89, 0xc8, 0xba, 0xc0, 0x88, 0x30, 0x9c, 0x45, 0x7a, 0x91, + 0x42, 0x81, 0xa0, 0x57, 0x70, 0xb0, 0xaa, 0x6a, 0x7f, 0x26, 0x62, 0xed, 0xce, 0x22, 0xfa, 0xd5, + 0x50, 0xe2, 0x19, 0x81, 0xdd, 0x84, 0xb6, 0x1f, 0x7a, 0xc1, 0x7c, 0x2a, 0x9e, 0x44, 0xb8, 0x11, + 0x15, 0xc6, 0x9d, 0x16, 0xd5, 0xa0, 0x6b, 0x96, 0x7e, 0x64, 0xc9, 0x08, 0x15, 0x17, 0x97, 0xa0, + 0xab, 0x06, 0x6a, 0xe9, 0x09, 0xd4, 0xf9, 0xb6, 0x00, 0xed, 0xcb, 0x89, 0x87, 0x61, 0x8b, 0x70, + 0xf3, 0xf6, 0x08, 0xe3, 0x38, 0x0d, 0x65, 0x31, 0x17, 0xca, 0xe4, 0x52, 0x2c, 0xe5, 0x2e, 0xc5, + 0x34, 0x2d, 0xca, 0xaf, 0x4e, 0x8b, 0xa5, 0x8d, 0x56, 0x2e, 0x6d, 0xd4, 0xf9, 0x6d, 0x01, 0xae, + 0x5d, 0x4a, 0xee, 0x37, 0xb6, 0x68, 0x0b, 0x9a, 0x33, 0xf7, 0x5c, 0x1c, 0xb9, 0x8a, 0x52, 0xa6, + 0x64, 0xba, 0xc6, 0x1c, 0xe9, 0xbf, 0x60, 0x5f, 0x08, 0xad, 0xfc, 0x89, 0xba, 0xd2, 0xb6, 0x24, + 0x41, 0x0e, 0xa5, 0xbe, 0x27, 0xe7, 0xf6, 0xc2, 0x4d, 0x12, 0x24, 0x21, 0xbe, 0x9c, 0x46, 0xa5, + 0x2b, 0xd2, 0xc8, 0x39, 0x84, 0x7a, 0x62, 0x20, 0xdb, 0xb4, 0x7f, 0x15, 0x0a, 0xd9, 0xdf, 0xad, + 0x47, 0xb1, 0x50, 0x68, 0xbb, 0xf9, 0xc5, 0xf0, 0x21, 0x54, 0x4e, 0x95, 0x9c, 0x47, 0xb6, 0x62, + 0x2f, 0x21, 0x0c, 0xc7, 0x99, 0x40, 0xcd, 0x52, 0xd8, 0x0e, 0x54, 0x8f, 0x17, 0x87, 0x49, 0xbf, + 0x63, 0xcb, 0x05, 0xce, 0xa7, 0x16, 0x81, 0x35, 0xc8, 0x20, 0xd8, 0x75, 0x28, 0x1f, 0x2f, 0x46, + 0x03, 0xf3, 0x06, 0xc4, 0x4a, 0x86, 0xb3, 0x5e, 0xd5, 0x18, 0xe4, 0xdc, 0x87, 0x56, 0x5e, 0x0e, + 0x9d, 0x92, 0xeb, 0xa3, 0x68, 0x9c, 0x95, 0xec, 0xe2, 0x6b, 0x4a, 0xf6, 0xce, 0x36, 0xd4, 0xec, + 0xff, 0x1b, 0xd6, 0x80, 0xca, 0xa3, 0xc3, 0xc9, 0xf0, 0x61, 0x7b, 0x85, 0xd5, 0xa1, 0x7c, 0x30, + 0x9e, 0x3c, 0x6c, 0x17, 0x70, 0x74, 0x38, 0x3e, 0x1c, 0xb6, 0x8b, 0x3b, 0x37, 0xa1, 0x95, 0xff, + 0x83, 0xc3, 0x9a, 0x50, 0x9b, 0xec, 0x1f, 0x0e, 0x7a, 0xe3, 0x5f, 0xb6, 0x57, 0x58, 0x0b, 0xea, + 0xa3, 0xc3, 0xc9, 0xb0, 0xff, 0x88, 0x0f, 0xdb, 0x85, 0x9d, 0x5f, 0x40, 0x23, 0xfd, 0x91, 0x80, + 0x1a, 0x7a, 0xa3, 0xc3, 0x41, 0x7b, 0x85, 0x01, 0x54, 0x27, 0xc3, 0x3e, 0x1f, 0xa2, 0xde, 0x1a, + 0x94, 0x26, 0x93, 0x83, 0x76, 0x11, 0x57, 0xed, 0xef, 0xf7, 0x0f, 0x86, 0xed, 0x12, 0x0e, 0x1f, + 0x3e, 0x38, 0xba, 0x37, 0x69, 0x97, 0x77, 0x3e, 0x83, 0x6b, 0x97, 0x1e, 0xeb, 0x24, 0x7d, 0xb0, + 0xcf, 0x87, 0xa8, 0xa9, 0x09, 0xb5, 0x23, 0x3e, 0x7a, 0xbc, 0xff, 0x70, 0xd8, 0x2e, 0x20, 0xe3, + 0xfe, 0xb8, 0xff, 0xd5, 0x70, 0xd0, 0x2e, 0xf6, 0x6e, 0x7c, 0xf7, 0x7c, 0xa3, 0xf0, 0xfd, 0xf3, + 0x8d, 0xc2, 0x0f, 0xcf, 0x37, 0x0a, 0x7f, 0x7f, 0xbe, 0x51, 0xf8, 0xf6, 0xc5, 0xc6, 0xca, 0xf7, + 0x2f, 0x36, 0x56, 0x7e, 0x78, 0xb1, 0xb1, 0x72, 0x5c, 0xa5, 0xff, 0xa9, 0x9f, 0xfe, 0x3b, 0x00, + 0x00, 0xff, 0xff, 0x3a, 0xd6, 0xef, 0x88, 0x8f, 0x15, 0x00, 0x00, } func (m *Op) Marshal() (dAtA []byte, err error) { @@ -3726,6 +3755,13 @@ func (m *ProxyEnv) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AllProxy) > 0 { + i -= len(m.AllProxy) + copy(dAtA[i:], m.AllProxy) + i = encodeVarintOps(dAtA, i, uint64(len(m.AllProxy))) + i-- + dAtA[i] = 0x2a + } if len(m.NoProxy) > 0 { i -= len(m.NoProxy) copy(dAtA[i:], m.NoProxy) @@ -4087,6 +4123,24 @@ func (m *FileActionCopy) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ExcludePatterns) > 0 { + for iNdEx := len(m.ExcludePatterns) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExcludePatterns[iNdEx]) + copy(dAtA[i:], m.ExcludePatterns[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.ExcludePatterns[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.IncludePatterns) > 0 { + for iNdEx := len(m.IncludePatterns) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IncludePatterns[iNdEx]) + copy(dAtA[i:], m.IncludePatterns[iNdEx]) + i = encodeVarintOps(dAtA, i, uint64(len(m.IncludePatterns[iNdEx]))) + i-- + dAtA[i] = 0x62 + } + } if m.Timestamp != 0 { i = encodeVarintOps(dAtA, i, uint64(m.Timestamp)) i-- @@ -5061,6 +5115,10 @@ func (m *ProxyEnv) Size() (n int) { if l > 0 { n += 1 + l + sovOps(uint64(l)) } + l = len(m.AllProxy) + if l > 0 { + n += 1 + l + sovOps(uint64(l)) + } return n } @@ -5250,6 +5308,18 @@ func (m *FileActionCopy) Size() (n int) { if m.Timestamp != 0 { n += 1 + sovOps(uint64(m.Timestamp)) } + if len(m.IncludePatterns) > 0 { + for _, s := range m.IncludePatterns { + l = len(s) + n += 1 + l + sovOps(uint64(l)) + } + } + if len(m.ExcludePatterns) > 0 { + for _, s := range m.ExcludePatterns { + l = len(s) + n += 1 + l + sovOps(uint64(l)) + } + } return n } @@ -5678,10 +5748,7 @@ func (m *Op) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -5891,10 +5958,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -5995,10 +6059,7 @@ func (m *Input) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -6156,10 +6217,7 @@ func (m *ExecOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -6439,10 +6497,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -6773,10 +6828,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -6877,10 +6929,7 @@ func (m *CacheOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -7039,10 +7088,7 @@ func (m *SecretOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -7201,10 +7247,7 @@ func (m *SSHOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -7396,7 +7439,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -7413,10 +7456,7 @@ func (m *SourceOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -7597,7 +7637,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -7760,7 +7800,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -7777,10 +7817,7 @@ func (m *BuildOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -7849,10 +7886,7 @@ func (m *BuildInput) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8032,7 +8066,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -8183,7 +8217,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -8200,10 +8234,7 @@ func (m *OpMetadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8365,7 +8396,7 @@ func (m *Source) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -8416,10 +8447,7 @@ func (m *Source) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8503,10 +8531,7 @@ func (m *Locations) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8658,10 +8683,7 @@ func (m *SourceInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8764,10 +8786,7 @@ func (m *Location) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8883,10 +8902,7 @@ func (m *Range) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -8974,10 +8990,7 @@ func (m *Position) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9047,10 +9060,7 @@ func (m *ExportCache) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9222,16 +9232,45 @@ func (m *ProxyEnv) Unmarshal(dAtA []byte) error { } m.NoProxy = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllProxy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOps + } + 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 ErrInvalidLengthOps + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllProxy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOps(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9313,10 +9352,7 @@ func (m *WorkerConstraints) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9510,7 +9546,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > postIndex { @@ -9563,10 +9599,7 @@ func (m *Definition) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9680,10 +9713,7 @@ func (m *HostIP) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -9767,10 +9797,7 @@ func (m *FileOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10017,10 +10044,7 @@ func (m *FileAction) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10322,16 +10346,77 @@ func (m *FileActionCopy) Unmarshal(dAtA []byte) error { break } } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludePatterns", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOps + } + 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 ErrInvalidLengthOps + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncludePatterns = append(m.IncludePatterns, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludePatterns", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOps + } + 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 ErrInvalidLengthOps + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOps + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExcludePatterns = append(m.ExcludePatterns, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOps(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10521,10 +10606,7 @@ func (m *FileActionMkFile) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10700,10 +10782,7 @@ func (m *FileActionMkDir) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10825,10 +10904,7 @@ func (m *FileActionRm) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -10950,10 +11026,7 @@ func (m *ChownOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -11058,10 +11131,7 @@ func (m *UserOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { @@ -11162,10 +11232,7 @@ func (m *NamedUserOpt) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOps } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/solver/pb/ops.proto b/vendor/github.com/moby/buildkit/solver/pb/ops.proto index a975e91565..39983e0eee 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/ops.proto +++ b/vendor/github.com/moby/buildkit/solver/pb/ops.proto @@ -224,6 +224,7 @@ message ProxyEnv { string https_proxy = 2; string ftp_proxy = 3; string no_proxy = 4; + string all_proxy = 5; } // WorkerConstraints defines conditions for the worker @@ -290,6 +291,10 @@ message FileActionCopy { bool allowEmptyWildcard = 10; // optional created time override int64 timestamp = 11; + // include only files/dirs matching at least one of these patterns + repeated string include_patterns = 12; + // exclude files/dir matching any of these patterns (even if they match an include pattern) + repeated string exclude_patterns = 13; } message FileActionMkFile { diff --git a/vendor/github.com/moby/buildkit/util/apicaps/caps.go b/vendor/github.com/moby/buildkit/util/apicaps/caps.go index 9a661b50c9..84a76a81f0 100644 --- a/vendor/github.com/moby/buildkit/util/apicaps/caps.go +++ b/vendor/github.com/moby/buildkit/util/apicaps/caps.go @@ -122,6 +122,13 @@ func (s *CapSet) Supports(id CapID) error { return nil } +// Contains checks if cap set contains cap. Note that unlike Supports() this +// function only checks capability existence in remote set, not if cap has been initialized. +func (s *CapSet) Contains(id CapID) bool { + _, ok := s.set[string(id)] + return ok +} + // CapError is an error for unsupported capability type CapError struct { ID CapID 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 3977e4d6f0..e5768d3751 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 @@ -465,10 +465,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCaps - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCaps } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/moby/buildkit/util/gitutil/git_protocol.go b/vendor/github.com/moby/buildkit/util/gitutil/git_protocol.go new file mode 100644 index 0000000000..3b9df83920 --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/gitutil/git_protocol.go @@ -0,0 +1,46 @@ +package gitutil + +import ( + "strings" + + "github.com/moby/buildkit/util/sshutil" +) + +const ( + HTTPProtocol = iota + 1 + HTTPSProtocol + SSHProtocol + GitProtocol + UnknownProtocol +) + +// ParseProtocol parses a git URL and returns the remote url and protocol type +func ParseProtocol(remote string) (string, int) { + prefixes := map[string]int{ + "http://": HTTPProtocol, + "https://": HTTPSProtocol, + "git://": GitProtocol, + "ssh://": SSHProtocol, + } + protocolType := UnknownProtocol + for prefix, potentialType := range prefixes { + if strings.HasPrefix(remote, prefix) { + remote = strings.TrimPrefix(remote, prefix) + protocolType = potentialType + } + } + + if protocolType == UnknownProtocol && sshutil.IsImplicitSSHTransport(remote) { + protocolType = SSHProtocol + } + + // remove name from ssh + if protocolType == SSHProtocol { + parts := strings.SplitN(remote, "@", 2) + if len(parts) == 2 { + remote = parts[1] + } + } + + return remote, protocolType +} diff --git a/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go b/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go index 78c0f61d40..639e202d27 100644 --- a/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go +++ b/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go @@ -61,7 +61,6 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) { fmt.Fprintf(p.w, "#%d %s\n", v.index, limitString(v.Name, 72)) } else { fmt.Fprintf(p.w, "#%d %s\n", v.index, v.Name) - fmt.Fprintf(p.w, "#%d %s\n", v.index, v.Digest) } } diff --git a/vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go b/vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go index f00a1df223..c50a2cc7f9 100644 --- a/vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go +++ b/vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go @@ -6,6 +6,6 @@ import ( var gitSSHRegex = regexp.MustCompile("^[a-zA-Z0-9-_]+@[a-zA-Z0-9-.]+:.*$") -func IsSSHTransport(s string) bool { +func IsImplicitSSHTransport(s string) bool { return gitSSHRegex.MatchString(s) } diff --git a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go index cefb30a8f5..df55582db4 100644 --- a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go +++ b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go @@ -151,7 +151,9 @@ func init() { proto.RegisterType((*Frame)(nil), "stack.Frame") } -func init() { proto.RegisterFile("stack.proto", fileDescriptor_b44c07feb2ca0a5a) } +func init() { + proto.RegisterFile("stack.proto", fileDescriptor_b44c07feb2ca0a5a) +} var fileDescriptor_b44c07feb2ca0a5a = []byte{ // 185 bytes of a gzipped FileDescriptorProto