Merge pull request #40600 from AkihiroSuda/vendor-20200228

vendor containerd, BuildKit, protobuf, grpc, and golang.org/x
This commit is contained in:
Sebastiaan van Stijn 2020-03-05 23:37:18 +01:00 committed by GitHub
commit cc2d166cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
591 changed files with 50669 additions and 20387 deletions

View file

@ -393,7 +393,7 @@ func (s *snapshotter) View(ctx context.Context, key, parent string, opts ...snap
return s.Mounts(ctx, parent) return s.Mounts(ctx, parent)
} }
func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error { func (s *snapshotter) Walk(context.Context, snapshots.WalkFunc, ...string) error {
return errors.Errorf("not-implemented") return errors.Errorf("not-implemented")
} }

View file

@ -162,7 +162,7 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) {
return nil, errors.Errorf("snapshotter doesn't support differ") return nil, errors.Errorf("snapshotter doesn't support differ")
} }
p, err := parsePlatforms(binfmt_misc.SupportedPlatforms()) p, err := parsePlatforms(binfmt_misc.SupportedPlatforms(true))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -38,6 +38,7 @@ import (
"github.com/moby/buildkit/source/git" "github.com/moby/buildkit/source/git"
"github.com/moby/buildkit/source/http" "github.com/moby/buildkit/source/http"
"github.com/moby/buildkit/source/local" "github.com/moby/buildkit/source/local"
"github.com/moby/buildkit/util/binfmt_misc"
"github.com/moby/buildkit/util/contentutil" "github.com/moby/buildkit/util/contentutil"
"github.com/moby/buildkit/util/progress" "github.com/moby/buildkit/util/progress"
digest "github.com/opencontainers/go-digest" digest "github.com/opencontainers/go-digest"
@ -139,7 +140,19 @@ func (w *Worker) Labels() map[string]string {
} }
// Platforms returns one or more platforms supported by the image. // Platforms returns one or more platforms supported by the image.
func (w *Worker) Platforms() []ocispec.Platform { func (w *Worker) Platforms(noCache bool) []ocispec.Platform {
if noCache {
pm := make(map[string]struct{}, len(w.Opt.Platforms))
for _, p := range w.Opt.Platforms {
pm[platforms.Format(p)] = struct{}{}
}
for _, p := range binfmt_misc.SupportedPlatforms(noCache) {
if _, ok := pm[p]; !ok {
pp, _ := platforms.Parse(p)
w.Opt.Platforms = append(w.Opt.Platforms, pp)
}
}
}
if len(w.Opt.Platforms) == 0 { if len(w.Opt.Platforms) == 0 {
return []ocispec.Platform{platforms.DefaultSpec()} return []ocispec.Platform{platforms.DefaultSpec()}
} }

View file

@ -1,6 +1,6 @@
package main package main
import systemdDaemon "github.com/coreos/go-systemd/daemon" import systemdDaemon "github.com/coreos/go-systemd/v22/daemon"
// preNotifySystem sends a message to the host when the API is active, but before the daemon is // preNotifySystem sends a message to the host when the API is active, but before the daemon is
func preNotifySystem() { func preNotifySystem() {

View file

@ -22,6 +22,7 @@ import (
"github.com/docker/docker/pkg/fileutils" "github.com/docker/docker/pkg/fileutils"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"github.com/containerd/containerd" "github.com/containerd/containerd"
"github.com/containerd/containerd/defaults" "github.com/containerd/containerd/defaults"
@ -887,6 +888,11 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
} }
registerMetricsPluginCallback(d.PluginStore, metricsSockPath) registerMetricsPluginCallback(d.PluginStore, metricsSockPath)
backoffConfig := backoff.DefaultConfig
backoffConfig.MaxDelay = 3 * time.Second
connParams := grpc.ConnectParams{
Backoff: backoffConfig,
}
gopts := []grpc.DialOption{ gopts := []grpc.DialOption{
// WithBlock makes sure that the following containerd request // WithBlock makes sure that the following containerd request
// is reliable. // is reliable.
@ -907,7 +913,7 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
grpc.WithBlock(), grpc.WithBlock(),
grpc.WithInsecure(), grpc.WithInsecure(),
grpc.WithBackoffMaxDelay(3 * time.Second), grpc.WithConnectParams(connParams),
grpc.WithContextDialer(dialer.ContextDialer), grpc.WithContextDialer(dialer.ContextDialer),
// TODO(stevvooe): We may need to allow configuration of this on the client. // TODO(stevvooe): We may need to allow configuration of this on the client.

View file

@ -7,7 +7,7 @@ import (
"os" "os"
"strconv" "strconv"
"github.com/coreos/go-systemd/activation" "github.com/coreos/go-systemd/v22/activation"
"github.com/docker/docker/pkg/homedir" "github.com/docker/docker/pkg/homedir"
"github.com/docker/go-connections/sockets" "github.com/docker/go-connections/sockets"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View file

@ -9,7 +9,7 @@ import (
"sync" "sync"
"unicode" "unicode"
"github.com/coreos/go-systemd/journal" "github.com/coreos/go-systemd/v22/journal"
"github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger"
"github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/daemon/logger/loggerutils"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View file

@ -109,7 +109,7 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/coreos/go-systemd/journal" "github.com/coreos/go-systemd/v22/journal"
"github.com/docker/docker/api/types/backend" "github.com/docker/docker/api/types/backend"
"github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View file

@ -12,22 +12,22 @@ github.com/konsorten/go-windows-terminal-sequences f55edac94c9bbba5d6182a4be46d
github.com/mattn/go-shellwords 36a9b3c57cb5caa559ff63fb7e9b585f1c00df75 # v1.0.6 github.com/mattn/go-shellwords 36a9b3c57cb5caa559ff63fb7e9b585f1c00df75 # v1.0.6
github.com/sirupsen/logrus 839c75faf7f98a33d445d181f3018b5c3409a45e # v1.4.2 github.com/sirupsen/logrus 839c75faf7f98a33d445d181f3018b5c3409a45e # v1.4.2
github.com/tchap/go-patricia a7f0089c6f496e8e70402f61733606daa326cac5 # v2.3.0 github.com/tchap/go-patricia a7f0089c6f496e8e70402f61733606daa326cac5 # v2.3.0
golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3 golang.org/x/net 0de0cce0169b09b364e001f108dc0399ea8630b3
golang.org/x/sys 6d18c012aee9febd81bbf9806760c8c4480e870d golang.org/x/sys d5e6a3e2c0ae16fc7480523ebcb7fd4dd3215489
github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0
github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0
golang.org/x/text f21a4dfb5e38f5895301dc265a8def02365cc3d0 # v0.3.0 golang.org/x/text 342b2e1fbaa52c93f31447ad2c6abc048c63e475 # v0.3.2
gotest.tools/v3 bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2 gotest.tools/v3 bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2
github.com/google/go-cmp 3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0 github.com/google/go-cmp 3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0
github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2 github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2
github.com/RackSec/srslog a4725f04ec91af1a91b380da679d6e0c2f061e59 github.com/RackSec/srslog a4725f04ec91af1a91b380da679d6e0c2f061e59
github.com/imdario/mergo 1afb36080aec31e0d1528973ebe6721b191b0369 # v0.3.8 github.com/imdario/mergo 1afb36080aec31e0d1528973ebe6721b191b0369 # v0.3.8
golang.org/x/sync e225da77a7e68af35c70ccbf71af2b83e6acac3c golang.org/x/sync cd5d95a43a6e21273425c7ae415d3df9ea832eeb
# buildkit # buildkit
github.com/moby/buildkit d75ed2b682485d4e4a35e46531230111424f8a65 github.com/moby/buildkit 4d8d91bf49c769b8458e9aa84746c842b4a0e39a
github.com/tonistiigi/fsutil 6c909ab392c173a4264ae1bfcbc0450b9aac0c7d github.com/tonistiigi/fsutil 013a9fe6aee2d1658457075bf9e688bc8c0be2e0
github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746 github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7 github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7
github.com/google/shlex e7afc7fbc51079733e9468cdfd1efcd7d196cd1d github.com/google/shlex e7afc7fbc51079733e9468cdfd1efcd7d196cd1d
@ -73,7 +73,7 @@ github.com/opencontainers/go-digest 279bed98673dd5bef374d3b6e4b0
# get go-zfs packages # get go-zfs packages
github.com/mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb github.com/mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb
google.golang.org/grpc 39e8a7b072a67ca2a75f57fa2e0d50995f5b22f6 # v1.23.1 google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1
# The version of runc should match the version that is used by the containerd # The version of runc should match the version that is used by the containerd
# version that is used. If you need to update runc, open a pull request in # version that is used. If you need to update runc, open a pull request in
@ -86,7 +86,11 @@ github.com/opencontainers/image-spec d60099175f88c47cd379c4738d15
github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1 github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1
# systemd integration (journald, daemon/listeners, containerd/cgroups) # 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
# go-systemd v17 is required by github.com/coreos/pkg/capnslog/journald_formatter.go
github.com/coreos/go-systemd 39ca1b05acc7ad1220e09f133283b8859a8b71ab # v17 github.com/coreos/go-systemd 39ca1b05acc7ad1220e09f133283b8859a8b71ab # v17
# dbus v4 is needed by libnetwork (until https://github.com/docker/libnetwork/pull/2518 gets merged)
github.com/godbus/dbus 5f6efc7ef2759c81b7ba876593971bfce311eab3 # v4.0.0 github.com/godbus/dbus 5f6efc7ef2759c81b7ba876593971bfce311eab3 # v4.0.0
# gelf logging driver deps # gelf logging driver deps
@ -108,33 +112,33 @@ github.com/jmespath/go-jmespath c2b33e8439af944379acbdd9c3a5
github.com/bsphere/le_go 7a984a84b5492ae539b79b62fb4a10afc63c7bcf github.com/bsphere/le_go 7a984a84b5492ae539b79b62fb4a10afc63c7bcf
# gcplogs deps # gcplogs deps
golang.org/x/oauth2 ec22f46f877b4505e0117eeaab541714644fdd28 golang.org/x/oauth2 bf48bf16ab8d622ce64ec6ce98d2c98f916b6303
google.golang.org/api de943baf05a022a8f921b544b7827bacaba1aed5 google.golang.org/api de943baf05a022a8f921b544b7827bacaba1aed5
go.opencensus.io c3ed530f775d85e577ca652cb052a52c078aad26 # v0.11.0 go.opencensus.io c3ed530f775d85e577ca652cb052a52c078aad26 # v0.11.0
cloud.google.com/go 0fd7230b2a7505833d5f69b75cbd6c9582401479 # v0.23.0 cloud.google.com/go 0fd7230b2a7505833d5f69b75cbd6c9582401479 # v0.23.0
github.com/googleapis/gax-go 317e0006254c44a0ac427cc52a0e083ff0b9622f # v2.0.0 github.com/googleapis/gax-go 317e0006254c44a0ac427cc52a0e083ff0b9622f # v2.0.0
google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9 google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8
# containerd # containerd
github.com/containerd/containerd acdcf13d5eaf0dfe0eaeabe7194a82535549bc2b github.com/containerd/containerd 4d242818bf55542e5d7876ca276fea83029e803c
github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13 github.com/containerd/fifo ff969a566b00877c63489baf6e8c35d60af6142c
github.com/containerd/continuity 26c1120b8d4107d2471b93ad78ef7ce1fc84c4c4 github.com/containerd/continuity 26c1120b8d4107d2471b93ad78ef7ce1fc84c4c4
github.com/containerd/cgroups 5fbad35c2a7e855762d3c60f2e474ffcad0d470a github.com/containerd/cgroups 44306b6a1d46985d916b48b4199f93a378af314f
github.com/containerd/console 0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f github.com/containerd/console 8375c3424e4d7b114e8a90a4a40c8e1b40d1d4e6
github.com/containerd/go-runc a2952bc25f5116103a8b78f3817f6df759aa7def github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
github.com/containerd/typeurl 2a93cfde8c20b23de8eb84a5adbc234ddf7a9e8d github.com/containerd/typeurl b45ef1f1f737e10bd45b25b669df25f0da8b9ba0
github.com/containerd/ttrpc 92c8520ef9f86600c650dd540266a007bf03670f github.com/containerd/ttrpc 0be804eadb152bc3b3c20c5edc314c4633833398
github.com/gogo/googleapis d31c731455cb061f42baff3bda55bad0118b126b # v1.2.0 github.com/gogo/googleapis 01e0f9cca9b92166042241267ee2a5cdf5cff46c # v1.3.2
# cluster # cluster
github.com/docker/swarmkit 49e35619b18200845c9365c1e953440c28868002 github.com/docker/swarmkit 49e35619b18200845c9365c1e953440c28868002
github.com/gogo/protobuf ba06b47c162d49f2af050fb4c75bcbc86a159d5c # v1.2.1 github.com/gogo/protobuf 5628607bb4c51c3157aacc3a50f0ab707582b805 # v1.3.1
github.com/golang/protobuf aa810b61a9c79d51363740d207bb46cf8e620ed5 # v1.2.0 github.com/golang/protobuf d23c5127dc24889085f8ccea5c9d560a57a879d8 # v1.3.3
github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2 github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2
github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736
github.com/google/certificate-transparency-go 37a384cd035e722ea46e55029093e26687138edf # v1.0.20 github.com/google/certificate-transparency-go 37a384cd035e722ea46e55029093e26687138edf # v1.0.20
golang.org/x/crypto 1d94cc7ab1c630336ab82ccb9c9cda72a875c382 golang.org/x/crypto 2aa609cf4a9d7d1126360de73b55b6002f9e052a
golang.org/x/time fbb02b2291d28baffd63558aa44b4b56f178d650 golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82
github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad
github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git 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/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3

View file

@ -112,6 +112,10 @@ err := control.MoveTo(destination)
subCgroup, err := control.New("child", resources) subCgroup, err := control.New("child", resources)
``` ```
### Attention
All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name
## Project details ## Project details
Cgroups is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). Cgroups is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).

View file

@ -67,6 +67,7 @@ func New(hierarchy Hierarchy, path Path, resources *specs.LinuxResources, opts .
} }
// Load will load an existing cgroup and allow it to be controlled // Load will load an existing cgroup and allow it to be controlled
// All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name
func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error) { func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error) {
config := newInitConfig() config := newInitConfig()
for _, o := range opts { for _, o := range opts {

View file

@ -1,13 +1,19 @@
module github.com/containerd/cgroups module github.com/containerd/cgroups
go 1.12 go 1.13
require ( require (
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3
github.com/coreos/go-systemd/v22 v22.0.0
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/docker/go-units v0.4.0 github.com/docker/go-units v0.4.0
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e github.com/godbus/dbus/v5 v5.0.3
github.com/gogo/protobuf v1.2.1 github.com/gogo/protobuf v1.3.1
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700 github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700
github.com/pkg/errors v0.8.1 github.com/pkg/errors v0.9.1
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.2.2
github.com/urfave/cli v1.22.2
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479
) )

View file

@ -22,8 +22,8 @@ import (
"strings" "strings"
"sync" "sync"
systemdDbus "github.com/coreos/go-systemd/dbus" systemdDbus "github.com/coreos/go-systemd/v22/dbus"
"github.com/godbus/dbus" "github.com/godbus/dbus/v5"
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
) )

View file

@ -25,13 +25,59 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync"
"time" "time"
units "github.com/docker/go-units" units "github.com/docker/go-units"
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/sys/unix"
) )
var isUserNS = runningInUserNS() var (
isUserNS = runningInUserNS()
checkMode sync.Once
cgMode CGMode
)
const unifiedMountpoint = "/sys/fs/cgroup"
// CGMode is the cgroups mode of the host system
type CGMode int
const (
// Unavailable cgroup mountpoint
Unavailable CGMode = iota
// Legacy cgroups v1
Legacy
// Hybrid with cgroups v1 and v2 controllers mounted
Hybrid
// Unified with only cgroups v2 mounted
Unified
)
// Mode returns the cgroups mode running on the host
func Mode() CGMode {
checkMode.Do(func() {
var st unix.Statfs_t
if err := unix.Statfs(unifiedMountpoint, &st); err != nil {
cgMode = Unavailable
return
}
switch st.Type {
case unix.CGROUP2_SUPER_MAGIC:
cgMode = Unified
default:
cgMode = Legacy
if err := unix.Statfs(filepath.Join(unifiedMountpoint, "unified"), &st); err != nil {
return
}
if st.Type == unix.CGROUP2_SUPER_MAGIC {
cgMode = Hybrid
}
}
})
return cgMode
}
// runningInUserNS detects whether we are currently running in a user namespace. // runningInUserNS detects whether we are currently running in a user namespace.
// Copied from github.com/lxc/lxd/shared/util.go // Copied from github.com/lxc/lxd/shared/util.go

View file

@ -24,10 +24,17 @@ import (
var ErrNotAConsole = errors.New("provided file is not a console") var ErrNotAConsole = errors.New("provided file is not a console")
type File interface {
io.ReadWriteCloser
// Fd returns its file descriptor
Fd() uintptr
// Name returns its file name
Name() string
}
type Console interface { type Console interface {
io.Reader File
io.Writer
io.Closer
// Resize resizes the console to the provided window size // Resize resizes the console to the provided window size
Resize(WinSize) error Resize(WinSize) error
@ -42,10 +49,6 @@ type Console interface {
Reset() error Reset() error
// Size returns the window size of the console // Size returns the window size of the console
Size() (WinSize, error) Size() (WinSize, error)
// Fd returns the console's file descriptor
Fd() uintptr
// Name returns the console's file name
Name() string
} }
// WinSize specifies the window size of the console // WinSize specifies the window size of the console
@ -70,7 +73,7 @@ func Current() Console {
} }
// ConsoleFromFile returns a console using the provided file // ConsoleFromFile returns a console using the provided file
func ConsoleFromFile(f *os.File) (Console, error) { func ConsoleFromFile(f File) (Console, error) {
if err := checkConsole(f); err != nil { if err := checkConsole(f); err != nil {
return nil, err return nil, err
} }

View file

@ -58,6 +58,7 @@ type Epoller struct {
efd int efd int
mu sync.Mutex mu sync.Mutex
fdMapping map[int]*EpollConsole fdMapping map[int]*EpollConsole
closeOnce sync.Once
} }
// NewEpoller returns an instance of epoller with a valid epoll fd. // NewEpoller returns an instance of epoller with a valid epoll fd.
@ -151,7 +152,11 @@ func (e *Epoller) getConsole(sysfd int) *EpollConsole {
// Close closes the epoll fd // Close closes the epoll fd
func (e *Epoller) Close() error { func (e *Epoller) Close() error {
return unix.Close(e.efd) closeErr := os.ErrClosed // default to "file already closed"
e.closeOnce.Do(func() {
closeErr = unix.Close(e.efd)
})
return closeErr
} }
// EpollConsole acts like a console but registers its file descriptor with an // EpollConsole acts like a console but registers its file descriptor with an

View file

@ -47,7 +47,7 @@ func NewPty() (Console, string, error) {
} }
type master struct { type master struct {
f *os.File f File
original *unix.Termios original *unix.Termios
} }
@ -122,7 +122,7 @@ func (m *master) Name() string {
} }
// checkConsole checks if the provided file is a console // checkConsole checks if the provided file is a console
func checkConsole(f *os.File) error { func checkConsole(f File) error {
var termios unix.Termios var termios unix.Termios
if tcget(f.Fd(), &termios) != nil { if tcget(f.Fd(), &termios) != nil {
return ErrNotAConsole return ErrNotAConsole
@ -130,7 +130,7 @@ func checkConsole(f *os.File) error {
return nil return nil
} }
func newMaster(f *os.File) (Console, error) { func newMaster(f File) (Console, error) {
m := &master{ m := &master{
f: f, f: f,
} }

View file

@ -198,7 +198,7 @@ func makeInputRaw(fd windows.Handle, mode uint32) error {
return nil return nil
} }
func checkConsole(f *os.File) error { func checkConsole(f File) error {
var mode uint32 var mode uint32
if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil { if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {
return err return err
@ -206,7 +206,7 @@ func checkConsole(f *os.File) error {
return nil return nil
} }
func newMaster(f *os.File) (Console, error) { func newMaster(f File) (Console, error) {
if f != os.Stdin && f != os.Stdout && f != os.Stderr { if f != os.Stdin && f != os.Stdout && f != os.Stderr {
return nil, errors.New("creating a console from a file is not supported on windows") return nil, errors.New("creating a console from a file is not supported on windows")
} }

8
vendor/github.com/containerd/console/go.mod generated vendored Normal file
View file

@ -0,0 +1,8 @@
module github.com/containerd/console
go 1.13
require (
github.com/pkg/errors v0.8.1
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
)

View file

@ -3,6 +3,7 @@
[![GoDoc](https://godoc.org/github.com/containerd/containerd?status.svg)](https://godoc.org/github.com/containerd/containerd) [![GoDoc](https://godoc.org/github.com/containerd/containerd?status.svg)](https://godoc.org/github.com/containerd/containerd)
[![Build Status](https://travis-ci.org/containerd/containerd.svg?branch=master)](https://travis-ci.org/containerd/containerd) [![Build Status](https://travis-ci.org/containerd/containerd.svg?branch=master)](https://travis-ci.org/containerd/containerd)
[![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) [![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)
![](https://github.com/containerd/containerd/workflows/Nightly/badge.svg)
[![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) [![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) [![Go Report Card](https://goreportcard.com/badge/github.com/containerd/containerd)](https://goreportcard.com/report/github.com/containerd/containerd)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1271/badge)](https://bestpractices.coreinfrastructure.org/projects/1271) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1271/badge)](https://bestpractices.coreinfrastructure.org/projects/1271)
@ -24,6 +25,12 @@ See how to build containerd from source at [BUILDING](BUILDING.md).
If you are interested in trying out containerd see our example at [Getting Started](docs/getting-started.md). If you are interested in trying out containerd see our example at [Getting Started](docs/getting-started.md).
## Nightly builds
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.
## Runtime Requirements ## Runtime Requirements
@ -220,23 +227,23 @@ architectures, such as [Canonical's Ubuntu packaging](https://launchpad.net/ubun
#### Enabling command auto-completion #### Enabling command auto-completion
Starting with containerd 1.4, the urfave client feature for auto-creation of bash Starting with containerd 1.4, the urfave client feature for auto-creation of bash and zsh
autocompletion data is enabled. To use the autocomplete feature in your shell, source autocompletion data is enabled. To use the autocomplete feature in a bash shell for example, source
the autocomplete/bash_autocomplete file in your .bashrc file while setting the `PROG` the autocomplete/ctr file in your `.bashrc`, or manually like:
variable to `ctr`:
``` ```
$ PROG=ctr source vendor/github.com/urfave/cli/autocomplete/bash_autocomplete $ source ./contrib/autocomplete/ctr
``` ```
#### Distribution of `ctr` autocomplete for bash #### Distribution of `ctr` autocomplete for bash and zsh
Copy `vendor/github.com/urfave/cli/autocomplete/bash_autocomplete` into For bash, copy the `contrib/autocomplete/ctr` script into
`/etc/bash_completion.d/` and rename it to `ctr`. `/etc/bash_completion.d/` and rename it to `ctr`. The `zsh_autocomplete`
file is also available and can be used similarly for zsh users.
Provide documentation to users to `source` this file into their shell if 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 you don't place the autocomplete file in a location where it is automatically
loaded for user's bash shell environment. loaded for the user's shell environment.
### Communication ### Communication
@ -258,7 +265,7 @@ __If you are reporting a security issue, please reach out discreetly at security
## Licenses ## Licenses
The containerd codebase is released under the [Apache 2.0 license](LICENSE.code). The containerd codebase is released under the [Apache 2.0 license](LICENSE).
The README.md file, and files in the "docs" folder are licensed under the The README.md file, and files in the "docs" folder are licensed under the
Creative Commons Attribution 4.0 International License. You may obtain a Creative Commons Attribution 4.0 International License. You may obtain a
copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/. copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.

View file

@ -11,6 +11,7 @@ import (
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -24,7 +25,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ContainerCreate struct { type ContainerCreate struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
@ -48,7 +49,7 @@ func (m *ContainerCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_ContainerCreate.Marshal(b, m, deterministic) return xxx_messageInfo_ContainerCreate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -88,7 +89,7 @@ func (m *ContainerCreate_Runtime) XXX_Marshal(b []byte, deterministic bool) ([]b
return xxx_messageInfo_ContainerCreate_Runtime.Marshal(b, m, deterministic) return xxx_messageInfo_ContainerCreate_Runtime.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -130,7 +131,7 @@ func (m *ContainerUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_ContainerUpdate.Marshal(b, m, deterministic) return xxx_messageInfo_ContainerUpdate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -169,7 +170,7 @@ func (m *ContainerDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_ContainerDelete.Marshal(b, m, deterministic) return xxx_messageInfo_ContainerDelete.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -325,7 +326,7 @@ func (m *ContainerDelete) Field(fieldpath []string) (string, bool) {
func (m *ContainerCreate) Marshal() (dAtA []byte, err error) { func (m *ContainerCreate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -333,42 +334,52 @@ func (m *ContainerCreate) Marshal() (dAtA []byte, err error) {
} }
func (m *ContainerCreate) MarshalTo(dAtA []byte) (int, error) { func (m *ContainerCreate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ContainerCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if len(m.Image) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
i += copy(dAtA[i:], m.Image)
} }
if m.Runtime != nil { if m.Runtime != nil {
dAtA[i] = 0x1a {
i++ size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintContainer(dAtA, i, uint64(m.Runtime.Size())) if err != nil {
n1, err := m.Runtime.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintContainer(dAtA, i, uint64(size))
} }
i += n1 i--
dAtA[i] = 0x1a
} }
if m.XXX_unrecognized != nil { if len(m.Image) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Image)
copy(dAtA[i:], m.Image)
i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
i--
dAtA[i] = 0x12
} }
return i, nil if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ContainerCreate_Runtime) Marshal() (dAtA []byte, err error) { func (m *ContainerCreate_Runtime) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -376,36 +387,45 @@ func (m *ContainerCreate_Runtime) Marshal() (dAtA []byte, err error) {
} }
func (m *ContainerCreate_Runtime) MarshalTo(dAtA []byte) (int, error) { func (m *ContainerCreate_Runtime) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ContainerCreate_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintContainer(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if m.Options != nil { if m.Options != nil {
dAtA[i] = 0x12 {
i++ size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintContainer(dAtA, i, uint64(m.Options.Size())) if err != nil {
n2, err := m.Options.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintContainer(dAtA, i, uint64(size))
} }
i += n2 i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintContainer(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ContainerUpdate) Marshal() (dAtA []byte, err error) { func (m *ContainerUpdate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -413,55 +433,66 @@ func (m *ContainerUpdate) Marshal() (dAtA []byte, err error) {
} }
func (m *ContainerUpdate) MarshalTo(dAtA []byte) (int, error) { func (m *ContainerUpdate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ContainerUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if len(m.Image) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
i += copy(dAtA[i:], m.Image)
}
if len(m.Labels) > 0 {
for k, _ := range m.Labels {
dAtA[i] = 0x1a
i++
v := m.Labels[k]
mapSize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v)))
i = encodeVarintContainer(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintContainer(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintContainer(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
}
} }
if len(m.SnapshotKey) > 0 { if len(m.SnapshotKey) > 0 {
dAtA[i] = 0x22 i -= len(m.SnapshotKey)
i++ copy(dAtA[i:], m.SnapshotKey)
i = encodeVarintContainer(dAtA, i, uint64(len(m.SnapshotKey))) i = encodeVarintContainer(dAtA, i, uint64(len(m.SnapshotKey)))
i += copy(dAtA[i:], m.SnapshotKey) i--
dAtA[i] = 0x22
} }
if m.XXX_unrecognized != nil { if len(m.Labels) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) for k := range m.Labels {
v := m.Labels[k]
baseI := i
i -= len(v)
copy(dAtA[i:], v)
i = encodeVarintContainer(dAtA, i, uint64(len(v)))
i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintContainer(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintContainer(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x1a
}
} }
return i, nil if len(m.Image) > 0 {
i -= len(m.Image)
copy(dAtA[i:], m.Image)
i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
i--
dAtA[i] = 0x12
}
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ContainerDelete) Marshal() (dAtA []byte, err error) { func (m *ContainerDelete) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -469,30 +500,39 @@ func (m *ContainerDelete) Marshal() (dAtA []byte, err error) {
} }
func (m *ContainerDelete) MarshalTo(dAtA []byte) (int, error) { func (m *ContainerDelete) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ContainerDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintContainer(dAtA []byte, offset int, v uint64) int { func encodeVarintContainer(dAtA []byte, offset int, v uint64) int {
offset -= sovContainer(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *ContainerCreate) Size() (n int) { func (m *ContainerCreate) Size() (n int) {
if m == nil { if m == nil {
@ -587,14 +627,7 @@ func (m *ContainerDelete) Size() (n int) {
} }
func sovContainer(x uint64) (n int) { func sovContainer(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozContainer(x uint64) (n int) { func sozContainer(x uint64) (n int) {
return sovContainer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovContainer(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1309,6 +1342,7 @@ func (m *ContainerDelete) Unmarshal(dAtA []byte) error {
func skipContainer(dAtA []byte) (n int, err error) { func skipContainer(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1340,10 +1374,8 @@ func skipContainer(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1364,55 +1396,30 @@ func skipContainer(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthContainer return 0, ErrInvalidLengthContainer
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthContainer
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowContainer
}
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 := skipContainer(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthContainer
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupContainer
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthContainer
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthContainer = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthContainer = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowContainer = fmt.Errorf("proto: integer overflow") ErrIntOverflowContainer = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupContainer = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -9,6 +9,7 @@ import (
github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -22,7 +23,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ContentDelete struct { type ContentDelete struct {
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"` Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
@ -44,7 +45,7 @@ func (m *ContentDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_ContentDelete.Marshal(b, m, deterministic) return xxx_messageInfo_ContentDelete.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -106,7 +107,7 @@ func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
func (m *ContentDelete) Marshal() (dAtA []byte, err error) { func (m *ContentDelete) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -114,30 +115,39 @@ func (m *ContentDelete) Marshal() (dAtA []byte, err error) {
} }
func (m *ContentDelete) MarshalTo(dAtA []byte) (int, error) { func (m *ContentDelete) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ContentDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Digest) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
i += copy(dAtA[i:], m.Digest)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Digest) > 0 {
i -= len(m.Digest)
copy(dAtA[i:], m.Digest)
i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintContent(dAtA []byte, offset int, v uint64) int { func encodeVarintContent(dAtA []byte, offset int, v uint64) int {
offset -= sovContent(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *ContentDelete) Size() (n int) { func (m *ContentDelete) Size() (n int) {
if m == nil { if m == nil {
@ -156,14 +166,7 @@ func (m *ContentDelete) Size() (n int) {
} }
func sovContent(x uint64) (n int) { func sovContent(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozContent(x uint64) (n int) { func sozContent(x uint64) (n int) {
return sovContent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovContent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -276,6 +279,7 @@ func (m *ContentDelete) Unmarshal(dAtA []byte) error {
func skipContent(dAtA []byte) (n int, err error) { func skipContent(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -307,10 +311,8 @@ func skipContent(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -331,55 +333,30 @@ func skipContent(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthContent return 0, ErrInvalidLengthContent
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthContent
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowContent
}
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 := skipContent(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthContent
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupContent
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthContent
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthContent = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthContent = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowContent = fmt.Errorf("proto: integer overflow") ErrIntOverflowContent = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupContent = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -9,6 +9,7 @@ import (
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -22,7 +23,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ImageCreate struct { type ImageCreate struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@ -45,7 +46,7 @@ func (m *ImageCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ImageCreate.Marshal(b, m, deterministic) return xxx_messageInfo_ImageCreate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -85,7 +86,7 @@ func (m *ImageUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ImageUpdate.Marshal(b, m, deterministic) return xxx_messageInfo_ImageUpdate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -124,7 +125,7 @@ func (m *ImageDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ImageDelete.Marshal(b, m, deterministic) return xxx_messageInfo_ImageDelete.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -238,7 +239,7 @@ func (m *ImageDelete) Field(fieldpath []string) (string, bool) {
func (m *ImageCreate) Marshal() (dAtA []byte, err error) { func (m *ImageCreate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -246,43 +247,52 @@ func (m *ImageCreate) Marshal() (dAtA []byte, err error) {
} }
func (m *ImageCreate) MarshalTo(dAtA []byte) (int, error) { func (m *ImageCreate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ImageCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovImage(uint64(len(k))) + 1 + len(v) + sovImage(uint64(len(v))) baseI := i
i = encodeVarintImage(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintImage(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintImage(dAtA, i, uint64(len(v))) i = encodeVarintImage(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintImage(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintImage(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ImageUpdate) Marshal() (dAtA []byte, err error) { func (m *ImageUpdate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -290,43 +300,52 @@ func (m *ImageUpdate) Marshal() (dAtA []byte, err error) {
} }
func (m *ImageUpdate) MarshalTo(dAtA []byte) (int, error) { func (m *ImageUpdate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ImageUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovImage(uint64(len(k))) + 1 + len(v) + sovImage(uint64(len(v))) baseI := i
i = encodeVarintImage(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintImage(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintImage(dAtA, i, uint64(len(v))) i = encodeVarintImage(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintImage(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintImage(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ImageDelete) Marshal() (dAtA []byte, err error) { func (m *ImageDelete) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -334,30 +353,39 @@ func (m *ImageDelete) Marshal() (dAtA []byte, err error) {
} }
func (m *ImageDelete) MarshalTo(dAtA []byte) (int, error) { func (m *ImageDelete) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ImageDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintImage(dAtA []byte, offset int, v uint64) int { func encodeVarintImage(dAtA []byte, offset int, v uint64) int {
offset -= sovImage(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *ImageCreate) Size() (n int) { func (m *ImageCreate) Size() (n int) {
if m == nil { if m == nil {
@ -424,14 +452,7 @@ func (m *ImageDelete) Size() (n int) {
} }
func sovImage(x uint64) (n int) { func sovImage(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozImage(x uint64) (n int) { func sozImage(x uint64) (n int) {
return sovImage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovImage(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1014,6 +1035,7 @@ func (m *ImageDelete) Unmarshal(dAtA []byte) error {
func skipImage(dAtA []byte) (n int, err error) { func skipImage(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1045,10 +1067,8 @@ func skipImage(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1069,55 +1089,30 @@ func skipImage(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthImage return 0, ErrInvalidLengthImage
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthImage
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowImage
}
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 := skipImage(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthImage
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupImage
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthImage
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthImage = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthImage = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowImage = fmt.Errorf("proto: integer overflow") ErrIntOverflowImage = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupImage = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -9,6 +9,7 @@ import (
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -22,7 +23,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type NamespaceCreate struct { type NamespaceCreate struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@ -45,7 +46,7 @@ func (m *NamespaceCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_NamespaceCreate.Marshal(b, m, deterministic) return xxx_messageInfo_NamespaceCreate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -85,7 +86,7 @@ func (m *NamespaceUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_NamespaceUpdate.Marshal(b, m, deterministic) return xxx_messageInfo_NamespaceUpdate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -124,7 +125,7 @@ func (m *NamespaceDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_NamespaceDelete.Marshal(b, m, deterministic) return xxx_messageInfo_NamespaceDelete.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -238,7 +239,7 @@ func (m *NamespaceDelete) Field(fieldpath []string) (string, bool) {
func (m *NamespaceCreate) Marshal() (dAtA []byte, err error) { func (m *NamespaceCreate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -246,43 +247,52 @@ func (m *NamespaceCreate) Marshal() (dAtA []byte, err error) {
} }
func (m *NamespaceCreate) MarshalTo(dAtA []byte) (int, error) { func (m *NamespaceCreate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *NamespaceCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v))) baseI := i
i = encodeVarintNamespace(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(v))) i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *NamespaceUpdate) Marshal() (dAtA []byte, err error) { func (m *NamespaceUpdate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -290,43 +300,52 @@ func (m *NamespaceUpdate) Marshal() (dAtA []byte, err error) {
} }
func (m *NamespaceUpdate) MarshalTo(dAtA []byte) (int, error) { func (m *NamespaceUpdate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *NamespaceUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v))) baseI := i
i = encodeVarintNamespace(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(v))) i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *NamespaceDelete) Marshal() (dAtA []byte, err error) { func (m *NamespaceDelete) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -334,30 +353,39 @@ func (m *NamespaceDelete) Marshal() (dAtA []byte, err error) {
} }
func (m *NamespaceDelete) MarshalTo(dAtA []byte) (int, error) { func (m *NamespaceDelete) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *NamespaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int { func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int {
offset -= sovNamespace(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *NamespaceCreate) Size() (n int) { func (m *NamespaceCreate) Size() (n int) {
if m == nil { if m == nil {
@ -424,14 +452,7 @@ func (m *NamespaceDelete) Size() (n int) {
} }
func sovNamespace(x uint64) (n int) { func sovNamespace(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozNamespace(x uint64) (n int) { func sozNamespace(x uint64) (n int) {
return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1014,6 +1035,7 @@ func (m *NamespaceDelete) Unmarshal(dAtA []byte) error {
func skipNamespace(dAtA []byte) (n int, err error) { func skipNamespace(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1045,10 +1067,8 @@ func skipNamespace(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1069,55 +1089,30 @@ func skipNamespace(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthNamespace return 0, ErrInvalidLengthNamespace
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowNamespace
}
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 := skipNamespace(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupNamespace
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow") ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupNamespace = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -8,6 +8,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type SnapshotPrepare struct { type SnapshotPrepare struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
@ -44,7 +45,7 @@ func (m *SnapshotPrepare) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_SnapshotPrepare.Marshal(b, m, deterministic) return xxx_messageInfo_SnapshotPrepare.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -84,7 +85,7 @@ func (m *SnapshotCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_SnapshotCommit.Marshal(b, m, deterministic) return xxx_messageInfo_SnapshotCommit.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -123,7 +124,7 @@ func (m *SnapshotRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_SnapshotRemove.Marshal(b, m, deterministic) return xxx_messageInfo_SnapshotRemove.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -219,7 +220,7 @@ func (m *SnapshotRemove) Field(fieldpath []string) (string, bool) {
func (m *SnapshotPrepare) Marshal() (dAtA []byte, err error) { func (m *SnapshotPrepare) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -227,32 +228,40 @@ func (m *SnapshotPrepare) Marshal() (dAtA []byte, err error) {
} }
func (m *SnapshotPrepare) MarshalTo(dAtA []byte) (int, error) { func (m *SnapshotPrepare) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SnapshotPrepare) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key)
} }
if len(m.Parent) > 0 { if len(m.Parent) > 0 {
dAtA[i] = 0x12 i -= len(m.Parent)
i++ copy(dAtA[i:], m.Parent)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Parent))) i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Parent)))
i += copy(dAtA[i:], m.Parent) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.Key) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *SnapshotCommit) Marshal() (dAtA []byte, err error) { func (m *SnapshotCommit) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -260,32 +269,40 @@ func (m *SnapshotCommit) Marshal() (dAtA []byte, err error) {
} }
func (m *SnapshotCommit) MarshalTo(dAtA []byte) (int, error) { func (m *SnapshotCommit) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SnapshotCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key)
} }
if len(m.Name) > 0 { if len(m.Name) > 0 {
dAtA[i] = 0x12 i -= len(m.Name)
i++ copy(dAtA[i:], m.Name)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.Key) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *SnapshotRemove) Marshal() (dAtA []byte, err error) { func (m *SnapshotRemove) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -293,30 +310,39 @@ func (m *SnapshotRemove) Marshal() (dAtA []byte, err error) {
} }
func (m *SnapshotRemove) MarshalTo(dAtA []byte) (int, error) { func (m *SnapshotRemove) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SnapshotRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Key) > 0 {
i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int {
offset -= sovSnapshot(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *SnapshotPrepare) Size() (n int) { func (m *SnapshotPrepare) Size() (n int) {
if m == nil { if m == nil {
@ -375,14 +401,7 @@ func (m *SnapshotRemove) Size() (n int) {
} }
func sovSnapshot(x uint64) (n int) { func sovSnapshot(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozSnapshot(x uint64) (n int) { func sozSnapshot(x uint64) (n int) {
return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -755,6 +774,7 @@ func (m *SnapshotRemove) Unmarshal(dAtA []byte) error {
func skipSnapshot(dAtA []byte) (n int, err error) { func skipSnapshot(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -786,10 +806,8 @@ func skipSnapshot(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -810,55 +828,30 @@ func skipSnapshot(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthSnapshot return 0, ErrInvalidLengthSnapshot
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthSnapshot
}
return iNdEx, nil
case 3: case 3:
for { depth++
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
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupSnapshot
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 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 ( var (
ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -11,6 +11,7 @@ import (
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -26,7 +27,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type TaskCreate struct { type TaskCreate struct {
ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
@ -53,7 +54,7 @@ func (m *TaskCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskCreate.Marshal(b, m, deterministic) return xxx_messageInfo_TaskCreate.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -93,7 +94,7 @@ func (m *TaskStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskStart.Marshal(b, m, deterministic) return xxx_messageInfo_TaskStart.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -138,7 +139,7 @@ func (m *TaskDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskDelete.Marshal(b, m, deterministic) return xxx_messageInfo_TaskDelete.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -180,7 +181,7 @@ func (m *TaskIO) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskIO.Marshal(b, m, deterministic) return xxx_messageInfo_TaskIO.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -223,7 +224,7 @@ func (m *TaskExit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskExit.Marshal(b, m, deterministic) return xxx_messageInfo_TaskExit.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -262,7 +263,7 @@ func (m *TaskOOM) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskOOM.Marshal(b, m, deterministic) return xxx_messageInfo_TaskOOM.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -302,7 +303,7 @@ func (m *TaskExecAdded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_TaskExecAdded.Marshal(b, m, deterministic) return xxx_messageInfo_TaskExecAdded.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -343,7 +344,7 @@ func (m *TaskExecStarted) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_TaskExecStarted.Marshal(b, m, deterministic) return xxx_messageInfo_TaskExecStarted.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -382,7 +383,7 @@ func (m *TaskPaused) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TaskPaused.Marshal(b, m, deterministic) return xxx_messageInfo_TaskPaused.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -421,7 +422,7 @@ func (m *TaskResumed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_TaskResumed.Marshal(b, m, deterministic) return xxx_messageInfo_TaskResumed.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -461,7 +462,7 @@ func (m *TaskCheckpointed) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_TaskCheckpointed.Marshal(b, m, deterministic) return xxx_messageInfo_TaskCheckpointed.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -741,7 +742,7 @@ func (m *TaskCheckpointed) Field(fieldpath []string) (string, bool) {
func (m *TaskCreate) Marshal() (dAtA []byte, err error) { func (m *TaskCreate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -749,65 +750,78 @@ func (m *TaskCreate) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskCreate) MarshalTo(dAtA []byte) (int, error) { func (m *TaskCreate) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if len(m.Bundle) > 0 { if m.Pid != 0 {
dAtA[i] = 0x12 i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i++ i--
i = encodeVarintTask(dAtA, i, uint64(len(m.Bundle))) dAtA[i] = 0x30
i += copy(dAtA[i:], m.Bundle)
} }
if len(m.Rootfs) > 0 { if len(m.Checkpoint) > 0 {
for _, msg := range m.Rootfs { i -= len(m.Checkpoint)
dAtA[i] = 0x1a copy(dAtA[i:], m.Checkpoint)
i++ i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint)))
i = encodeVarintTask(dAtA, i, uint64(msg.Size())) i--
n, err := msg.MarshalTo(dAtA[i:]) dAtA[i] = 0x2a
}
if m.IO != nil {
{
size, err := m.IO.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n i -= size
i = encodeVarintTask(dAtA, i, uint64(size))
} }
} i--
if m.IO != nil {
dAtA[i] = 0x22 dAtA[i] = 0x22
i++ }
i = encodeVarintTask(dAtA, i, uint64(m.IO.Size())) if len(m.Rootfs) > 0 {
n1, err := m.IO.MarshalTo(dAtA[i:]) for iNdEx := len(m.Rootfs) - 1; iNdEx >= 0; iNdEx-- {
if err != nil { {
return 0, err size, err := m.Rootfs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTask(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
} }
i += n1
} }
if len(m.Checkpoint) > 0 { if len(m.Bundle) > 0 {
dAtA[i] = 0x2a i -= len(m.Bundle)
i++ copy(dAtA[i:], m.Bundle)
i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint))) i = encodeVarintTask(dAtA, i, uint64(len(m.Bundle)))
i += copy(dAtA[i:], m.Checkpoint) i--
dAtA[i] = 0x12
} }
if m.Pid != 0 { if len(m.ContainerID) > 0 {
dAtA[i] = 0x30 i -= len(m.ContainerID)
i++ copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *TaskStart) Marshal() (dAtA []byte, err error) { func (m *TaskStart) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -815,31 +829,38 @@ func (m *TaskStart) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskStart) MarshalTo(dAtA []byte) (int, error) { func (m *TaskStart) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskStart) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if m.Pid != 0 { if m.Pid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x10
} }
if m.XXX_unrecognized != nil { if len(m.ContainerID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *TaskDelete) Marshal() (dAtA []byte, err error) { func (m *TaskDelete) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -847,50 +868,58 @@ func (m *TaskDelete) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskDelete) MarshalTo(dAtA []byte) (int, error) { func (m *TaskDelete) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) }
i += copy(dAtA[i:], m.ContainerID) if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0x2a
}
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintTask(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x22
if m.ExitStatus != 0 {
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
i--
dAtA[i] = 0x18
} }
if m.Pid != 0 { if m.Pid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x10
} }
if m.ExitStatus != 0 { if len(m.ContainerID) > 0 {
dAtA[i] = 0x18 i -= len(m.ContainerID)
i++ copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
} }
dAtA[i] = 0x22 return len(dAtA) - i, nil
i++
i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n2
if len(m.ID) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *TaskIO) Marshal() (dAtA []byte, err error) { func (m *TaskIO) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -898,48 +927,57 @@ func (m *TaskIO) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskIO) MarshalTo(dAtA []byte) (int, error) { func (m *TaskIO) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskIO) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Stdin) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
i += copy(dAtA[i:], m.Stdin)
}
if len(m.Stdout) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
i += copy(dAtA[i:], m.Stdout)
}
if len(m.Stderr) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
i += copy(dAtA[i:], m.Stderr)
} }
if m.Terminal { if m.Terminal {
dAtA[i] = 0x20 i--
i++
if m.Terminal { if m.Terminal {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x20
} }
if m.XXX_unrecognized != nil { if len(m.Stderr) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Stderr)
copy(dAtA[i:], m.Stderr)
i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
i--
dAtA[i] = 0x1a
} }
return i, nil if len(m.Stdout) > 0 {
i -= len(m.Stdout)
copy(dAtA[i:], m.Stdout)
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
i--
dAtA[i] = 0x12
}
if len(m.Stdin) > 0 {
i -= len(m.Stdin)
copy(dAtA[i:], m.Stdin)
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TaskExit) Marshal() (dAtA []byte, err error) { func (m *TaskExit) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -947,50 +985,58 @@ func (m *TaskExit) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskExit) MarshalTo(dAtA []byte) (int, error) { func (m *TaskExit) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskExit) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if len(m.ID) > 0 { n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
dAtA[i] = 0x12 if err3 != nil {
i++ return 0, err3
i = encodeVarintTask(dAtA, i, uint64(len(m.ID))) }
i += copy(dAtA[i:], m.ID) i -= n3
i = encodeVarintTask(dAtA, i, uint64(n3))
i--
dAtA[i] = 0x2a
if m.ExitStatus != 0 {
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
i--
dAtA[i] = 0x20
} }
if m.Pid != 0 { if m.Pid != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x18
} }
if m.ExitStatus != 0 { if len(m.ID) > 0 {
dAtA[i] = 0x20 i -= len(m.ID)
i++ copy(dAtA[i:], m.ID)
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0x12
} }
dAtA[i] = 0x2a if len(m.ContainerID) > 0 {
i++ i -= len(m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) copy(dAtA[i:], m.ContainerID)
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
if err != nil { i--
return 0, err dAtA[i] = 0xa
} }
i += n3 return len(dAtA) - i, nil
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *TaskOOM) Marshal() (dAtA []byte, err error) { func (m *TaskOOM) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -998,26 +1044,33 @@ func (m *TaskOOM) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskOOM) MarshalTo(dAtA []byte) (int, error) { func (m *TaskOOM) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskOOM) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ContainerID) > 0 {
i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TaskExecAdded) Marshal() (dAtA []byte, err error) { func (m *TaskExecAdded) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1025,32 +1078,40 @@ func (m *TaskExecAdded) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskExecAdded) MarshalTo(dAtA []byte) (int, error) { func (m *TaskExecAdded) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskExecAdded) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if len(m.ExecID) > 0 { if len(m.ExecID) > 0 {
dAtA[i] = 0x12 i -= len(m.ExecID)
i++ copy(dAtA[i:], m.ExecID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID))) i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID)))
i += copy(dAtA[i:], m.ExecID) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.ContainerID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *TaskExecStarted) Marshal() (dAtA []byte, err error) { func (m *TaskExecStarted) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1058,37 +1119,45 @@ func (m *TaskExecStarted) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskExecStarted) MarshalTo(dAtA []byte) (int, error) { func (m *TaskExecStarted) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskExecStarted) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
}
if len(m.ExecID) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID)))
i += copy(dAtA[i:], m.ExecID)
} }
if m.Pid != 0 { if m.Pid != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x18
} }
if m.XXX_unrecognized != nil { if len(m.ExecID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ExecID)
copy(dAtA[i:], m.ExecID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID)))
i--
dAtA[i] = 0x12
} }
return i, nil if len(m.ContainerID) > 0 {
i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TaskPaused) Marshal() (dAtA []byte, err error) { func (m *TaskPaused) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1096,26 +1165,33 @@ func (m *TaskPaused) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskPaused) MarshalTo(dAtA []byte) (int, error) { func (m *TaskPaused) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskPaused) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ContainerID) > 0 {
i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TaskResumed) Marshal() (dAtA []byte, err error) { func (m *TaskResumed) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1123,26 +1199,33 @@ func (m *TaskResumed) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskResumed) MarshalTo(dAtA []byte) (int, error) { func (m *TaskResumed) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskResumed) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ContainerID) > 0 {
i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *TaskCheckpointed) Marshal() (dAtA []byte, err error) { func (m *TaskCheckpointed) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1150,36 +1233,46 @@ func (m *TaskCheckpointed) Marshal() (dAtA []byte, err error) {
} }
func (m *TaskCheckpointed) MarshalTo(dAtA []byte) (int, error) { func (m *TaskCheckpointed) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TaskCheckpointed) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if len(m.Checkpoint) > 0 { if len(m.Checkpoint) > 0 {
dAtA[i] = 0x12 i -= len(m.Checkpoint)
i++ copy(dAtA[i:], m.Checkpoint)
i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint))) i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint)))
i += copy(dAtA[i:], m.Checkpoint) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.ContainerID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintTask(dAtA []byte, offset int, v uint64) int { func encodeVarintTask(dAtA []byte, offset int, v uint64) int {
offset -= sovTask(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *TaskCreate) Size() (n int) { func (m *TaskCreate) Size() (n int) {
if m == nil { if m == nil {
@ -1432,14 +1525,7 @@ func (m *TaskCheckpointed) Size() (n int) {
} }
func sovTask(x uint64) (n int) { func sovTask(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozTask(x uint64) (n int) { func sozTask(x uint64) (n int) {
return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1448,11 +1534,16 @@ func (this *TaskCreate) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForRootfs := "[]*Mount{"
for _, f := range this.Rootfs {
repeatedStringForRootfs += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
}
repeatedStringForRootfs += "}"
s := strings.Join([]string{`&TaskCreate{`, s := strings.Join([]string{`&TaskCreate{`,
`ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
`Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`,
`Rootfs:` + strings.Replace(fmt.Sprintf("%v", this.Rootfs), "Mount", "types.Mount", 1) + `,`, `Rootfs:` + repeatedStringForRootfs + `,`,
`IO:` + strings.Replace(fmt.Sprintf("%v", this.IO), "TaskIO", "TaskIO", 1) + `,`, `IO:` + strings.Replace(this.IO.String(), "TaskIO", "TaskIO", 1) + `,`,
`Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`, `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
@ -1480,7 +1571,7 @@ func (this *TaskDelete) String() string {
`ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`, `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
@ -1510,7 +1601,7 @@ func (this *TaskExit) String() string {
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`, `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -3120,6 +3211,7 @@ func (m *TaskCheckpointed) Unmarshal(dAtA []byte) error {
func skipTask(dAtA []byte) (n int, err error) { func skipTask(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3151,10 +3243,8 @@ func skipTask(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3175,55 +3265,30 @@ func skipTask(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthTask return 0, ErrInvalidLengthTask
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTask
}
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 := skipTask(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupTask
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTask = fmt.Errorf("proto: integer overflow") ErrIntOverflowTask = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupTask = fmt.Errorf("proto: unexpected end of group")
) )

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,11 @@ import (
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
types1 "github.com/gogo/protobuf/types" types1 "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -26,7 +29,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ApplyRequest struct { type ApplyRequest struct {
// Diff is the descriptor of the diff to be extracted // Diff is the descriptor of the diff to be extracted
@ -51,7 +54,7 @@ func (m *ApplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ApplyRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ApplyRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -93,7 +96,7 @@ func (m *ApplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_ApplyResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ApplyResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -146,7 +149,7 @@ func (m *DiffRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_DiffRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DiffRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -186,7 +189,7 @@ func (m *DiffResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_DiffResponse.Marshal(b, m, deterministic) return xxx_messageInfo_DiffResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -313,6 +316,17 @@ type DiffServer interface {
Diff(context.Context, *DiffRequest) (*DiffResponse, error) Diff(context.Context, *DiffRequest) (*DiffResponse, error)
} }
// UnimplementedDiffServer can be embedded to have forward compatible implementations.
type UnimplementedDiffServer struct {
}
func (*UnimplementedDiffServer) Apply(ctx context.Context, req *ApplyRequest) (*ApplyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented")
}
func (*UnimplementedDiffServer) Diff(ctx context.Context, req *DiffRequest) (*DiffResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented")
}
func RegisterDiffServer(s *grpc.Server, srv DiffServer) { func RegisterDiffServer(s *grpc.Server, srv DiffServer) {
s.RegisterService(&_Diff_serviceDesc, srv) s.RegisterService(&_Diff_serviceDesc, srv)
} }
@ -373,7 +387,7 @@ var _Diff_serviceDesc = grpc.ServiceDesc{
func (m *ApplyRequest) Marshal() (dAtA []byte, err error) { func (m *ApplyRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -381,70 +395,78 @@ func (m *ApplyRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ApplyRequest) MarshalTo(dAtA []byte) (int, error) { func (m *ApplyRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ApplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Diff != nil { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintDiff(dAtA, i, uint64(m.Diff.Size()))
n1, err := m.Diff.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
if len(m.Mounts) > 0 {
for _, msg := range m.Mounts {
dAtA[i] = 0x12
i++
i = encodeVarintDiff(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
} }
if len(m.Payloads) > 0 { if len(m.Payloads) > 0 {
for k, _ := range m.Payloads { for k := range m.Payloads {
dAtA[i] = 0x1a
i++
v := m.Payloads[k] v := m.Payloads[k]
msgSize := 0 baseI := i
if v != nil {
msgSize = v.Size()
msgSize += 1 + sovDiff(uint64(msgSize))
}
mapSize := 1 + len(k) + sovDiff(uint64(len(k))) + msgSize
i = encodeVarintDiff(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintDiff(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
if v != nil { if v != nil {
{
size, err := v.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12 dAtA[i] = 0x12
i++ }
i = encodeVarintDiff(dAtA, i, uint64(v.Size())) i -= len(k)
n2, err := v.MarshalTo(dAtA[i:]) copy(dAtA[i:], k)
i = encodeVarintDiff(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x1a
}
}
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 { if err != nil {
return 0, err return 0, err
} }
i += n2 i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
} }
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if m.Diff != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) {
size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ApplyResponse) Marshal() (dAtA []byte, err error) { func (m *ApplyResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -452,30 +474,38 @@ func (m *ApplyResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ApplyResponse) MarshalTo(dAtA []byte) (int, error) { func (m *ApplyResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ApplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Applied != nil {
dAtA[i] = 0xa
i++
i = encodeVarintDiff(dAtA, i, uint64(m.Applied.Size()))
n3, err := m.Applied.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.Applied != nil {
{
size, err := m.Applied.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *DiffRequest) Marshal() (dAtA []byte, err error) { func (m *DiffRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -483,73 +513,87 @@ func (m *DiffRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *DiffRequest) MarshalTo(dAtA []byte) (int, error) { func (m *DiffRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DiffRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Left) > 0 { if m.XXX_unrecognized != nil {
for _, msg := range m.Left { i -= len(m.XXX_unrecognized)
dAtA[i] = 0xa copy(dAtA[i:], m.XXX_unrecognized)
i++
i = encodeVarintDiff(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Right) > 0 {
for _, msg := range m.Right {
dAtA[i] = 0x12
i++
i = encodeVarintDiff(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.MediaType) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintDiff(dAtA, i, uint64(len(m.MediaType)))
i += copy(dAtA[i:], m.MediaType)
}
if len(m.Ref) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref)))
i += copy(dAtA[i:], m.Ref)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x2a
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovDiff(uint64(len(k))) + 1 + len(v) + sovDiff(uint64(len(v))) baseI := i
i = encodeVarintDiff(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintDiff(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintDiff(dAtA, i, uint64(len(v))) i = encodeVarintDiff(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintDiff(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x2a
} }
} }
if m.XXX_unrecognized != nil { if len(m.Ref) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Ref)
copy(dAtA[i:], m.Ref)
i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref)))
i--
dAtA[i] = 0x22
} }
return i, nil if len(m.MediaType) > 0 {
i -= len(m.MediaType)
copy(dAtA[i:], m.MediaType)
i = encodeVarintDiff(dAtA, i, uint64(len(m.MediaType)))
i--
dAtA[i] = 0x1a
}
if len(m.Right) > 0 {
for iNdEx := len(m.Right) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Right[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
if len(m.Left) > 0 {
for iNdEx := len(m.Left) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Left[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
} }
func (m *DiffResponse) Marshal() (dAtA []byte, err error) { func (m *DiffResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -557,34 +601,44 @@ func (m *DiffResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *DiffResponse) MarshalTo(dAtA []byte) (int, error) { func (m *DiffResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DiffResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Diff != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintDiff(dAtA, i, uint64(m.Diff.Size()))
n4, err := m.Diff.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.Diff != nil {
{
size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintDiff(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
return len(dAtA) - i, nil
} }
func encodeVarintDiff(dAtA []byte, offset int, v uint64) int { func encodeVarintDiff(dAtA []byte, offset int, v uint64) int {
offset -= sovDiff(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *ApplyRequest) Size() (n int) { func (m *ApplyRequest) Size() (n int) {
if m == nil { if m == nil {
@ -694,14 +748,7 @@ func (m *DiffResponse) Size() (n int) {
} }
func sovDiff(x uint64) (n int) { func sovDiff(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozDiff(x uint64) (n int) { func sozDiff(x uint64) (n int) {
return sovDiff(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovDiff(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -710,6 +757,11 @@ func (this *ApplyRequest) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForMounts := "[]*Mount{"
for _, f := range this.Mounts {
repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
}
repeatedStringForMounts += "}"
keysForPayloads := make([]string, 0, len(this.Payloads)) keysForPayloads := make([]string, 0, len(this.Payloads))
for k, _ := range this.Payloads { for k, _ := range this.Payloads {
keysForPayloads = append(keysForPayloads, k) keysForPayloads = append(keysForPayloads, k)
@ -722,7 +774,7 @@ func (this *ApplyRequest) String() string {
mapStringForPayloads += "}" mapStringForPayloads += "}"
s := strings.Join([]string{`&ApplyRequest{`, s := strings.Join([]string{`&ApplyRequest{`,
`Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`, `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "types.Mount", 1) + `,`, `Mounts:` + repeatedStringForMounts + `,`,
`Payloads:` + mapStringForPayloads + `,`, `Payloads:` + mapStringForPayloads + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
@ -744,6 +796,16 @@ func (this *DiffRequest) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForLeft := "[]*Mount{"
for _, f := range this.Left {
repeatedStringForLeft += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
}
repeatedStringForLeft += "}"
repeatedStringForRight := "[]*Mount{"
for _, f := range this.Right {
repeatedStringForRight += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
}
repeatedStringForRight += "}"
keysForLabels := make([]string, 0, len(this.Labels)) keysForLabels := make([]string, 0, len(this.Labels))
for k, _ := range this.Labels { for k, _ := range this.Labels {
keysForLabels = append(keysForLabels, k) keysForLabels = append(keysForLabels, k)
@ -755,8 +817,8 @@ func (this *DiffRequest) String() string {
} }
mapStringForLabels += "}" mapStringForLabels += "}"
s := strings.Join([]string{`&DiffRequest{`, s := strings.Join([]string{`&DiffRequest{`,
`Left:` + strings.Replace(fmt.Sprintf("%v", this.Left), "Mount", "types.Mount", 1) + `,`, `Left:` + repeatedStringForLeft + `,`,
`Right:` + strings.Replace(fmt.Sprintf("%v", this.Right), "Mount", "types.Mount", 1) + `,`, `Right:` + repeatedStringForRight + `,`,
`MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`, `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
`Ref:` + fmt.Sprintf("%v", this.Ref) + `,`, `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
`Labels:` + mapStringForLabels + `,`, `Labels:` + mapStringForLabels + `,`,
@ -1533,6 +1595,7 @@ func (m *DiffResponse) Unmarshal(dAtA []byte) error {
func skipDiff(dAtA []byte) (n int, err error) { func skipDiff(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1564,10 +1627,8 @@ func skipDiff(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1588,55 +1649,30 @@ func skipDiff(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthDiff return 0, ErrInvalidLengthDiff
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthDiff
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowDiff
}
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 := skipDiff(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthDiff
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupDiff
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthDiff
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthDiff = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthDiff = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowDiff = fmt.Errorf("proto: integer overflow") ErrIntOverflowDiff = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupDiff = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -11,8 +11,11 @@ import (
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -28,7 +31,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type PublishRequest struct { type PublishRequest struct {
Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
@ -51,7 +54,7 @@ func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_PublishRequest.Marshal(b, m, deterministic) return xxx_messageInfo_PublishRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -90,7 +93,7 @@ func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_ForwardRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ForwardRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -129,7 +132,7 @@ func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -171,7 +174,7 @@ func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) return xxx_messageInfo_Envelope.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -377,6 +380,20 @@ type EventsServer interface {
Subscribe(*SubscribeRequest, Events_SubscribeServer) error Subscribe(*SubscribeRequest, Events_SubscribeServer) error
} }
// UnimplementedEventsServer can be embedded to have forward compatible implementations.
type UnimplementedEventsServer struct {
}
func (*UnimplementedEventsServer) Publish(ctx context.Context, req *PublishRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented")
}
func (*UnimplementedEventsServer) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Forward not implemented")
}
func (*UnimplementedEventsServer) Subscribe(req *SubscribeRequest, srv Events_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func RegisterEventsServer(s *grpc.Server, srv EventsServer) { func RegisterEventsServer(s *grpc.Server, srv EventsServer) {
s.RegisterService(&_Events_serviceDesc, srv) s.RegisterService(&_Events_serviceDesc, srv)
} }
@ -464,7 +481,7 @@ var _Events_serviceDesc = grpc.ServiceDesc{
func (m *PublishRequest) Marshal() (dAtA []byte, err error) { func (m *PublishRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -472,36 +489,45 @@ func (m *PublishRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *PublishRequest) MarshalTo(dAtA []byte) (int, error) { func (m *PublishRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PublishRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Topic) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
i += copy(dAtA[i:], m.Topic)
} }
if m.Event != nil { if m.Event != nil {
dAtA[i] = 0x12 {
i++ size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintEvents(dAtA, i, uint64(m.Event.Size())) if err != nil {
n1, err := m.Event.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintEvents(dAtA, i, uint64(size))
} }
i += n1 i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.Topic) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Topic)
copy(dAtA[i:], m.Topic)
i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ForwardRequest) Marshal() (dAtA []byte, err error) { func (m *ForwardRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -509,30 +535,38 @@ func (m *ForwardRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error) { func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Envelope != nil {
dAtA[i] = 0xa
i++
i = encodeVarintEvents(dAtA, i, uint64(m.Envelope.Size()))
n2, err := m.Envelope.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.Envelope != nil {
{
size, err := m.Envelope.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintEvents(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *SubscribeRequest) Marshal() (dAtA []byte, err error) { func (m *SubscribeRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -540,35 +574,35 @@ func (m *SubscribeRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) { func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Filters) > 0 { if len(m.Filters) > 0 {
for _, s := range m.Filters { for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Filters[iNdEx])
copy(dAtA[i:], m.Filters[iNdEx])
i = encodeVarintEvents(dAtA, i, uint64(len(m.Filters[iNdEx])))
i--
dAtA[i] = 0xa dAtA[i] = 0xa
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *Envelope) Marshal() (dAtA []byte, err error) { func (m *Envelope) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -576,54 +610,66 @@ func (m *Envelope) Marshal() (dAtA []byte, err error) {
} }
func (m *Envelope) MarshalTo(dAtA []byte) (int, error) { func (m *Envelope) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa if m.XXX_unrecognized != nil {
i++ i -= len(m.XXX_unrecognized)
i = encodeVarintEvents(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) copy(dAtA[i:], m.XXX_unrecognized)
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
if err != nil {
return 0, err
}
i += n3
if len(m.Namespace) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace)))
i += copy(dAtA[i:], m.Namespace)
}
if len(m.Topic) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
i += copy(dAtA[i:], m.Topic)
} }
if m.Event != nil { if m.Event != nil {
dAtA[i] = 0x22 {
i++ size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintEvents(dAtA, i, uint64(m.Event.Size())) if err != nil {
n4, err := m.Event.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintEvents(dAtA, i, uint64(size))
} }
i += n4 i--
dAtA[i] = 0x22
} }
if m.XXX_unrecognized != nil { if len(m.Topic) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Topic)
copy(dAtA[i:], m.Topic)
i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
i--
dAtA[i] = 0x1a
} }
return i, nil if len(m.Namespace) > 0 {
i -= len(m.Namespace)
copy(dAtA[i:], m.Namespace)
i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace)))
i--
dAtA[i] = 0x12
}
n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err4 != nil {
return 0, err4
}
i -= n4
i = encodeVarintEvents(dAtA, i, uint64(n4))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { func encodeVarintEvents(dAtA []byte, offset int, v uint64) int {
offset -= sovEvents(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *PublishRequest) Size() (n int) { func (m *PublishRequest) Size() (n int) {
if m == nil { if m == nil {
@ -706,14 +752,7 @@ func (m *Envelope) Size() (n int) {
} }
func sovEvents(x uint64) (n int) { func sovEvents(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozEvents(x uint64) (n int) { func sozEvents(x uint64) (n int) {
return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -735,7 +774,7 @@ func (this *ForwardRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&ForwardRequest{`, s := strings.Join([]string{`&ForwardRequest{`,
`Envelope:` + strings.Replace(fmt.Sprintf("%v", this.Envelope), "Envelope", "Envelope", 1) + `,`, `Envelope:` + strings.Replace(this.Envelope.String(), "Envelope", "Envelope", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -757,7 +796,7 @@ func (this *Envelope) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&Envelope{`, s := strings.Join([]string{`&Envelope{`,
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
`Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
`Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`, `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`,
@ -1262,6 +1301,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error {
func skipEvents(dAtA []byte) (n int, err error) { func skipEvents(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1293,10 +1333,8 @@ func skipEvents(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1317,55 +1355,30 @@ func skipEvents(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthEvents return 0, ErrInvalidLengthEvents
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthEvents
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowEvents
}
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 := skipEvents(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthEvents
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupEvents
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthEvents
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -12,8 +12,11 @@ import (
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
types1 "github.com/gogo/protobuf/types" types1 "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -29,7 +32,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Image struct { type Image struct {
// Name provides a unique name for the image. // Name provides a unique name for the image.
@ -66,7 +69,7 @@ func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Image.Marshal(b, m, deterministic) return xxx_messageInfo_Image.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -105,7 +108,7 @@ func (m *GetImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_GetImageRequest.Marshal(b, m, deterministic) return xxx_messageInfo_GetImageRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -144,7 +147,7 @@ func (m *GetImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_GetImageResponse.Marshal(b, m, deterministic) return xxx_messageInfo_GetImageResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -183,7 +186,7 @@ func (m *CreateImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_CreateImageRequest.Marshal(b, m, deterministic) return xxx_messageInfo_CreateImageRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -222,7 +225,7 @@ func (m *CreateImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_CreateImageResponse.Marshal(b, m, deterministic) return xxx_messageInfo_CreateImageResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -267,7 +270,7 @@ func (m *UpdateImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_UpdateImageRequest.Marshal(b, m, deterministic) return xxx_messageInfo_UpdateImageRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -306,7 +309,7 @@ func (m *UpdateImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_UpdateImageResponse.Marshal(b, m, deterministic) return xxx_messageInfo_UpdateImageResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -355,7 +358,7 @@ func (m *ListImagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return xxx_messageInfo_ListImagesRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ListImagesRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -394,7 +397,7 @@ func (m *ListImagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_ListImagesResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ListImagesResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -438,7 +441,7 @@ func (m *DeleteImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_DeleteImageRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DeleteImageRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -618,6 +621,26 @@ type ImagesServer interface {
Delete(context.Context, *DeleteImageRequest) (*types1.Empty, error) Delete(context.Context, *DeleteImageRequest) (*types1.Empty, error)
} }
// UnimplementedImagesServer can be embedded to have forward compatible implementations.
type UnimplementedImagesServer struct {
}
func (*UnimplementedImagesServer) Get(ctx context.Context, req *GetImageRequest) (*GetImageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedImagesServer) List(ctx context.Context, req *ListImagesRequest) (*ListImagesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedImagesServer) Create(ctx context.Context, req *CreateImageRequest) (*CreateImageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (*UnimplementedImagesServer) Update(ctx context.Context, req *UpdateImageRequest) (*UpdateImageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (*UnimplementedImagesServer) Delete(ctx context.Context, req *DeleteImageRequest) (*types1.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func RegisterImagesServer(s *grpc.Server, srv ImagesServer) { func RegisterImagesServer(s *grpc.Server, srv ImagesServer) {
s.RegisterService(&_Images_serviceDesc, srv) s.RegisterService(&_Images_serviceDesc, srv)
} }
@ -744,7 +767,7 @@ var _Images_serviceDesc = grpc.ServiceDesc{
func (m *Image) Marshal() (dAtA []byte, err error) { func (m *Image) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -752,67 +775,78 @@ func (m *Image) Marshal() (dAtA []byte, err error) {
} }
func (m *Image) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintImages(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x42
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintImages(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x3a
{
size, err := m.Target.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovImages(uint64(len(k))) + 1 + len(v) + sovImages(uint64(len(v))) baseI := i
i = encodeVarintImages(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintImages(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintImages(dAtA, i, uint64(len(v))) i = encodeVarintImages(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintImages(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintImages(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
dAtA[i] = 0x1a if len(m.Name) > 0 {
i++ i -= len(m.Name)
i = encodeVarintImages(dAtA, i, uint64(m.Target.Size())) copy(dAtA[i:], m.Name)
n1, err := m.Target.MarshalTo(dAtA[i:]) i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
if err != nil { i--
return 0, err dAtA[i] = 0xa
} }
i += n1 return len(dAtA) - i, nil
dAtA[i] = 0x3a
i++
i = encodeVarintImages(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)))
n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n2
dAtA[i] = 0x42
i++
i = encodeVarintImages(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)))
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n3
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *GetImageRequest) Marshal() (dAtA []byte, err error) { func (m *GetImageRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -820,26 +854,33 @@ func (m *GetImageRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *GetImageRequest) MarshalTo(dAtA []byte) (int, error) { func (m *GetImageRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *GetImageResponse) Marshal() (dAtA []byte, err error) { func (m *GetImageResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -847,30 +888,38 @@ func (m *GetImageResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *GetImageResponse) MarshalTo(dAtA []byte) (int, error) { func (m *GetImageResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Image != nil {
dAtA[i] = 0xa
i++
i = encodeVarintImages(dAtA, i, uint64(m.Image.Size()))
n4, err := m.Image.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.Image != nil {
{
size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *CreateImageRequest) Marshal() (dAtA []byte, err error) { func (m *CreateImageRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -878,28 +927,36 @@ func (m *CreateImageRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateImageRequest) MarshalTo(dAtA []byte) (int, error) { func (m *CreateImageRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintImages(dAtA, i, uint64(m.Image.Size()))
n5, err := m.Image.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n5
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *CreateImageResponse) Marshal() (dAtA []byte, err error) { func (m *CreateImageResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -907,28 +964,36 @@ func (m *CreateImageResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateImageResponse) MarshalTo(dAtA []byte) (int, error) { func (m *CreateImageResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintImages(dAtA, i, uint64(m.Image.Size()))
n6, err := m.Image.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *UpdateImageRequest) Marshal() (dAtA []byte, err error) { func (m *UpdateImageRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -936,38 +1001,48 @@ func (m *UpdateImageRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *UpdateImageRequest) MarshalTo(dAtA []byte) (int, error) { func (m *UpdateImageRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *UpdateImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa if m.XXX_unrecognized != nil {
i++ i -= len(m.XXX_unrecognized)
i = encodeVarintImages(dAtA, i, uint64(m.Image.Size())) copy(dAtA[i:], m.XXX_unrecognized)
n7, err := m.Image.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
} }
i += n7
if m.UpdateMask != nil { if m.UpdateMask != nil {
{
size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12 dAtA[i] = 0x12
i++ }
i = encodeVarintImages(dAtA, i, uint64(m.UpdateMask.Size())) {
n8, err := m.UpdateMask.MarshalTo(dAtA[i:]) size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n8 i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0xa
} return len(dAtA) - i, nil
return i, nil
} }
func (m *UpdateImageResponse) Marshal() (dAtA []byte, err error) { func (m *UpdateImageResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -975,28 +1050,36 @@ func (m *UpdateImageResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *UpdateImageResponse) MarshalTo(dAtA []byte) (int, error) { func (m *UpdateImageResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *UpdateImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintImages(dAtA, i, uint64(m.Image.Size()))
n9, err := m.Image.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n9
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1004,35 +1087,35 @@ func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) { func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListImagesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Filters) > 0 { if len(m.Filters) > 0 {
for _, s := range m.Filters { for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Filters[iNdEx])
copy(dAtA[i:], m.Filters[iNdEx])
i = encodeVarintImages(dAtA, i, uint64(len(m.Filters[iNdEx])))
i--
dAtA[i] = 0xa dAtA[i] = 0xa
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1040,32 +1123,40 @@ func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) { func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Images) > 0 { if len(m.Images) > 0 {
for _, msg := range m.Images { for iNdEx := len(m.Images) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0xa {
i++ size, err := m.Images[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintImages(dAtA, i, uint64(msg.Size())) if err != nil {
n, err := msg.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintImages(dAtA, i, uint64(size))
} }
i += n i--
dAtA[i] = 0xa
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *DeleteImageRequest) Marshal() (dAtA []byte, err error) { func (m *DeleteImageRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1073,40 +1164,49 @@ func (m *DeleteImageRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *DeleteImageRequest) MarshalTo(dAtA []byte) (int, error) { func (m *DeleteImageRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if m.Sync { if m.Sync {
dAtA[i] = 0x10 i--
i++
if m.Sync { if m.Sync {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x10
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintImages(dAtA []byte, offset int, v uint64) int { func encodeVarintImages(dAtA []byte, offset int, v uint64) int {
offset -= sovImages(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Image) Size() (n int) { func (m *Image) Size() (n int) {
if m == nil { if m == nil {
@ -1286,14 +1386,7 @@ func (m *DeleteImageRequest) Size() (n int) {
} }
func sovImages(x uint64) (n int) { func sovImages(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozImages(x uint64) (n int) { func sozImages(x uint64) (n int) {
return sovImages(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovImages(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1315,9 +1408,9 @@ func (this *Image) String() string {
s := strings.Join([]string{`&Image{`, s := strings.Join([]string{`&Image{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Labels:` + mapStringForLabels + `,`, `Labels:` + mapStringForLabels + `,`,
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "Descriptor", "types.Descriptor", 1), `&`, ``, 1) + `,`, `Target:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Target), "Descriptor", "types.Descriptor", 1), `&`, ``, 1) + `,`,
`CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`, `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
`UpdatedAt:` + strings.Replace(strings.Replace(this.UpdatedAt.String(), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`, `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -1339,7 +1432,7 @@ func (this *GetImageResponse) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&GetImageResponse{`, s := strings.Join([]string{`&GetImageResponse{`,
`Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "Image", "Image", 1) + `,`, `Image:` + strings.Replace(this.Image.String(), "Image", "Image", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -1405,8 +1498,13 @@ func (this *ListImagesResponse) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForImages := "[]Image{"
for _, f := range this.Images {
repeatedStringForImages += strings.Replace(strings.Replace(f.String(), "Image", "Image", 1), `&`, ``, 1) + ","
}
repeatedStringForImages += "}"
s := strings.Join([]string{`&ListImagesResponse{`, s := strings.Join([]string{`&ListImagesResponse{`,
`Images:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Images), "Image", "Image", 1), `&`, ``, 1) + `,`, `Images:` + repeatedStringForImages + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -2587,6 +2685,7 @@ func (m *DeleteImageRequest) Unmarshal(dAtA []byte) error {
func skipImages(dAtA []byte) (n int, err error) { func skipImages(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -2618,10 +2717,8 @@ func skipImages(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -2642,55 +2739,30 @@ func skipImages(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthImages return 0, ErrInvalidLengthImages
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthImages
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowImages
}
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 := skipImages(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthImages
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupImages
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthImages
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthImages = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthImages = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowImages = fmt.Errorf("proto: integer overflow") ErrIntOverflowImages = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupImages = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -12,8 +12,11 @@ import (
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
types1 "github.com/gogo/protobuf/types" types1 "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -27,7 +30,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Plugin struct { type Plugin struct {
// Type defines the type of plugin. // Type defines the type of plugin.
@ -85,7 +88,7 @@ func (m *Plugin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Plugin.Marshal(b, m, deterministic) return xxx_messageInfo_Plugin.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -134,7 +137,7 @@ func (m *PluginsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_PluginsRequest.Marshal(b, m, deterministic) return xxx_messageInfo_PluginsRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -173,7 +176,7 @@ func (m *PluginsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_PluginsResponse.Marshal(b, m, deterministic) return xxx_messageInfo_PluginsResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -212,7 +215,7 @@ func (m *ServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_ServerResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ServerResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -340,6 +343,17 @@ type IntrospectionServer interface {
Server(context.Context, *types1.Empty) (*ServerResponse, error) Server(context.Context, *types1.Empty) (*ServerResponse, error)
} }
// UnimplementedIntrospectionServer can be embedded to have forward compatible implementations.
type UnimplementedIntrospectionServer struct {
}
func (*UnimplementedIntrospectionServer) Plugins(ctx context.Context, req *PluginsRequest) (*PluginsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Plugins not implemented")
}
func (*UnimplementedIntrospectionServer) Server(ctx context.Context, req *types1.Empty) (*ServerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Server not implemented")
}
func RegisterIntrospectionServer(s *grpc.Server, srv IntrospectionServer) { func RegisterIntrospectionServer(s *grpc.Server, srv IntrospectionServer) {
s.RegisterService(&_Introspection_serviceDesc, srv) s.RegisterService(&_Introspection_serviceDesc, srv)
} }
@ -400,7 +414,7 @@ var _Introspection_serviceDesc = grpc.ServiceDesc{
func (m *Plugin) Marshal() (dAtA []byte, err error) { func (m *Plugin) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -408,101 +422,103 @@ func (m *Plugin) Marshal() (dAtA []byte, err error) {
} }
func (m *Plugin) MarshalTo(dAtA []byte) (int, error) { func (m *Plugin) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Plugin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Type) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type)
} }
if len(m.ID) > 0 { if m.InitErr != nil {
dAtA[i] = 0x12 {
i++ size, err := m.InitErr.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if len(m.Requires) > 0 {
for _, s := range m.Requires {
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.Platforms) > 0 {
for _, msg := range m.Platforms {
dAtA[i] = 0x22
i++
i = encodeVarintIntrospection(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n i -= size
i = encodeVarintIntrospection(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x3a
}
if len(m.Capabilities) > 0 {
for iNdEx := len(m.Capabilities) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Capabilities[iNdEx])
copy(dAtA[i:], m.Capabilities[iNdEx])
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Capabilities[iNdEx])))
i--
dAtA[i] = 0x32
} }
} }
if len(m.Exports) > 0 { if len(m.Exports) > 0 {
for k, _ := range m.Exports { for k := range m.Exports {
dAtA[i] = 0x2a
i++
v := m.Exports[k] v := m.Exports[k]
mapSize := 1 + len(k) + sovIntrospection(uint64(len(k))) + 1 + len(v) + sovIntrospection(uint64(len(v))) baseI := i
i = encodeVarintIntrospection(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintIntrospection(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintIntrospection(dAtA, i, uint64(len(v))) i = encodeVarintIntrospection(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintIntrospection(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintIntrospection(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x2a
} }
} }
if len(m.Capabilities) > 0 { if len(m.Platforms) > 0 {
for _, s := range m.Capabilities { for iNdEx := len(m.Platforms) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0x32 {
i++ size, err := m.Platforms[iNdEx].MarshalToSizedBuffer(dAtA[:i])
l = len(s) if err != nil {
for l >= 1<<7 { return 0, err
dAtA[i] = uint8(uint64(l)&0x7f | 0x80) }
l >>= 7 i -= size
i++ i = encodeVarintIntrospection(dAtA, i, uint64(size))
} }
dAtA[i] = uint8(l) i--
i++ dAtA[i] = 0x22
i += copy(dAtA[i:], s)
} }
} }
if m.InitErr != nil { if len(m.Requires) > 0 {
dAtA[i] = 0x3a for iNdEx := len(m.Requires) - 1; iNdEx >= 0; iNdEx-- {
i++ i -= len(m.Requires[iNdEx])
i = encodeVarintIntrospection(dAtA, i, uint64(m.InitErr.Size())) copy(dAtA[i:], m.Requires[iNdEx])
n1, err := m.InitErr.MarshalTo(dAtA[i:]) i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Requires[iNdEx])))
if err != nil { i--
return 0, err dAtA[i] = 0x1a
} }
i += n1
} }
if m.XXX_unrecognized != nil { if len(m.ID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0x12
} }
return i, nil if len(m.Type) > 0 {
i -= len(m.Type)
copy(dAtA[i:], m.Type)
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Type)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *PluginsRequest) Marshal() (dAtA []byte, err error) { func (m *PluginsRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -510,35 +526,35 @@ func (m *PluginsRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *PluginsRequest) MarshalTo(dAtA []byte) (int, error) { func (m *PluginsRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PluginsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Filters) > 0 { if len(m.Filters) > 0 {
for _, s := range m.Filters { for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Filters[iNdEx])
copy(dAtA[i:], m.Filters[iNdEx])
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Filters[iNdEx])))
i--
dAtA[i] = 0xa dAtA[i] = 0xa
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *PluginsResponse) Marshal() (dAtA []byte, err error) { func (m *PluginsResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -546,32 +562,40 @@ func (m *PluginsResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *PluginsResponse) MarshalTo(dAtA []byte) (int, error) { func (m *PluginsResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PluginsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Plugins) > 0 { if len(m.Plugins) > 0 {
for _, msg := range m.Plugins { for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0xa {
i++ size, err := m.Plugins[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintIntrospection(dAtA, i, uint64(msg.Size())) if err != nil {
n, err := msg.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintIntrospection(dAtA, i, uint64(size))
} }
i += n i--
dAtA[i] = 0xa
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ServerResponse) Marshal() (dAtA []byte, err error) { func (m *ServerResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -579,30 +603,39 @@ func (m *ServerResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ServerResponse) MarshalTo(dAtA []byte) (int, error) { func (m *ServerResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ServerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.UUID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.UUID)))
i += copy(dAtA[i:], m.UUID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.UUID) > 0 {
i -= len(m.UUID)
copy(dAtA[i:], m.UUID)
i = encodeVarintIntrospection(dAtA, i, uint64(len(m.UUID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintIntrospection(dAtA []byte, offset int, v uint64) int { func encodeVarintIntrospection(dAtA []byte, offset int, v uint64) int {
offset -= sovIntrospection(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Plugin) Size() (n int) { func (m *Plugin) Size() (n int) {
if m == nil { if m == nil {
@ -707,14 +740,7 @@ func (m *ServerResponse) Size() (n int) {
} }
func sovIntrospection(x uint64) (n int) { func sovIntrospection(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozIntrospection(x uint64) (n int) { func sozIntrospection(x uint64) (n int) {
return sovIntrospection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovIntrospection(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -723,6 +749,11 @@ func (this *Plugin) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForPlatforms := "[]Platform{"
for _, f := range this.Platforms {
repeatedStringForPlatforms += fmt.Sprintf("%v", f) + ","
}
repeatedStringForPlatforms += "}"
keysForExports := make([]string, 0, len(this.Exports)) keysForExports := make([]string, 0, len(this.Exports))
for k, _ := range this.Exports { for k, _ := range this.Exports {
keysForExports = append(keysForExports, k) keysForExports = append(keysForExports, k)
@ -737,7 +768,7 @@ func (this *Plugin) String() string {
`Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Requires:` + fmt.Sprintf("%v", this.Requires) + `,`, `Requires:` + fmt.Sprintf("%v", this.Requires) + `,`,
`Platforms:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Platforms), "Platform", "types.Platform", 1), `&`, ``, 1) + `,`, `Platforms:` + repeatedStringForPlatforms + `,`,
`Exports:` + mapStringForExports + `,`, `Exports:` + mapStringForExports + `,`,
`Capabilities:` + fmt.Sprintf("%v", this.Capabilities) + `,`, `Capabilities:` + fmt.Sprintf("%v", this.Capabilities) + `,`,
`InitErr:` + strings.Replace(fmt.Sprintf("%v", this.InitErr), "Status", "rpc.Status", 1) + `,`, `InitErr:` + strings.Replace(fmt.Sprintf("%v", this.InitErr), "Status", "rpc.Status", 1) + `,`,
@ -761,8 +792,13 @@ func (this *PluginsResponse) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForPlugins := "[]Plugin{"
for _, f := range this.Plugins {
repeatedStringForPlugins += strings.Replace(strings.Replace(f.String(), "Plugin", "Plugin", 1), `&`, ``, 1) + ","
}
repeatedStringForPlugins += "}"
s := strings.Join([]string{`&PluginsResponse{`, s := strings.Join([]string{`&PluginsResponse{`,
`Plugins:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Plugins), "Plugin", "Plugin", 1), `&`, ``, 1) + `,`, `Plugins:` + repeatedStringForPlugins + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -1429,6 +1465,7 @@ func (m *ServerResponse) Unmarshal(dAtA []byte) error {
func skipIntrospection(dAtA []byte) (n int, err error) { func skipIntrospection(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1460,10 +1497,8 @@ func skipIntrospection(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1484,55 +1519,30 @@ func skipIntrospection(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthIntrospection return 0, ErrInvalidLengthIntrospection
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthIntrospection
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowIntrospection
}
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 := skipIntrospection(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthIntrospection
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupIntrospection
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthIntrospection
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthIntrospection = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthIntrospection = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowIntrospection = fmt.Errorf("proto: integer overflow") ErrIntOverflowIntrospection = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupIntrospection = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -11,8 +11,11 @@ import (
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -28,7 +31,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Lease is an object which retains resources while it exists. // Lease is an object which retains resources while it exists.
type Lease struct { type Lease struct {
@ -53,7 +56,7 @@ func (m *Lease) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Lease.Marshal(b, m, deterministic) return xxx_messageInfo_Lease.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -95,7 +98,7 @@ func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_CreateRequest.Marshal(b, m, deterministic) return xxx_messageInfo_CreateRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -134,7 +137,7 @@ func (m *CreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_CreateResponse.Marshal(b, m, deterministic) return xxx_messageInfo_CreateResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -178,7 +181,7 @@ func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -217,7 +220,7 @@ func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -256,7 +259,7 @@ func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -299,7 +302,7 @@ func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Resource.Marshal(b, m, deterministic) return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -339,7 +342,7 @@ func (m *AddResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_AddResourceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_AddResourceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -379,7 +382,7 @@ func (m *DeleteResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt
return xxx_messageInfo_DeleteResourceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DeleteResourceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -418,7 +421,7 @@ func (m *ListResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte
return xxx_messageInfo_ListResourcesRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ListResourcesRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -457,7 +460,7 @@ func (m *ListResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt
return xxx_messageInfo_ListResourcesResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ListResourcesResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -653,6 +656,29 @@ type LeasesServer interface {
ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error)
} }
// UnimplementedLeasesServer can be embedded to have forward compatible implementations.
type UnimplementedLeasesServer struct {
}
func (*UnimplementedLeasesServer) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (*UnimplementedLeasesServer) Delete(ctx context.Context, req *DeleteRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (*UnimplementedLeasesServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedLeasesServer) AddResource(ctx context.Context, req *AddResourceRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddResource not implemented")
}
func (*UnimplementedLeasesServer) DeleteResource(ctx context.Context, req *DeleteResourceRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteResource not implemented")
}
func (*UnimplementedLeasesServer) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented")
}
func RegisterLeasesServer(s *grpc.Server, srv LeasesServer) { func RegisterLeasesServer(s *grpc.Server, srv LeasesServer) {
s.RegisterService(&_Leases_serviceDesc, srv) s.RegisterService(&_Leases_serviceDesc, srv)
} }
@ -801,7 +827,7 @@ var _Leases_serviceDesc = grpc.ServiceDesc{
func (m *Lease) Marshal() (dAtA []byte, err error) { func (m *Lease) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -809,51 +835,60 @@ func (m *Lease) Marshal() (dAtA []byte, err error) {
} }
func (m *Lease) MarshalTo(dAtA []byte) (int, error) { func (m *Lease) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
dAtA[i] = 0x12
i++
i = encodeVarintLeases(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x1a
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovLeases(uint64(len(k))) + 1 + len(v) + sovLeases(uint64(len(v))) baseI := i
i = encodeVarintLeases(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintLeases(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintLeases(dAtA, i, uint64(len(v))) i = encodeVarintLeases(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintLeases(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintLeases(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x1a
} }
} }
if m.XXX_unrecognized != nil { n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
i += copy(dAtA[i:], m.XXX_unrecognized) if err1 != nil {
return 0, err1
} }
return i, nil i -= n1
i = encodeVarintLeases(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x12
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *CreateRequest) Marshal() (dAtA []byte, err error) { func (m *CreateRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -861,43 +896,52 @@ func (m *CreateRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateRequest) MarshalTo(dAtA []byte) (int, error) { func (m *CreateRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x1a
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovLeases(uint64(len(k))) + 1 + len(v) + sovLeases(uint64(len(v))) baseI := i
i = encodeVarintLeases(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintLeases(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintLeases(dAtA, i, uint64(len(v))) i = encodeVarintLeases(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintLeases(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintLeases(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x1a
} }
} }
if m.XXX_unrecognized != nil { if len(m.ID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *CreateResponse) Marshal() (dAtA []byte, err error) { func (m *CreateResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -905,30 +949,38 @@ func (m *CreateResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateResponse) MarshalTo(dAtA []byte) (int, error) { func (m *CreateResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Lease != nil {
dAtA[i] = 0xa
i++
i = encodeVarintLeases(dAtA, i, uint64(m.Lease.Size()))
n2, err := m.Lease.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if m.Lease != nil {
{
size, err := m.Lease.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintLeases(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *DeleteRequest) Marshal() (dAtA []byte, err error) { func (m *DeleteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -936,36 +988,43 @@ func (m *DeleteRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if m.Sync { if m.Sync {
dAtA[i] = 0x10 i--
i++
if m.Sync { if m.Sync {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x10
} }
if m.XXX_unrecognized != nil { if len(m.ID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *ListRequest) Marshal() (dAtA []byte, err error) { func (m *ListRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -973,35 +1032,35 @@ func (m *ListRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ListRequest) MarshalTo(dAtA []byte) (int, error) { func (m *ListRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Filters) > 0 { if len(m.Filters) > 0 {
for _, s := range m.Filters { for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Filters[iNdEx])
copy(dAtA[i:], m.Filters[iNdEx])
i = encodeVarintLeases(dAtA, i, uint64(len(m.Filters[iNdEx])))
i--
dAtA[i] = 0xa dAtA[i] = 0xa
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ListResponse) Marshal() (dAtA []byte, err error) { func (m *ListResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1009,32 +1068,40 @@ func (m *ListResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ListResponse) MarshalTo(dAtA []byte) (int, error) { func (m *ListResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Leases) > 0 { if len(m.Leases) > 0 {
for _, msg := range m.Leases { for iNdEx := len(m.Leases) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0xa {
i++ size, err := m.Leases[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintLeases(dAtA, i, uint64(msg.Size())) if err != nil {
n, err := msg.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintLeases(dAtA, i, uint64(size))
} }
i += n i--
dAtA[i] = 0xa
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *Resource) Marshal() (dAtA []byte, err error) { func (m *Resource) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1042,32 +1109,40 @@ func (m *Resource) Marshal() (dAtA []byte, err error) {
} }
func (m *Resource) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if len(m.Type) > 0 { if len(m.Type) > 0 {
dAtA[i] = 0x12 i -= len(m.Type)
i++ copy(dAtA[i:], m.Type)
i = encodeVarintLeases(dAtA, i, uint64(len(m.Type))) i = encodeVarintLeases(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.ID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *AddResourceRequest) Marshal() (dAtA []byte, err error) { func (m *AddResourceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1075,34 +1150,43 @@ func (m *AddResourceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *AddResourceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *AddResourceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AddResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
dAtA[i] = 0x12
i++
i = encodeVarintLeases(dAtA, i, uint64(m.Resource.Size()))
n3, err := m.Resource.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintLeases(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *DeleteResourceRequest) Marshal() (dAtA []byte, err error) { func (m *DeleteResourceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1110,34 +1194,43 @@ func (m *DeleteResourceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *DeleteResourceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *DeleteResourceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
dAtA[i] = 0x12
i++
i = encodeVarintLeases(dAtA, i, uint64(m.Resource.Size()))
n4, err := m.Resource.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintLeases(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) { func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1145,26 +1238,33 @@ func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ListResourcesRequest) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) { func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1172,36 +1272,46 @@ func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ListResourcesResponse) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Resources) > 0 { if len(m.Resources) > 0 {
for _, msg := range m.Resources { for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0xa {
i++ size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintLeases(dAtA, i, uint64(msg.Size())) if err != nil {
n, err := msg.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintLeases(dAtA, i, uint64(size))
} }
i += n i--
dAtA[i] = 0xa
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func encodeVarintLeases(dAtA []byte, offset int, v uint64) int { func encodeVarintLeases(dAtA []byte, offset int, v uint64) int {
offset -= sovLeases(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Lease) Size() (n int) { func (m *Lease) Size() (n int) {
if m == nil { if m == nil {
@ -1415,14 +1525,7 @@ func (m *ListResourcesResponse) Size() (n int) {
} }
func sovLeases(x uint64) (n int) { func sovLeases(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozLeases(x uint64) (n int) { func sozLeases(x uint64) (n int) {
return sovLeases(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovLeases(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1443,7 +1546,7 @@ func (this *Lease) String() string {
mapStringForLabels += "}" mapStringForLabels += "}"
s := strings.Join([]string{`&Lease{`, s := strings.Join([]string{`&Lease{`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`Labels:` + mapStringForLabels + `,`, `Labels:` + mapStringForLabels + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
@ -1477,7 +1580,7 @@ func (this *CreateResponse) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&CreateResponse{`, s := strings.Join([]string{`&CreateResponse{`,
`Lease:` + strings.Replace(fmt.Sprintf("%v", this.Lease), "Lease", "Lease", 1) + `,`, `Lease:` + strings.Replace(this.Lease.String(), "Lease", "Lease", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -1510,8 +1613,13 @@ func (this *ListResponse) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForLeases := "[]*Lease{"
for _, f := range this.Leases {
repeatedStringForLeases += strings.Replace(f.String(), "Lease", "Lease", 1) + ","
}
repeatedStringForLeases += "}"
s := strings.Join([]string{`&ListResponse{`, s := strings.Join([]string{`&ListResponse{`,
`Leases:` + strings.Replace(fmt.Sprintf("%v", this.Leases), "Lease", "Lease", 1) + `,`, `Leases:` + repeatedStringForLeases + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -1568,8 +1676,13 @@ func (this *ListResourcesResponse) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForResources := "[]Resource{"
for _, f := range this.Resources {
repeatedStringForResources += strings.Replace(strings.Replace(f.String(), "Resource", "Resource", 1), `&`, ``, 1) + ","
}
repeatedStringForResources += "}"
s := strings.Join([]string{`&ListResourcesResponse{`, s := strings.Join([]string{`&ListResourcesResponse{`,
`Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1), `&`, ``, 1) + `,`, `Resources:` + repeatedStringForResources + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -2945,6 +3058,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error {
func skipLeases(dAtA []byte) (n int, err error) { func skipLeases(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -2976,10 +3090,8 @@ func skipLeases(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3000,55 +3112,30 @@ func skipLeases(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthLeases return 0, ErrInvalidLengthLeases
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthLeases
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowLeases
}
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 := skipLeases(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthLeases
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupLeases
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthLeases
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthLeases = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthLeases = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowLeases = fmt.Errorf("proto: integer overflow") ErrIntOverflowLeases = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupLeases = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -10,8 +10,11 @@ import (
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -25,7 +28,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Namespace struct { type Namespace struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@ -54,7 +57,7 @@ func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Namespace.Marshal(b, m, deterministic) return xxx_messageInfo_Namespace.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -93,7 +96,7 @@ func (m *GetNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return xxx_messageInfo_GetNamespaceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_GetNamespaceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -132,7 +135,7 @@ func (m *GetNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte
return xxx_messageInfo_GetNamespaceResponse.Marshal(b, m, deterministic) return xxx_messageInfo_GetNamespaceResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -171,7 +174,7 @@ func (m *ListNamespacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt
return xxx_messageInfo_ListNamespacesRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ListNamespacesRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -210,7 +213,7 @@ func (m *ListNamespacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]by
return xxx_messageInfo_ListNamespacesResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ListNamespacesResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -249,7 +252,7 @@ func (m *CreateNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]by
return xxx_messageInfo_CreateNamespaceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_CreateNamespaceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -288,7 +291,7 @@ func (m *CreateNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]b
return xxx_messageInfo_CreateNamespaceResponse.Marshal(b, m, deterministic) return xxx_messageInfo_CreateNamespaceResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -342,7 +345,7 @@ func (m *UpdateNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]by
return xxx_messageInfo_UpdateNamespaceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_UpdateNamespaceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -381,7 +384,7 @@ func (m *UpdateNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]b
return xxx_messageInfo_UpdateNamespaceResponse.Marshal(b, m, deterministic) return xxx_messageInfo_UpdateNamespaceResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -420,7 +423,7 @@ func (m *DeleteNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]by
return xxx_messageInfo_DeleteNamespaceRequest.Marshal(b, m, deterministic) return xxx_messageInfo_DeleteNamespaceRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -577,6 +580,26 @@ type NamespacesServer interface {
Delete(context.Context, *DeleteNamespaceRequest) (*types.Empty, error) Delete(context.Context, *DeleteNamespaceRequest) (*types.Empty, error)
} }
// UnimplementedNamespacesServer can be embedded to have forward compatible implementations.
type UnimplementedNamespacesServer struct {
}
func (*UnimplementedNamespacesServer) Get(ctx context.Context, req *GetNamespaceRequest) (*GetNamespaceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedNamespacesServer) List(ctx context.Context, req *ListNamespacesRequest) (*ListNamespacesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedNamespacesServer) Create(ctx context.Context, req *CreateNamespaceRequest) (*CreateNamespaceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (*UnimplementedNamespacesServer) Update(ctx context.Context, req *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (*UnimplementedNamespacesServer) Delete(ctx context.Context, req *DeleteNamespaceRequest) (*types.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func RegisterNamespacesServer(s *grpc.Server, srv NamespacesServer) { func RegisterNamespacesServer(s *grpc.Server, srv NamespacesServer) {
s.RegisterService(&_Namespaces_serviceDesc, srv) s.RegisterService(&_Namespaces_serviceDesc, srv)
} }
@ -703,7 +726,7 @@ var _Namespaces_serviceDesc = grpc.ServiceDesc{
func (m *Namespace) Marshal() (dAtA []byte, err error) { func (m *Namespace) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -711,43 +734,52 @@ func (m *Namespace) Marshal() (dAtA []byte, err error) {
} }
func (m *Namespace) MarshalTo(dAtA []byte) (int, error) { func (m *Namespace) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Namespace) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
} }
if len(m.Labels) > 0 { if len(m.Labels) > 0 {
for k, _ := range m.Labels { for k := range m.Labels {
dAtA[i] = 0x12
i++
v := m.Labels[k] v := m.Labels[k]
mapSize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v))) baseI := i
i = encodeVarintNamespace(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(v))) i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x12
} }
} }
if m.XXX_unrecognized != nil { if len(m.Name) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func (m *GetNamespaceRequest) Marshal() (dAtA []byte, err error) { func (m *GetNamespaceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -755,26 +787,33 @@ func (m *GetNamespaceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *GetNamespaceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *GetNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *GetNamespaceResponse) Marshal() (dAtA []byte, err error) { func (m *GetNamespaceResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -782,28 +821,36 @@ func (m *GetNamespaceResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *GetNamespaceResponse) MarshalTo(dAtA []byte) (int, error) { func (m *GetNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(m.Namespace.Size()))
n1, err := m.Namespace.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *ListNamespacesRequest) Marshal() (dAtA []byte, err error) { func (m *ListNamespacesRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -811,26 +858,33 @@ func (m *ListNamespacesRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *ListNamespacesRequest) MarshalTo(dAtA []byte) (int, error) { func (m *ListNamespacesRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListNamespacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Filter) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Filter)))
i += copy(dAtA[i:], m.Filter)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Filter) > 0 {
i -= len(m.Filter)
copy(dAtA[i:], m.Filter)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Filter)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ListNamespacesResponse) Marshal() (dAtA []byte, err error) { func (m *ListNamespacesResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -838,32 +892,40 @@ func (m *ListNamespacesResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *ListNamespacesResponse) MarshalTo(dAtA []byte) (int, error) { func (m *ListNamespacesResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListNamespacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Namespaces) > 0 { if len(m.Namespaces) > 0 {
for _, msg := range m.Namespaces { for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- {
dAtA[i] = 0xa {
i++ size, err := m.Namespaces[iNdEx].MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintNamespace(dAtA, i, uint64(msg.Size())) if err != nil {
n, err := msg.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
} }
i += n i--
dAtA[i] = 0xa
} }
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *CreateNamespaceRequest) Marshal() (dAtA []byte, err error) { func (m *CreateNamespaceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -871,28 +933,36 @@ func (m *CreateNamespaceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *CreateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(m.Namespace.Size()))
n2, err := m.Namespace.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *CreateNamespaceResponse) Marshal() (dAtA []byte, err error) { func (m *CreateNamespaceResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -900,28 +970,36 @@ func (m *CreateNamespaceResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) { func (m *CreateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(m.Namespace.Size()))
n3, err := m.Namespace.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *UpdateNamespaceRequest) Marshal() (dAtA []byte, err error) { func (m *UpdateNamespaceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -929,38 +1007,48 @@ func (m *UpdateNamespaceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *UpdateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *UpdateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *UpdateNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa if m.XXX_unrecognized != nil {
i++ i -= len(m.XXX_unrecognized)
i = encodeVarintNamespace(dAtA, i, uint64(m.Namespace.Size())) copy(dAtA[i:], m.XXX_unrecognized)
n4, err := m.Namespace.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
} }
i += n4
if m.UpdateMask != nil { if m.UpdateMask != nil {
{
size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12 dAtA[i] = 0x12
i++ }
i = encodeVarintNamespace(dAtA, i, uint64(m.UpdateMask.Size())) {
n5, err := m.UpdateMask.MarshalTo(dAtA[i:]) size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n5 i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
} }
if m.XXX_unrecognized != nil { i--
i += copy(dAtA[i:], m.XXX_unrecognized) dAtA[i] = 0xa
} return len(dAtA) - i, nil
return i, nil
} }
func (m *UpdateNamespaceResponse) Marshal() (dAtA []byte, err error) { func (m *UpdateNamespaceResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -968,28 +1056,36 @@ func (m *UpdateNamespaceResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *UpdateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) { func (m *UpdateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *UpdateNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(m.Namespace.Size()))
n6, err := m.Namespace.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil {
size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintNamespace(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func (m *DeleteNamespaceRequest) Marshal() (dAtA []byte, err error) { func (m *DeleteNamespaceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -997,30 +1093,39 @@ func (m *DeleteNamespaceRequest) Marshal() (dAtA []byte, err error) {
} }
func (m *DeleteNamespaceRequest) MarshalTo(dAtA []byte) (int, error) { func (m *DeleteNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int { func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int {
offset -= sovNamespace(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Namespace) Size() (n int) { func (m *Namespace) Size() (n int) {
if m == nil { if m == nil {
@ -1187,14 +1292,7 @@ func (m *DeleteNamespaceRequest) Size() (n int) {
} }
func sovNamespace(x uint64) (n int) { func sovNamespace(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozNamespace(x uint64) (n int) { func sozNamespace(x uint64) (n int) {
return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1258,8 +1356,13 @@ func (this *ListNamespacesResponse) String() string {
if this == nil { if this == nil {
return "nil" return "nil"
} }
repeatedStringForNamespaces := "[]Namespace{"
for _, f := range this.Namespaces {
repeatedStringForNamespaces += strings.Replace(strings.Replace(f.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + ","
}
repeatedStringForNamespaces += "}"
s := strings.Join([]string{`&ListNamespacesResponse{`, s := strings.Join([]string{`&ListNamespacesResponse{`,
`Namespaces:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Namespaces), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`, `Namespaces:` + repeatedStringForNamespaces + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -2362,6 +2465,7 @@ func (m *DeleteNamespaceRequest) Unmarshal(dAtA []byte) error {
func skipNamespace(dAtA []byte) (n int, err error) { func skipNamespace(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -2393,10 +2497,8 @@ func skipNamespace(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -2417,55 +2519,30 @@ func skipNamespace(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthNamespace return 0, ErrInvalidLengthNamespace
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowNamespace
}
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 := skipNamespace(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupNamespace
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthNamespace
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow") ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupNamespace = fmt.Errorf("proto: unexpected end of group")
) )

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ service Snapshots {
rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse); rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse);
rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse); rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse);
rpc Usage(UsageRequest) returns (UsageResponse); rpc Usage(UsageRequest) returns (UsageResponse);
rpc Cleanup(CleanupRequest) returns (google.protobuf.Empty);
} }
message PrepareSnapshotRequest { message PrepareSnapshotRequest {
@ -133,6 +134,18 @@ message UpdateSnapshotResponse {
message ListSnapshotsRequest{ message ListSnapshotsRequest{
string snapshotter = 1; string snapshotter = 1;
// Filters contains one or more filters using the syntax defined in the
// containerd filter package.
//
// The returned result will be those that match any of the provided
// filters. Expanded, images that match the following will be
// returned:
//
// filters[0] or filters[1] or ... or filters[n-1] or filters[n]
//
// If filters is zero-length or nil, all items will be returned.
repeated string filters = 2;
} }
message ListSnapshotsResponse { message ListSnapshotsResponse {
@ -148,3 +161,7 @@ message UsageResponse {
int64 size = 1; int64 size = 1;
int64 inodes = 2; int64 inodes = 2;
} }
message CleanupRequest {
string snapshotter = 1;
}

File diff suppressed because it is too large Load diff

View file

@ -9,8 +9,11 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -24,7 +27,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type VersionResponse struct { type VersionResponse struct {
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
@ -47,7 +50,7 @@ func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic) return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -131,6 +134,14 @@ type VersionServer interface {
Version(context.Context, *types.Empty) (*VersionResponse, error) Version(context.Context, *types.Empty) (*VersionResponse, error)
} }
// UnimplementedVersionServer can be embedded to have forward compatible implementations.
type UnimplementedVersionServer struct {
}
func (*UnimplementedVersionServer) Version(ctx context.Context, req *types.Empty) (*VersionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}
func RegisterVersionServer(s *grpc.Server, srv VersionServer) { func RegisterVersionServer(s *grpc.Server, srv VersionServer) {
s.RegisterService(&_Version_serviceDesc, srv) s.RegisterService(&_Version_serviceDesc, srv)
} }
@ -169,7 +180,7 @@ var _Version_serviceDesc = grpc.ServiceDesc{
func (m *VersionResponse) Marshal() (dAtA []byte, err error) { func (m *VersionResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -177,36 +188,46 @@ func (m *VersionResponse) Marshal() (dAtA []byte, err error) {
} }
func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) { func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *VersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Version) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintVersion(dAtA, i, uint64(len(m.Version)))
i += copy(dAtA[i:], m.Version)
} }
if len(m.Revision) > 0 { if len(m.Revision) > 0 {
dAtA[i] = 0x12 i -= len(m.Revision)
i++ copy(dAtA[i:], m.Revision)
i = encodeVarintVersion(dAtA, i, uint64(len(m.Revision))) i = encodeVarintVersion(dAtA, i, uint64(len(m.Revision)))
i += copy(dAtA[i:], m.Revision) i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if len(m.Version) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Version)
copy(dAtA[i:], m.Version)
i = encodeVarintVersion(dAtA, i, uint64(len(m.Version)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintVersion(dAtA []byte, offset int, v uint64) int { func encodeVarintVersion(dAtA []byte, offset int, v uint64) int {
offset -= sovVersion(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *VersionResponse) Size() (n int) { func (m *VersionResponse) Size() (n int) {
if m == nil { if m == nil {
@ -229,14 +250,7 @@ func (m *VersionResponse) Size() (n int) {
} }
func sovVersion(x uint64) (n int) { func sovVersion(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozVersion(x uint64) (n int) { func sozVersion(x uint64) (n int) {
return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -382,6 +396,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error {
func skipVersion(dAtA []byte) (n int, err error) { func skipVersion(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -413,10 +428,8 @@ func skipVersion(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -437,55 +450,30 @@ func skipVersion(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthVersion return 0, ErrInvalidLengthVersion
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthVersion
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVersion
}
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 := skipVersion(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthVersion
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupVersion
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthVersion
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow") ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupVersion = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -10,6 +10,7 @@ import (
github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -23,7 +24,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Descriptor describes a blob in a content store. // Descriptor describes a blob in a content store.
// //
@ -53,7 +54,7 @@ func (m *Descriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Descriptor.Marshal(b, m, deterministic) return xxx_messageInfo_Descriptor.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -108,7 +109,7 @@ var fileDescriptor_37f958df3707db9e = []byte{
func (m *Descriptor) Marshal() (dAtA []byte, err error) { func (m *Descriptor) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -116,58 +117,70 @@ func (m *Descriptor) Marshal() (dAtA []byte, err error) {
} }
func (m *Descriptor) MarshalTo(dAtA []byte) (int, error) { func (m *Descriptor) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Descriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.MediaType) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.MediaType)))
i += copy(dAtA[i:], m.MediaType)
}
if len(m.Digest) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest)))
i += copy(dAtA[i:], m.Digest)
}
if m.Size_ != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_))
} }
if len(m.Annotations) > 0 { if len(m.Annotations) > 0 {
for k, _ := range m.Annotations { for k := range m.Annotations {
dAtA[i] = 0x2a
i++
v := m.Annotations[k] v := m.Annotations[k]
mapSize := 1 + len(k) + sovDescriptor(uint64(len(k))) + 1 + len(v) + sovDescriptor(uint64(len(v))) baseI := i
i = encodeVarintDescriptor(dAtA, i, uint64(mapSize)) i -= len(v)
dAtA[i] = 0xa copy(dAtA[i:], v)
i++
i = encodeVarintDescriptor(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintDescriptor(dAtA, i, uint64(len(v))) i = encodeVarintDescriptor(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintDescriptor(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintDescriptor(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x2a
} }
} }
if m.XXX_unrecognized != nil { if m.Size_ != 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_))
i--
dAtA[i] = 0x18
} }
return i, nil if len(m.Digest) > 0 {
i -= len(m.Digest)
copy(dAtA[i:], m.Digest)
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest)))
i--
dAtA[i] = 0x12
}
if len(m.MediaType) > 0 {
i -= len(m.MediaType)
copy(dAtA[i:], m.MediaType)
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.MediaType)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintDescriptor(dAtA []byte, offset int, v uint64) int { func encodeVarintDescriptor(dAtA []byte, offset int, v uint64) int {
offset -= sovDescriptor(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Descriptor) Size() (n int) { func (m *Descriptor) Size() (n int) {
if m == nil { if m == nil {
@ -201,14 +214,7 @@ func (m *Descriptor) Size() (n int) {
} }
func sovDescriptor(x uint64) (n int) { func sovDescriptor(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozDescriptor(x uint64) (n int) { func sozDescriptor(x uint64) (n int) {
return sovDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -512,6 +518,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error {
func skipDescriptor(dAtA []byte) (n int, err error) { func skipDescriptor(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -543,10 +550,8 @@ func skipDescriptor(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -567,55 +572,30 @@ func skipDescriptor(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthDescriptor return 0, ErrInvalidLengthDescriptor
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthDescriptor
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowDescriptor
}
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 := skipDescriptor(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthDescriptor
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupDescriptor
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthDescriptor
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthDescriptor = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthDescriptor = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowDescriptor = fmt.Errorf("proto: integer overflow") ErrIntOverflowDescriptor = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupDescriptor = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -10,6 +10,7 @@ import (
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -25,7 +26,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Metric struct { type Metric struct {
Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
@ -49,7 +50,7 @@ func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Metric.Marshal(b, m, deterministic) return xxx_messageInfo_Metric.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -100,7 +101,7 @@ var fileDescriptor_8d594d87edf6e6bc = []byte{
func (m *Metric) Marshal() (dAtA []byte, err error) { func (m *Metric) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -108,48 +109,59 @@ func (m *Metric) Marshal() (dAtA []byte, err error) {
} }
func (m *Metric) MarshalTo(dAtA []byte) (int, error) { func (m *Metric) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
dAtA[i] = 0xa if m.XXX_unrecognized != nil {
i++ i -= len(m.XXX_unrecognized)
i = encodeVarintMetrics(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) copy(dAtA[i:], m.XXX_unrecognized)
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if len(m.ID) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintMetrics(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if m.Data != nil { if m.Data != nil {
dAtA[i] = 0x1a {
i++ size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintMetrics(dAtA, i, uint64(m.Data.Size())) if err != nil {
n2, err := m.Data.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintMetrics(dAtA, i, uint64(size))
} }
i += n2 i--
dAtA[i] = 0x1a
} }
if m.XXX_unrecognized != nil { if len(m.ID) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintMetrics(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0x12
} }
return i, nil n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintMetrics(dAtA, i, uint64(n2))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
} }
func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int { func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
offset -= sovMetrics(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Metric) Size() (n int) { func (m *Metric) Size() (n int) {
if m == nil { if m == nil {
@ -174,14 +186,7 @@ func (m *Metric) Size() (n int) {
} }
func sovMetrics(x uint64) (n int) { func sovMetrics(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozMetrics(x uint64) (n int) { func sozMetrics(x uint64) (n int) {
return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -191,7 +196,7 @@ func (this *Metric) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&Metric{`, s := strings.Join([]string{`&Metric{`,
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "Any", "types.Any", 1) + `,`, `Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "Any", "types.Any", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
@ -365,6 +370,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error {
func skipMetrics(dAtA []byte) (n int, err error) { func skipMetrics(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -396,10 +402,8 @@ func skipMetrics(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -420,55 +424,30 @@ func skipMetrics(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthMetrics return 0, ErrInvalidLengthMetrics
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthMetrics
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMetrics
}
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 := skipMetrics(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthMetrics
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupMetrics
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthMetrics
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow") ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupMetrics = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -8,6 +8,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Mount describes mounts for a container. // Mount describes mounts for a container.
// //
@ -58,7 +59,7 @@ func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Mount.Marshal(b, m, deterministic) return xxx_messageInfo_Mount.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -105,7 +106,7 @@ var fileDescriptor_920196890d4a7b9f = []byte{
func (m *Mount) Marshal() (dAtA []byte, err error) { func (m *Mount) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -113,57 +114,62 @@ func (m *Mount) Marshal() (dAtA []byte, err error) {
} }
func (m *Mount) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if len(m.Type) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintMount(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type)
}
if len(m.Source) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintMount(dAtA, i, uint64(len(m.Source)))
i += copy(dAtA[i:], m.Source)
}
if len(m.Target) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintMount(dAtA, i, uint64(len(m.Target)))
i += copy(dAtA[i:], m.Target)
} }
if len(m.Options) > 0 { if len(m.Options) > 0 {
for _, s := range m.Options { for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Options[iNdEx])
copy(dAtA[i:], m.Options[iNdEx])
i = encodeVarintMount(dAtA, i, uint64(len(m.Options[iNdEx])))
i--
dAtA[i] = 0x22 dAtA[i] = 0x22
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
} }
if m.XXX_unrecognized != nil { if len(m.Target) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Target)
copy(dAtA[i:], m.Target)
i = encodeVarintMount(dAtA, i, uint64(len(m.Target)))
i--
dAtA[i] = 0x1a
} }
return i, nil if len(m.Source) > 0 {
i -= len(m.Source)
copy(dAtA[i:], m.Source)
i = encodeVarintMount(dAtA, i, uint64(len(m.Source)))
i--
dAtA[i] = 0x12
}
if len(m.Type) > 0 {
i -= len(m.Type)
copy(dAtA[i:], m.Type)
i = encodeVarintMount(dAtA, i, uint64(len(m.Type)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintMount(dAtA []byte, offset int, v uint64) int { func encodeVarintMount(dAtA []byte, offset int, v uint64) int {
offset -= sovMount(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Mount) Size() (n int) { func (m *Mount) Size() (n int) {
if m == nil { if m == nil {
@ -196,14 +202,7 @@ func (m *Mount) Size() (n int) {
} }
func sovMount(x uint64) (n int) { func sovMount(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozMount(x uint64) (n int) { func sozMount(x uint64) (n int) {
return sovMount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovMount(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -415,6 +414,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error {
func skipMount(dAtA []byte) (n int, err error) { func skipMount(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -446,10 +446,8 @@ func skipMount(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -470,55 +468,30 @@ func skipMount(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthMount return 0, ErrInvalidLengthMount
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthMount
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMount
}
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 := skipMount(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthMount
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupMount
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthMount
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthMount = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthMount = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowMount = fmt.Errorf("proto: integer overflow") ErrIntOverflowMount = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupMount = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -8,6 +8,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Platform follows the structure of the OCI platform specification, from // Platform follows the structure of the OCI platform specification, from
// descriptors. // descriptors.
@ -47,7 +48,7 @@ func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Platform.Marshal(b, m, deterministic) return xxx_messageInfo_Platform.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -94,7 +95,7 @@ var fileDescriptor_24ba7a4b83e2367e = []byte{
func (m *Platform) Marshal() (dAtA []byte, err error) { func (m *Platform) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -102,42 +103,53 @@ func (m *Platform) Marshal() (dAtA []byte, err error) {
} }
func (m *Platform) MarshalTo(dAtA []byte) (int, 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 _ = i
var l int var l int
_ = l _ = l
if len(m.OS) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintPlatform(dAtA, i, uint64(len(m.OS)))
i += copy(dAtA[i:], m.OS)
}
if len(m.Architecture) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintPlatform(dAtA, i, uint64(len(m.Architecture)))
i += copy(dAtA[i:], m.Architecture)
} }
if len(m.Variant) > 0 { if len(m.Variant) > 0 {
dAtA[i] = 0x1a i -= len(m.Variant)
i++ copy(dAtA[i:], m.Variant)
i = encodeVarintPlatform(dAtA, i, uint64(len(m.Variant))) i = encodeVarintPlatform(dAtA, i, uint64(len(m.Variant)))
i += copy(dAtA[i:], m.Variant) i--
dAtA[i] = 0x1a
} }
if m.XXX_unrecognized != nil { if len(m.Architecture) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.Architecture)
copy(dAtA[i:], m.Architecture)
i = encodeVarintPlatform(dAtA, i, uint64(len(m.Architecture)))
i--
dAtA[i] = 0x12
} }
return i, nil if len(m.OS) > 0 {
i -= len(m.OS)
copy(dAtA[i:], m.OS)
i = encodeVarintPlatform(dAtA, i, uint64(len(m.OS)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintPlatform(dAtA []byte, offset int, v uint64) int { func encodeVarintPlatform(dAtA []byte, offset int, v uint64) int {
offset -= sovPlatform(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Platform) Size() (n int) { func (m *Platform) Size() (n int) {
if m == nil { if m == nil {
@ -164,14 +176,7 @@ func (m *Platform) Size() (n int) {
} }
func sovPlatform(x uint64) (n int) { func sovPlatform(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozPlatform(x uint64) (n int) { func sozPlatform(x uint64) (n int) {
return sovPlatform(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovPlatform(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -350,6 +355,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error {
func skipPlatform(dAtA []byte) (n int, err error) { func skipPlatform(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -381,10 +387,8 @@ func skipPlatform(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -405,55 +409,30 @@ func skipPlatform(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthPlatform return 0, ErrInvalidLengthPlatform
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthPlatform
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPlatform
}
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 := skipPlatform(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthPlatform
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupPlatform
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthPlatform
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthPlatform = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthPlatform = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowPlatform = fmt.Errorf("proto: integer overflow") ErrIntOverflowPlatform = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupPlatform = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -10,6 +10,7 @@ import (
types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
time "time" time "time"
@ -25,7 +26,7 @@ var _ = time.Kitchen
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Status int32 type Status int32
@ -93,7 +94,7 @@ func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Process.Marshal(b, m, deterministic) return xxx_messageInfo_Process.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -137,7 +138,7 @@ func (m *ProcessInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_ProcessInfo.Marshal(b, m, deterministic) return xxx_messageInfo_ProcessInfo.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -208,7 +209,7 @@ var fileDescriptor_391ef18c8ab0dc16 = []byte{
func (m *Process) Marshal() (dAtA []byte, err error) { func (m *Process) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -216,83 +217,94 @@ func (m *Process) Marshal() (dAtA []byte, err error) {
} }
func (m *Process) MarshalTo(dAtA []byte) (int, error) { func (m *Process) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Process) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ContainerID) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i += copy(dAtA[i:], m.ContainerID)
} }
if len(m.ID) > 0 { n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
dAtA[i] = 0x12 if err1 != nil {
i++ return 0, err1
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
} }
if m.Pid != 0 { i -= n1
dAtA[i] = 0x18 i = encodeVarintTask(dAtA, i, uint64(n1))
i++ i--
i = encodeVarintTask(dAtA, i, uint64(m.Pid)) dAtA[i] = 0x52
} if m.ExitStatus != 0 {
if m.Status != 0 { i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
dAtA[i] = 0x20 i--
i++ dAtA[i] = 0x48
i = encodeVarintTask(dAtA, i, uint64(m.Status))
}
if len(m.Stdin) > 0 {
dAtA[i] = 0x2a
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
i += copy(dAtA[i:], m.Stdin)
}
if len(m.Stdout) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
i += copy(dAtA[i:], m.Stdout)
}
if len(m.Stderr) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
i += copy(dAtA[i:], m.Stderr)
} }
if m.Terminal { if m.Terminal {
dAtA[i] = 0x40 i--
i++
if m.Terminal { if m.Terminal {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x40
} }
if m.ExitStatus != 0 { if len(m.Stderr) > 0 {
dAtA[i] = 0x48 i -= len(m.Stderr)
i++ copy(dAtA[i:], m.Stderr)
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
i--
dAtA[i] = 0x3a
} }
dAtA[i] = 0x52 if len(m.Stdout) > 0 {
i++ i -= len(m.Stdout)
i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) copy(dAtA[i:], m.Stdout)
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
if err != nil { i--
return 0, err dAtA[i] = 0x32
} }
i += n1 if len(m.Stdin) > 0 {
if m.XXX_unrecognized != nil { i -= len(m.Stdin)
i += copy(dAtA[i:], m.XXX_unrecognized) copy(dAtA[i:], m.Stdin)
i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
i--
dAtA[i] = 0x2a
} }
return i, nil if m.Status != 0 {
i = encodeVarintTask(dAtA, i, uint64(m.Status))
i--
dAtA[i] = 0x20
}
if m.Pid != 0 {
i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x18
}
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0x12
}
if len(m.ContainerID) > 0 {
i -= len(m.ContainerID)
copy(dAtA[i:], m.ContainerID)
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *ProcessInfo) Marshal() (dAtA []byte, err error) { func (m *ProcessInfo) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -300,39 +312,49 @@ func (m *ProcessInfo) Marshal() (dAtA []byte, err error) {
} }
func (m *ProcessInfo) MarshalTo(dAtA []byte) (int, error) { func (m *ProcessInfo) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ProcessInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Pid != 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintTask(dAtA, i, uint64(m.Pid))
} }
if m.Info != nil { if m.Info != nil {
dAtA[i] = 0x12 {
i++ size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintTask(dAtA, i, uint64(m.Info.Size())) if err != nil {
n2, err := m.Info.MarshalTo(dAtA[i:]) return 0, err
if err != nil { }
return 0, err i -= size
i = encodeVarintTask(dAtA, i, uint64(size))
} }
i += n2 i--
dAtA[i] = 0x12
} }
if m.XXX_unrecognized != nil { if m.Pid != 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i = encodeVarintTask(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x8
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintTask(dAtA []byte, offset int, v uint64) int { func encodeVarintTask(dAtA []byte, offset int, v uint64) int {
offset -= sovTask(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Process) Size() (n int) { func (m *Process) Size() (n int) {
if m == nil { if m == nil {
@ -400,14 +422,7 @@ func (m *ProcessInfo) Size() (n int) {
} }
func sovTask(x uint64) (n int) { func sovTask(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozTask(x uint64) (n int) { func sozTask(x uint64) (n int) {
return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -426,7 +441,7 @@ func (this *Process) String() string {
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`, `}`,
}, "") }, "")
@ -888,6 +903,7 @@ func (m *ProcessInfo) Unmarshal(dAtA []byte) error {
func skipTask(dAtA []byte) (n int, err error) { func skipTask(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -919,10 +935,8 @@ func skipTask(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -943,55 +957,30 @@ func skipTask(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthTask return 0, ErrInvalidLengthTask
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTask
}
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 := skipTask(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupTask
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthTask
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTask = fmt.Errorf("proto: integer overflow") ErrIntOverflowTask = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupTask = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -176,7 +176,10 @@ func copyDirInfo(fi os.FileInfo, path string) error {
return errors.Wrapf(err, "failed to chmod %s", path) return errors.Wrapf(err, "failed to chmod %s", path)
} }
timespec := []unix.Timespec{unix.Timespec(fs.StatAtime(st)), unix.Timespec(fs.StatMtime(st))} timespec := []unix.Timespec{
unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatAtime(st))),
unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatMtime(st))),
}
if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil { if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil {
return errors.Wrapf(err, "failed to utime %s", path) return errors.Wrapf(err, "failed to utime %s", path)
} }

View file

@ -54,6 +54,7 @@ import (
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/services/introspection"
"github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots"
snproxy "github.com/containerd/containerd/snapshots/proxy" snproxy "github.com/containerd/containerd/snapshots/proxy"
"github.com/containerd/typeurl" "github.com/containerd/typeurl"
@ -63,6 +64,7 @@ import (
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors" "github.com/pkg/errors"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/health/grpc_health_v1"
) )
@ -109,11 +111,16 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
c.services = *copts.services c.services = *copts.services
} }
if address != "" { if address != "" {
backoffConfig := backoff.DefaultConfig
backoffConfig.MaxDelay = 3 * time.Second
connParams := grpc.ConnectParams{
Backoff: backoffConfig,
}
gopts := []grpc.DialOption{ gopts := []grpc.DialOption{
grpc.WithBlock(), grpc.WithBlock(),
grpc.WithInsecure(), grpc.WithInsecure(),
grpc.FailOnNonTempDialError(true), grpc.FailOnNonTempDialError(true),
grpc.WithBackoffMaxDelay(3 * time.Second), grpc.WithConnectParams(connParams),
grpc.WithContextDialer(dialer.ContextDialer), grpc.WithContextDialer(dialer.ContextDialer),
// TODO(stevvooe): We may need to allow configuration of this on the client. // TODO(stevvooe): We may need to allow configuration of this on the client.
@ -389,7 +396,11 @@ func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (imag
} }
defer done(ctx) defer done(ctx)
return c.fetch(ctx, fetchCtx, ref, 0) img, err := c.fetch(ctx, fetchCtx, ref, 0)
if err != nil {
return images.Image{}, err
}
return c.createNewImage(ctx, img)
} }
// Push uploads the provided content to a remote resource // Push uploads the provided content to a remote resource
@ -621,10 +632,13 @@ func (c *Client) DiffService() DiffService {
} }
// IntrospectionService returns the underlying Introspection Client // IntrospectionService returns the underlying Introspection Client
func (c *Client) IntrospectionService() introspectionapi.IntrospectionClient { func (c *Client) IntrospectionService() introspection.Service {
if c.introspectionService != nil {
return c.introspectionService
}
c.connMu.Lock() c.connMu.Lock()
defer c.connMu.Unlock() defer c.connMu.Unlock()
return introspectionapi.NewIntrospectionClient(c.conn) return introspection.NewIntrospectionServiceFromClient(introspectionapi.NewIntrospectionClient(c.conn))
} }
// LeasesService returns the underlying Leases Client // LeasesService returns the underlying Leases Client

View file

@ -130,6 +130,14 @@ func WithPullUnpack(_ *Client, c *RemoteContext) error {
return nil return nil
} }
// WithUnpackOpts is used to add unpack options to the unpacker.
func WithUnpackOpts(opts []UnpackOpt) RemoteOpt {
return func(_ *Client, c *RemoteContext) error {
c.UnpackOpts = append(c.UnpackOpts, opts...)
return nil
}
}
// WithPullSnapshotter specifies snapshotter name used for unpacking // WithPullSnapshotter specifies snapshotter name used for unpacking
func WithPullSnapshotter(snapshotterName string) RemoteOpt { func WithPullSnapshotter(snapshotterName string) RemoteOpt {
return func(_ *Client, c *RemoteContext) error { return func(_ *Client, c *RemoteContext) error {

View file

@ -36,6 +36,7 @@ import (
prototypes "github.com/gogo/protobuf/types" prototypes "github.com/gogo/protobuf/types"
ver "github.com/opencontainers/image-spec/specs-go" ver "github.com/opencontainers/image-spec/specs-go"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -242,7 +243,17 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N
if err != nil { if err != nil {
return nil, err return nil, err
} }
spec, err := c.Spec(ctx)
if err != nil {
return nil, err
}
for _, m := range mounts { for _, m := range mounts {
if spec.Linux != nil && spec.Linux.MountLabel != "" {
context := label.FormatMountLabel("", spec.Linux.MountLabel)
if context != "" {
m.Options = append(m.Options, context)
}
}
request.Rootfs = append(request.Rootfs, &types.Mount{ request.Rootfs = append(request.Rootfs, &types.Mount{
Type: m.Type, Type: m.Type,
Source: m.Source, Source: m.Source,

View file

@ -225,7 +225,7 @@ func validateTopic(topic string) error {
} }
func validateEnvelope(envelope *events.Envelope) error { func validateEnvelope(envelope *events.Envelope) error {
if err := namespaces.Validate(envelope.Namespace); err != nil { if err := identifiers.Validate(envelope.Namespace); err != nil {
return errors.Wrapf(err, "event envelope has invalid namespace") return errors.Wrapf(err, "event envelope has invalid namespace")
} }

View file

@ -209,6 +209,8 @@ func (p *parser) field() (string, error) {
return s, nil return s, nil
case tokenQuoted: case tokenQuoted:
return p.unquote(pos, s, false) return p.unquote(pos, s, false)
case tokenIllegal:
return "", p.mkerr(pos, p.scanner.err)
} }
return "", p.mkerr(pos, "expected field or quoted") return "", p.mkerr(pos, "expected field or quoted")
@ -228,6 +230,8 @@ func (p *parser) operator() (operator, error) {
default: default:
return 0, p.mkerr(pos, "unsupported operator %q", s) return 0, p.mkerr(pos, "unsupported operator %q", s)
} }
case tokenIllegal:
return 0, p.mkerr(pos, p.scanner.err)
} }
return 0, p.mkerr(pos, `expected an operator ("=="|"!="|"~=")`) return 0, p.mkerr(pos, `expected an operator ("=="|"!="|"~=")`)
@ -241,6 +245,8 @@ func (p *parser) value(allowAltQuotes bool) (string, error) {
return s, nil return s, nil
case tokenQuoted: case tokenQuoted:
return p.unquote(pos, s, allowAltQuotes) return p.unquote(pos, s, allowAltQuotes)
case tokenIllegal:
return "", p.mkerr(pos, p.scanner.err)
} }
return "", p.mkerr(pos, "expected value or quoted") return "", p.mkerr(pos, "expected value or quoted")

View file

@ -17,7 +17,6 @@
package filters package filters
import ( import (
"fmt"
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
) )
@ -64,6 +63,7 @@ type scanner struct {
pos int pos int
ppos int // bounds the current rune in the string ppos int // bounds the current rune in the string
value bool value bool
err string
} }
func (s *scanner) init(input string) { func (s *scanner) init(input string) {
@ -82,12 +82,14 @@ func (s *scanner) next() rune {
s.ppos += w s.ppos += w
if r == utf8.RuneError { if r == utf8.RuneError {
if w > 0 { if w > 0 {
s.error("rune error")
return tokenIllegal return tokenIllegal
} }
return tokenEOF return tokenEOF
} }
if r == 0 { if r == 0 {
s.error("unexpected null")
return tokenIllegal return tokenIllegal
} }
@ -114,7 +116,9 @@ chomp:
case ch == tokenEOF: case ch == tokenEOF:
case ch == tokenIllegal: case ch == tokenIllegal:
case isQuoteRune(ch): case isQuoteRune(ch):
s.scanQuoted(ch) if !s.scanQuoted(ch) {
return pos, tokenIllegal, s.input[pos:s.ppos]
}
return pos, tokenQuoted, s.input[pos:s.ppos] return pos, tokenQuoted, s.input[pos:s.ppos]
case isSeparatorRune(ch): case isSeparatorRune(ch):
s.value = false s.value = false
@ -172,54 +176,64 @@ func (s *scanner) scanValue() {
} }
} }
func (s *scanner) scanQuoted(quote rune) { func (s *scanner) scanQuoted(quote rune) bool {
var illegal bool
ch := s.next() // read character after quote ch := s.next() // read character after quote
for ch != quote { for ch != quote {
if ch == '\n' || ch < 0 { if ch == '\n' || ch < 0 {
s.error("literal not terminated") s.error("quoted literal not terminated")
return return false
} }
if ch == '\\' { if ch == '\\' {
ch = s.scanEscape(quote) var legal bool
ch, legal = s.scanEscape(quote)
if !legal {
illegal = true
}
} else { } else {
ch = s.next() ch = s.next()
} }
} }
return !illegal
} }
func (s *scanner) scanEscape(quote rune) rune { func (s *scanner) scanEscape(quote rune) (ch rune, legal bool) {
ch := s.next() // read character after '/' ch = s.next() // read character after '/'
switch ch { switch ch {
case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', quote: case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', quote:
// nothing to do // nothing to do
ch = s.next() ch = s.next()
legal = true
case '0', '1', '2', '3', '4', '5', '6', '7': case '0', '1', '2', '3', '4', '5', '6', '7':
ch = s.scanDigits(ch, 8, 3) ch, legal = s.scanDigits(ch, 8, 3)
case 'x': case 'x':
ch = s.scanDigits(s.next(), 16, 2) ch, legal = s.scanDigits(s.next(), 16, 2)
case 'u': case 'u':
ch = s.scanDigits(s.next(), 16, 4) ch, legal = s.scanDigits(s.next(), 16, 4)
case 'U': case 'U':
ch = s.scanDigits(s.next(), 16, 8) ch, legal = s.scanDigits(s.next(), 16, 8)
default: default:
s.error("illegal char escape") s.error("illegal escape sequence")
} }
return ch return
} }
func (s *scanner) scanDigits(ch rune, base, n int) rune { func (s *scanner) scanDigits(ch rune, base, n int) (rune, bool) {
for n > 0 && digitVal(ch) < base { for n > 0 && digitVal(ch) < base {
ch = s.next() ch = s.next()
n-- n--
} }
if n > 0 { if n > 0 {
s.error("illegal char escape") s.error("illegal numeric escape sequence")
return ch, false
} }
return ch return ch, true
} }
func (s *scanner) error(msg string) { func (s *scanner) error(msg string) {
fmt.Println("error fixme", msg) if s.err == "" {
s.err = msg
}
} }
func digitVal(ch rune) int { func digitVal(ch rune) int {

View file

@ -172,7 +172,7 @@ func ConcurrentMark(ctx context.Context, root <-chan Node, refs func(context.Con
return seen, nil return seen, nil
} }
// Sweep removes all nodes returned through the channel which are not in // Sweep removes all nodes returned through the slice which are not in
// the reachable set by calling the provided remove function. // the reachable set by calling the provided remove function.
func Sweep(reachable map[Node]struct{}, all []Node, remove func(Node) error) error { func Sweep(reachable map[Node]struct{}, all []Node, remove func(Node) error) error {
// All black objects are now reachable, and all white objects are // All black objects are now reachable, and all white objects are

View file

@ -42,13 +42,13 @@ var (
identifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*")) identifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*"))
) )
// Validate return nil if the string s is a valid identifier. // Validate returns nil if the string s is a valid identifier.
// //
// identifiers must be valid domain names according to RFC 1035, section 2.3.1. To // identifiers are similar to the domain name rules according to RFC 1035, section 2.3.1. However
// enforce case insensitivity, all characters must be lower case. // rules in this package are relaxed to allow numerals to follow period (".") and mixed case is
// allowed.
// //
// In general, identifiers that pass this validation, should be safe for use as // In general identifiers that pass this validation should be safe for use as filesystem path components.
// a domain names or filesystem path component.
func Validate(s string) error { func Validate(s string) error {
if len(s) == 0 { if len(s) == 0 {
return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier must not be empty") return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier must not be empty")

View file

@ -58,6 +58,8 @@ type Image interface {
IsUnpacked(context.Context, string) (bool, error) IsUnpacked(context.Context, string) (bool, error)
// ContentStore provides a content store which contains image blob data // ContentStore provides a content store which contains image blob data
ContentStore() content.Store ContentStore() content.Store
// Metadata returns the underlying image metadata
Metadata() images.Image
} }
type usageOptions struct { type usageOptions struct {
@ -130,6 +132,10 @@ type image struct {
platform platforms.MatchComparer platform platforms.MatchComparer
} }
func (i *image) Metadata() images.Image {
return i.i
}
func (i *image) Name() string { func (i *image) Name() string {
return i.i.Name return i.i.Name
} }

View file

@ -181,7 +181,7 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt
Layers: layers, Layers: layers,
} }
desc, err := writeManifest(ctx, store, manifest, ocispec.MediaTypeImageManifest) desc, err := writeManifest(ctx, store, manifest, manifest.MediaType)
if err != nil { if err != nil {
return ocispec.Descriptor{}, errors.Wrap(err, "write docker manifest") return ocispec.Descriptor{}, errors.Wrap(err, "write docker manifest")
} }

View file

@ -22,6 +22,7 @@ import (
"sort" "sort"
"github.com/containerd/containerd/content" "github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -226,6 +227,7 @@ func FilterPlatforms(f HandlerFunc, m platforms.Matcher) HandlerFunc {
// The results will be ordered according to the comparison operator and // The results will be ordered according to the comparison operator and
// use the ordering in the manifests for equal matches. // use the ordering in the manifests for equal matches.
// A limit of 0 or less is considered no limit. // A limit of 0 or less is considered no limit.
// A not found error is returned if no manifest is matched.
func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc { func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc {
return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
children, err := f(ctx, desc) children, err := f(ctx, desc)
@ -245,8 +247,13 @@ func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc
return m.Less(*children[i].Platform, *children[j].Platform) return m.Less(*children[i].Platform, *children[j].Platform)
}) })
if n > 0 && len(children) > n { if n > 0 {
children = children[:n] if len(children) == 0 {
return children, errors.Wrap(errdefs.ErrNotFound, "no match for platform in manifest")
}
if len(children) > n {
children = children[:n]
}
} }
default: default:
// only limit manifests from an index // only limit manifests from an index

View file

@ -21,8 +21,9 @@ import (
"context" "context"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"strings"
introspectionapi "github.com/containerd/containerd/api/services/introspection/v1"
"github.com/containerd/containerd/archive" "github.com/containerd/containerd/archive"
"github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/content" "github.com/containerd/containerd/content"
@ -48,6 +49,15 @@ func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts)
if err != nil { if err != nil {
return err return err
} }
var binDir, libDir string
if runtime.GOOS == "windows" {
binDir = "Files\\bin"
libDir = "Files\\lib"
} else {
binDir = "bin"
libDir = "lib"
}
for _, layer := range manifest.Layers { for _, layer := range manifest.Layers {
ra, err := cs.ReaderAt(ctx, layer) ra, err := cs.ReaderAt(ctx, layer)
if err != nil { if err != nil {
@ -60,9 +70,14 @@ func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts)
} }
if _, err := archive.Apply(ctx, path, r, archive.WithFilter(func(hdr *tar.Header) (bool, error) { if _, err := archive.Apply(ctx, path, r, archive.WithFilter(func(hdr *tar.Header) (bool, error) {
d := filepath.Dir(hdr.Name) d := filepath.Dir(hdr.Name)
result := d == "bin" result := d == binDir
if config.Libs { if config.Libs {
result = result || d == "lib" result = result || d == libDir
}
if runtime.GOOS == "windows" {
hdr.Name = strings.Replace(hdr.Name, "Files", "", 1)
} }
if result && !config.Replace { if result && !config.Replace {
if _, err := os.Lstat(filepath.Join(path, hdr.Name)); err == nil { if _, err := os.Lstat(filepath.Join(path, hdr.Name)); err == nil {
@ -83,11 +98,8 @@ func (c *Client) getInstallPath(ctx context.Context, config InstallConfig) (stri
if config.Path != "" { if config.Path != "" {
return config.Path, nil return config.Path, nil
} }
resp, err := c.IntrospectionService().Plugins(ctx, &introspectionapi.PluginsRequest{ filters := []string{"id==opt"}
Filters: []string{ resp, err := c.IntrospectionService().Plugins(ctx, filters)
"id==opt",
},
})
if err != nil { if err != nil {
return "", err return "", err
} }

View file

@ -18,7 +18,6 @@ package log
import ( import (
"context" "context"
"sync/atomic"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -38,23 +37,10 @@ type (
loggerKey struct{} loggerKey struct{}
) )
// TraceLevel is the log level for tracing. Trace level is lower than debug level,
// and is usually used to trace detailed behavior of the program.
const TraceLevel = logrus.Level(uint32(logrus.DebugLevel + 1))
// RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to // RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to
// ensure the formatted time is always the same number of characters. // ensure the formatted time is always the same number of characters.
const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
// ParseLevel takes a string level and returns the Logrus log level constant.
// It supports trace level.
func ParseLevel(lvl string) (logrus.Level, error) {
if lvl == "trace" {
return TraceLevel, nil
}
return logrus.ParseLevel(lvl)
}
// WithLogger returns a new context with the provided logger. Use in // WithLogger returns a new context with the provided logger. Use in
// combination with logger.WithField(s) for great effect. // combination with logger.WithField(s) for great effect.
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context { func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
@ -72,19 +58,3 @@ func GetLogger(ctx context.Context) *logrus.Entry {
return logger.(*logrus.Entry) return logger.(*logrus.Entry)
} }
// Trace logs a message at level Trace with the log entry passed-in.
func Trace(e *logrus.Entry, args ...interface{}) {
level := logrus.Level(atomic.LoadUint32((*uint32)(&e.Logger.Level)))
if level >= TraceLevel {
e.Debug(args...)
}
}
// Tracef logs a message at level Trace with the log entry passed-in.
func Tracef(e *logrus.Entry, format string, args ...interface{}) {
level := logrus.Level(atomic.LoadUint32((*uint32)(&e.Logger.Level)))
if level >= TraceLevel {
e.Debugf(format, args...)
}
}

View file

@ -24,6 +24,7 @@ import (
"github.com/containerd/containerd/filters" "github.com/containerd/containerd/filters"
"github.com/containerd/containerd/images" "github.com/containerd/containerd/images"
"github.com/containerd/containerd/leases" "github.com/containerd/containerd/leases"
"github.com/containerd/containerd/snapshots"
) )
func adaptImage(o interface{}) filters.Adaptor { func adaptImage(o interface{}) filters.Adaptor {
@ -139,6 +140,34 @@ func adaptLease(lease leases.Lease) filters.Adaptor {
}) })
} }
func adaptSnapshot(info snapshots.Info) filters.Adaptor {
return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
if len(fieldpath) == 0 {
return "", false
}
switch fieldpath[0] {
case "kind":
switch info.Kind {
case snapshots.KindActive:
return "active", true
case snapshots.KindView:
return "view", true
case snapshots.KindCommitted:
return "committed", true
}
case "name":
return info.Name, true
case "parent":
return info.Parent, true
case "labels":
return checkMap(fieldpath[1:], info.Labels)
}
return "", false
})
}
func checkMap(fieldpath []string, m map[string]string) (string, bool) { func checkMap(fieldpath []string, m map[string]string) (string, bool) {
if len(m) == 0 { if len(m) == 0 {
return "", false return "", false

View file

@ -20,6 +20,7 @@ import (
"context" "context"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/identifiers"
l "github.com/containerd/containerd/labels" l "github.com/containerd/containerd/labels"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -41,7 +42,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma
return err return err
} }
if err := namespaces.Validate(namespace); err != nil { if err := identifiers.Validate(namespace); err != nil {
return err return err
} }

View file

@ -25,6 +25,7 @@ import (
"time" "time"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/filters"
"github.com/containerd/containerd/labels" "github.com/containerd/containerd/labels"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/metadata/boltutil"
@ -37,6 +38,7 @@ import (
const ( const (
inheritedLabelsPrefix = "containerd.io/snapshot/" inheritedLabelsPrefix = "containerd.io/snapshot/"
labelSnapshotRef = "containerd.io/snapshot.ref"
) )
type snapshotter struct { type snapshotter struct {
@ -158,6 +160,7 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath
local = snapshots.Info{ local = snapshots.Info{
Name: info.Name, Name: info.Name,
} }
updated bool
) )
if err := update(ctx, s.db, func(tx *bolt.Tx) error { if err := update(ctx, s.db, func(tx *bolt.Tx) error {
bkt := getSnapshotterBucket(tx, ns, s.name) bkt := getSnapshotterBucket(tx, ns, s.name)
@ -216,20 +219,22 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath
inner := snapshots.Info{ inner := snapshots.Info{
Name: bkey, Name: bkey,
Labels: filterInheritedLabels(local.Labels), Labels: snapshots.FilterInheritedLabels(local.Labels),
} }
if _, err := s.Snapshotter.Update(ctx, inner, fieldpaths...); err != nil { // NOTE: Perform this inside the transaction to reduce the
// chances of out of sync data. The backend snapshotters
// should perform the Update as fast as possible.
if info, err = s.Snapshotter.Update(ctx, inner, fieldpaths...); err != nil {
return err return err
} }
updated = true
return nil return nil
}); err != nil { }); err != nil {
return snapshots.Info{}, err if updated {
} log.G(ctx).WithField("snapshotter", s.name).WithField("key", local.Name).WithError(err).Error("transaction failed after updating snapshot backend")
}
info, err = s.Snapshotter.Stat(ctx, bkey)
if err != nil {
return snapshots.Info{}, err return snapshots.Info{}, err
} }
@ -296,31 +301,158 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re
return nil, err return nil, err
} }
var m []mount.Mount var (
target = base.Labels[labelSnapshotRef]
bparent string
bkey string
bopts = []snapshots.Opt{
snapshots.WithLabels(snapshots.FilterInheritedLabels(base.Labels)),
}
)
if err := update(ctx, s.db, func(tx *bolt.Tx) error { if err := update(ctx, s.db, func(tx *bolt.Tx) error {
bkt, err := createSnapshotterBucket(tx, ns, s.name) bkt, err := createSnapshotterBucket(tx, ns, s.name)
if err != nil { if err != nil {
return err return err
} }
bbkt, err := bkt.CreateBucket([]byte(key)) // Check if target exists, if so, return already exists
if err != nil { if target != "" {
if err == bolt.ErrBucketExists { if tbkt := bkt.Bucket([]byte(target)); tbkt != nil {
err = errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", key) return errors.Wrapf(errdefs.ErrAlreadyExists, "target snapshot %q", target)
} }
return err
}
if err := addSnapshotLease(ctx, tx, s.name, key); err != nil {
return err
} }
var bparent string if bbkt := bkt.Bucket([]byte(key)); bbkt != nil {
return errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", key)
}
if parent != "" { if parent != "" {
pbkt := bkt.Bucket([]byte(parent)) pbkt := bkt.Bucket([]byte(parent))
if pbkt == nil { if pbkt == nil {
return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", parent) return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", parent)
} }
bparent = string(pbkt.Get(bucketKeyName)) bparent = string(pbkt.Get(bucketKeyName))
}
sid, err := bkt.NextSequence()
if err != nil {
return err
}
bkey = createKey(sid, ns, key)
return err
}); err != nil {
return nil, err
}
var (
m []mount.Mount
created string
rerr error
)
if readonly {
m, err = s.Snapshotter.View(ctx, bkey, bparent, bopts...)
} else {
m, err = s.Snapshotter.Prepare(ctx, bkey, bparent, bopts...)
}
// An already exists error should indicate the backend found a snapshot
// matching a provided target reference.
if errdefs.IsAlreadyExists(err) {
if target != "" {
var tinfo *snapshots.Info
filter := fmt.Sprintf(`labels."containerd.io/snapshot.ref"==%s,parent==%q`, target, bparent)
if err := s.Snapshotter.Walk(ctx, func(ctx context.Context, i snapshots.Info) error {
if tinfo == nil && i.Kind == snapshots.KindCommitted {
if i.Labels["containerd.io/snapshot.ref"] != target {
// Walk did not respect filter
return nil
}
if i.Parent != bparent {
// Walk did not respect filter
return nil
}
tinfo = &i
}
return nil
}, filter); err != nil {
return nil, errors.Wrap(err, "failed walking backend snapshots")
}
if tinfo == nil {
return nil, errors.Wrapf(errdefs.ErrNotFound, "target snapshot %q in backend", target)
}
key = target
bkey = tinfo.Name
bparent = tinfo.Parent
base.Created = tinfo.Created
base.Updated = tinfo.Updated
if base.Labels == nil {
base.Labels = tinfo.Labels
} else {
for k, v := range tinfo.Labels {
if _, ok := base.Labels[k]; !ok {
base.Labels[k] = v
}
}
}
// Propagate this error after the final update
rerr = errors.Wrapf(errdefs.ErrAlreadyExists, "target snapshot %q from snapshotter", target)
} else {
// This condition is unexpected as the key provided is expected
// to be new and unique, return as unknown response from backend
// to avoid confusing callers handling already exists.
return nil, errors.Wrapf(errdefs.ErrUnknown, "unexpected error from snapshotter: %v", err)
}
} else if err != nil {
return nil, err
} else {
ts := time.Now().UTC()
base.Created = ts
base.Updated = ts
created = bkey
}
if txerr := update(ctx, s.db, func(tx *bolt.Tx) error {
bkt := getSnapshotterBucket(tx, ns, s.name)
if bkt == nil {
return errors.Wrapf(errdefs.ErrNotFound, "can not find snapshotter %q", s.name)
}
if err := addSnapshotLease(ctx, tx, s.name, key); err != nil {
return err
}
bbkt, err := bkt.CreateBucket([]byte(key))
if err != nil {
if err != bolt.ErrBucketExists {
return err
}
if rerr == nil {
rerr = errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", key)
}
return nil
}
if parent != "" {
pbkt := bkt.Bucket([]byte(parent))
if pbkt == nil {
return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", parent)
}
// Ensure the backend's parent matches the metadata store's parent
// If it is mismatched, then a target was provided for a snapshotter
// which has a different parent then requested.
// NOTE: The backend snapshotter is responsible for enforcing the
// uniqueness of the reference relationships, the metadata store
// can only error out to prevent inconsistent data.
if bparent != string(pbkt.Get(bucketKeyName)) {
return errors.Wrapf(errdefs.ErrInvalidArgument, "mismatched parent %s from target %s", parent, target)
}
cbkt, err := pbkt.CreateBucketIfNotExists(bucketKeyChildren) cbkt, err := pbkt.CreateBucketIfNotExists(bucketKeyChildren)
if err != nil { if err != nil {
@ -335,36 +467,28 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re
} }
} }
sid, err := bkt.NextSequence() if err := boltutil.WriteTimestamps(bbkt, base.Created, base.Updated); err != nil {
if err != nil {
return err
}
bkey := createKey(sid, ns, key)
if err := bbkt.Put(bucketKeyName, []byte(bkey)); err != nil {
return err
}
ts := time.Now().UTC()
if err := boltutil.WriteTimestamps(bbkt, ts, ts); err != nil {
return err return err
} }
if err := boltutil.WriteLabels(bbkt, base.Labels); err != nil { if err := boltutil.WriteLabels(bbkt, base.Labels); err != nil {
return err return err
} }
inheritedOpt := snapshots.WithLabels(filterInheritedLabels(base.Labels)) return bbkt.Put(bucketKeyName, []byte(bkey))
}); txerr != nil {
// TODO: Consider doing this outside of transaction to lessen rerr = txerr
// metadata lock time
if readonly {
m, err = s.Snapshotter.View(ctx, bkey, bparent, inheritedOpt)
} else {
m, err = s.Snapshotter.Prepare(ctx, bkey, bparent, inheritedOpt)
}
return err
}); err != nil {
return nil, err
} }
if rerr != nil {
// If the created reference is not stored, attempt clean up
if created != "" {
if err := s.Snapshotter.Remove(ctx, created); err != nil {
log.G(ctx).WithField("snapshotter", s.name).WithField("key", created).WithError(err).Error("failed to cleanup unreferenced snapshot")
}
}
return nil, rerr
}
return m, nil return m, nil
} }
@ -388,7 +512,8 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap
return err return err
} }
return update(ctx, s.db, func(tx *bolt.Tx) error { var bname string
if err := update(ctx, s.db, func(tx *bolt.Tx) error {
bkt := getSnapshotterBucket(tx, ns, s.name) bkt := getSnapshotterBucket(tx, ns, s.name)
if bkt == nil { if bkt == nil {
return errors.Wrapf(errdefs.ErrNotFound, return errors.Wrapf(errdefs.ErrNotFound,
@ -461,12 +586,40 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap
return err return err
} }
inheritedOpt := snapshots.WithLabels(filterInheritedLabels(base.Labels)) inheritedOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(base.Labels))
// TODO: Consider doing this outside of transaction to lessen // NOTE: Backend snapshotters should commit fast and reliably to
// metadata lock time // prevent metadata store locking and minimizing rollbacks.
return s.Snapshotter.Commit(ctx, nameKey, bkey, inheritedOpt) // This operation should be done in the transaction to minimize the
}) // risk of the committed keys becoming out of sync. If this operation
// succeed and the overall transaction fails then the risk of out of
// sync data is higher and may require manual cleanup.
if err := s.Snapshotter.Commit(ctx, nameKey, bkey, inheritedOpt); err != nil {
if errdefs.IsNotFound(err) {
log.G(ctx).WithField("snapshotter", s.name).WithField("key", key).WithError(err).Error("uncommittable snapshot: missing in backend, snapshot should be removed")
}
// NOTE: Consider handling already exists here from the backend. Currently
// already exists from the backend may be confusing to the client since it
// may require the client to re-attempt from prepare. However, if handling
// here it is not clear what happened with the existing backend key and
// whether the already prepared snapshot would still be used or must be
// discarded. It is best that all implementations of the snapshotter
// interface behave the same, in which case the backend should handle the
// mapping of duplicates and not error.
return err
}
bname = nameKey
return nil
}); err != nil {
if bname != "" {
log.G(ctx).WithField("snapshotter", s.name).WithField("key", key).WithField("bname", bname).WithError(err).Error("uncommittable snapshot: transaction failed after commit, snapshot should be removed")
}
return err
}
return nil
} }
@ -530,7 +683,7 @@ type infoPair struct {
info snapshots.Info info snapshots.Info
} }
func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error { func (s *snapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...string) error {
ns, err := namespaces.NamespaceRequired(ctx) ns, err := namespaces.NamespaceRequired(ctx)
if err != nil { if err != nil {
return err return err
@ -542,6 +695,11 @@ func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapsho
lastKey string lastKey string
) )
filter, err := filters.ParseAll(fs...)
if err != nil {
return err
}
for { for {
if err := view(ctx, s.db, func(tx *bolt.Tx) error { if err := view(ctx, s.db, func(tx *bolt.Tx) error {
bkt := getSnapshotterBucket(tx, ns, s.name) bkt := getSnapshotterBucket(tx, ns, s.name)
@ -604,8 +762,11 @@ func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapsho
return err return err
} }
if err := fn(ctx, overlayInfo(info, pair.info)); err != nil { info = overlayInfo(info, pair.info)
return err if filter.Match(adaptSnapshot(info)) {
if err := fn(ctx, info); err != nil {
return err
}
} }
} }
@ -630,18 +791,17 @@ func validateSnapshot(info *snapshots.Info) error {
return nil return nil
} }
type cleaner interface {
Cleanup(ctx context.Context) error
}
func (s *snapshotter) garbageCollect(ctx context.Context) (d time.Duration, err error) { func (s *snapshotter) garbageCollect(ctx context.Context) (d time.Duration, err error) {
s.l.Lock() s.l.Lock()
t1 := time.Now() t1 := time.Now()
defer func() { defer func() {
s.l.Unlock() s.l.Unlock()
if err == nil { if err == nil {
if c, ok := s.Snapshotter.(cleaner); ok { if c, ok := s.Snapshotter.(snapshots.Cleaner); ok {
err = c.Cleanup(ctx) err = c.Cleanup(ctx)
if errdefs.IsNotImplemented(err) {
err = nil
}
} }
} }
if err == nil { if err == nil {
@ -778,19 +938,3 @@ func (s *snapshotter) pruneBranch(ctx context.Context, node *treeNode) error {
func (s *snapshotter) Close() error { func (s *snapshotter) Close() error {
return s.Snapshotter.Close() return s.Snapshotter.Close()
} }
// filterInheritedLabels filters the provided labels by removing any key which doesn't have
// a prefix of "containerd.io/snapshot/".
func filterInheritedLabels(labels map[string]string) map[string]string {
if labels == nil {
return nil
}
filtered := make(map[string]string)
for k, v := range labels {
if strings.HasPrefix(k, inheritedLabelsPrefix) {
filtered[k] = v
}
}
return filtered
}

View file

@ -19,6 +19,7 @@ package mount
import ( import (
"fmt" "fmt"
"os" "os"
"os/exec"
"path" "path"
"strings" "strings"
"time" "time"
@ -28,14 +29,27 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
var pagesize = 4096 var (
pagesize = 4096
allowedHelperBinaries = []string{"mount.fuse", "mount.fuse3"}
)
func init() { func init() {
pagesize = os.Getpagesize() pagesize = os.Getpagesize()
} }
// Mount to the provided target path // Mount to the provided target path.
//
// If m.Type starts with "fuse." or "fuse3.", "mount.fuse" or "mount.fuse3"
// helper binary is called.
func (m *Mount) Mount(target string) error { func (m *Mount) Mount(target string) error {
for _, helperBinary := range allowedHelperBinaries {
// helperBinary = "mount.fuse", typePrefix = "fuse."
typePrefix := strings.TrimPrefix(helperBinary, "mount.") + "."
if strings.HasPrefix(m.Type, typePrefix) {
return m.mountWithHelper(helperBinary, typePrefix, target)
}
}
var ( var (
chdir string chdir string
options = m.Options options = m.Options
@ -92,7 +106,28 @@ func Unmount(target string, flags int) error {
return nil return nil
} }
func isFUSE(dir string) (bool, error) {
// fuseSuperMagic is defined in statfs(2)
const fuseSuperMagic = 0x65735546
var st unix.Statfs_t
if err := unix.Statfs(dir, &st); err != nil {
return false, err
}
return st.Type == fuseSuperMagic, nil
}
func unmount(target string, flags int) error { func unmount(target string, flags int) error {
// For FUSE mounts, attempting to execute fusermount helper binary is preferred
// https://github.com/containerd/containerd/pull/3765#discussion_r342083514
if ok, err := isFUSE(target); err == nil && ok {
for _, helperBinary := range []string{"fusermount3", "fusermount"} {
cmd := exec.Command(helperBinary, "-u", target)
if err := cmd.Run(); err == nil {
return nil
}
// ignore error and try unix.Unmount
}
}
for i := 0; i < 50; i++ { for i := 0; i < 50; i++ {
if err := unix.Unmount(target, flags); err != nil { if err := unix.Unmount(target, flags); err != nil {
switch err { switch err {
@ -317,3 +352,21 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st
} }
return errors.Wrap(sys.FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") return errors.Wrap(sys.FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat")
} }
func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error {
// helperBinary: "mount.fuse3"
// target: "/foo/merged"
// m.Type: "fuse3.fuse-overlayfs"
// command: "mount.fuse3 overlay /foo/merged -o lowerdir=/foo/lower2:/foo/lower1,upperdir=/foo/upper,workdir=/foo/work -t fuse-overlayfs"
args := []string{m.Source, target}
for _, o := range m.Options {
args = append(args, "-o", o)
}
args = append(args, "-t", strings.TrimPrefix(m.Type, typePrefix))
cmd := exec.Command(helperBinary, args...)
out, err := cmd.CombinedOutput()
if err != nil {
return errors.Wrapf(err, "mount helper [%s %v] failed: %q", helperBinary, args, string(out))
}
return nil
}

View file

@ -21,6 +21,7 @@ import (
"os" "os"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/identifiers"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -70,7 +71,7 @@ func NamespaceRequired(ctx context.Context) (string, error) {
if !ok || namespace == "" { if !ok || namespace == "" {
return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace is required") return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace is required")
} }
if err := Validate(namespace); err != nil { if err := identifiers.Validate(namespace); err != nil {
return "", errors.Wrap(err, "namespace validation") return "", errors.Wrap(err, "namespace validation")
} }
return namespace, nil return namespace, nil

View file

@ -1,83 +0,0 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package namespaces provides tools for working with namespaces across
// containerd.
//
// Namespaces collect resources such as containers and images, into a unique
// identifier space. This means that two applications can use the same
// identifiers and not conflict while using containerd.
//
// This package can be used to ensure that client and server functions
// correctly store the namespace on the context.
package namespaces
import (
"regexp"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)
const (
maxLength = 76
alpha = `[A-Za-z]`
alphanum = `[A-Za-z0-9]+`
label = alpha + alphanum + `(:?[-]+` + alpha + alphanum + `)*`
)
var (
// namespaceRe validates that a namespace matches valid identifiers.
//
// Rules for domains, defined in RFC 1035, section 2.3.1, are used for
// namespaces.
namespaceRe = regexp.MustCompile(reAnchor(label + reGroup("[.]"+reGroup(label)) + "*"))
)
// Validate returns nil if the string s is a valid namespace.
//
// To allow such namespace identifiers to be used across various contexts
// safely, the character set has been restricted to that defined for domains in
// RFC 1035, section 2.3.1. This will make namespace identifiers safe for use
// across networks, filesystems and other media.
//
// The identifier specification departs from RFC 1035 in that it allows
// "labels" to start with number and only enforces a total length restriction
// of 76 characters.
//
// While the character set may be expanded in the future, namespace identifiers
// are guaranteed to be safely used as filesystem path components.
//
// For the most part, this doesn't need to be called directly when using the
// context-oriented functions.
func Validate(s string) error {
if len(s) > maxLength {
return errors.Wrapf(errdefs.ErrInvalidArgument, "namespace %q greater than maximum length (%d characters)", s, maxLength)
}
if !namespaceRe.MatchString(s) {
return errors.Wrapf(errdefs.ErrInvalidArgument, "namespace %q must match %v", s, namespaceRe)
}
return nil
}
func reGroup(s string) string {
return `(?:` + s + `)`
}
func reAnchor(s string) string {
return `^` + s + `$`
}

View file

@ -439,7 +439,7 @@ func WithHostLocaltime(_ context.Context, _ Client, _ *containers.Container, s *
// WithUserNamespace sets the uid and gid mappings for the task // WithUserNamespace sets the uid and gid mappings for the task
// this can be called multiple times to add more mappings to the generated spec // this can be called multiple times to add more mappings to the generated spec
func WithUserNamespace(container, host, size uint32) SpecOpts { func WithUserNamespace(uidMap, gidMap []specs.LinuxIDMapping) SpecOpts {
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
var hasUserns bool var hasUserns bool
setLinux(s) setLinux(s)
@ -454,13 +454,8 @@ func WithUserNamespace(container, host, size uint32) SpecOpts {
Type: specs.UserNamespace, Type: specs.UserNamespace,
}) })
} }
mapping := specs.LinuxIDMapping{ s.Linux.UIDMappings = append(s.Linux.UIDMappings, uidMap...)
ContainerID: container, s.Linux.GIDMappings = append(s.Linux.GIDMappings, gidMap...)
HostID: host,
Size: size,
}
s.Linux.UIDMappings = append(s.Linux.UIDMappings, mapping)
s.Linux.GIDMappings = append(s.Linux.GIDMappings, mapping)
return nil return nil
} }
} }

View file

@ -19,21 +19,13 @@ package dialer
import ( import (
"net" "net"
"os" "os"
"syscall"
"time" "time"
winio "github.com/Microsoft/go-winio" winio "github.com/Microsoft/go-winio"
) )
func isNoent(err error) bool { func isNoent(err error) bool {
if err != nil { return os.IsNotExist(err)
if oerr, ok := err.(*os.PathError); ok {
if oerr.Err == syscall.ENOENT {
return true
}
}
}
return false
} }
func dialer(address string, timeout time.Duration) (net.Conn, error) { func dialer(address string, timeout time.Duration) (net.Conn, error) {

View file

@ -96,7 +96,6 @@ func (e *execProcess) setExited(status int) {
e.status = status e.status = status
e.exited = time.Now() e.exited = time.Now()
e.parent.Platform.ShutdownConsole(context.Background(), e.console) e.parent.Platform.ShutdownConsole(context.Background(), e.console)
e.pid.set(StoppedPID)
close(e.waitBlock) close(e.waitBlock)
} }
@ -147,7 +146,7 @@ func (e *execProcess) kill(ctx context.Context, sig uint32, _ bool) error {
switch { switch {
case pid == 0: case pid == 0:
return errors.Wrap(errdefs.ErrFailedPrecondition, "process not created") return errors.Wrap(errdefs.ErrFailedPrecondition, "process not created")
case pid < 0: case !e.exited.IsZero():
return errors.Wrapf(errdefs.ErrNotFound, "process already finished") return errors.Wrapf(errdefs.ErrNotFound, "process already finished")
default: default:
if err := unix.Kill(pid, syscall.Signal(sig)); err != nil { if err := unix.Kill(pid, syscall.Signal(sig)); err != nil {

View file

@ -66,7 +66,7 @@ type Init struct {
pausing *atomicBool pausing *atomicBool
status int status int
exited time.Time exited time.Time
pid safePid pid int
closers []io.Closer closers []io.Closer
stdin io.Closer stdin io.Closer
stdio stdio.Stdio stdio stdio.Stdio
@ -116,8 +116,6 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error {
pio *processIO pio *processIO
pidFile = newPidFile(p.Bundle) pidFile = newPidFile(p.Bundle)
) )
p.pid.Lock()
defer p.pid.Unlock()
if r.Terminal { if r.Terminal {
if socket, err = runc.NewTempConsoleSocket(); err != nil { if socket, err = runc.NewTempConsoleSocket(); err != nil {
@ -173,7 +171,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error {
if err != nil { if err != nil {
return errors.Wrap(err, "failed to retrieve OCI runtime container pid") return errors.Wrap(err, "failed to retrieve OCI runtime container pid")
} }
p.pid.pid = pid p.pid = pid
return nil return nil
} }
@ -219,7 +217,7 @@ func (p *Init) ID() string {
// Pid of the process // Pid of the process
func (p *Init) Pid() int { func (p *Init) Pid() int {
return p.pid.get() return p.pid
} }
// ExitStatus of the process // ExitStatus of the process
@ -275,7 +273,6 @@ func (p *Init) setExited(status int) {
p.exited = time.Now() p.exited = time.Now()
p.status = status p.status = status
p.Platform.ShutdownConsole(context.Background(), p.console) p.Platform.ShutdownConsole(context.Background(), p.console)
p.pid.set(StoppedPID)
close(p.waitBlock) close(p.waitBlock)
} }

View file

@ -147,9 +147,6 @@ func (s *createdCheckpointState) Start(ctx context.Context) error {
p := s.p p := s.p
sio := p.stdio sio := p.stdio
p.pid.Lock()
defer p.pid.Unlock()
var ( var (
err error err error
socket *runc.Socket socket *runc.Socket
@ -189,7 +186,7 @@ func (s *createdCheckpointState) Start(ctx context.Context) error {
if err != nil { if err != nil {
return errors.Wrap(err, "failed to retrieve OCI runtime container pid") return errors.Wrap(err, "failed to retrieve OCI runtime container pid")
} }
p.pid.pid = pid p.pid = pid
return s.transition("running") return s.transition("running")
} }

View file

@ -39,8 +39,6 @@ import (
const ( const (
// RuncRoot is the path to the root runc state directory // RuncRoot is the path to the root runc state directory
RuncRoot = "/run/containerd/runc" RuncRoot = "/run/containerd/runc"
// StoppedPID is the pid assigned after a container has run and stopped
StoppedPID = -1
// InitPidFile name of the file that contains the init pid // InitPidFile name of the file that contains the init pid
InitPidFile = "init.pid" InitPidFile = "init.pid"
) )
@ -57,12 +55,6 @@ func (s *safePid) get() int {
return s.pid return s.pid
} }
func (s *safePid) set(pid int) {
s.Lock()
s.pid = pid
s.Unlock()
}
type atomicBool int32 type atomicBool int32
func (ab *atomicBool) set(b bool) { func (ab *atomicBool) set(b bool) {

View file

@ -96,16 +96,21 @@ func getCPUVariant() string {
return "" return ""
} }
switch variant { switch strings.ToLower(variant) {
case "8", "AArch64": case "8", "aarch64":
variant = "v8" // special case: if running a 32-bit userspace on aarch64, the variant should be "v7"
case "7", "7M", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)": if runtime.GOARCH == "arm" {
variant = "v7"
} else {
variant = "v8"
}
case "7", "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)":
variant = "v7" variant = "v7"
case "6", "6TEJ": case "6", "6tej":
variant = "v6" variant = "v6"
case "5", "5T", "5TE", "5TEJ": case "5", "5t", "5te", "5tej":
variant = "v5" variant = "v5"
case "4", "4T": case "4", "4t":
variant = "v4" variant = "v4"
case "3": case "3":
variant = "v3" variant = "v3"

View file

@ -189,9 +189,8 @@ func Parse(specifier string) (specs.Platform, error) {
if isKnownOS(p.OS) { if isKnownOS(p.OS) {
// picks a default architecture // picks a default architecture
p.Architecture = runtime.GOARCH p.Architecture = runtime.GOARCH
if p.Architecture == "arm" { if p.Architecture == "arm" && cpuVariant != "v7" {
// TODO(stevvooe): Resolve arm variant, if not v6 (default) p.Variant = cpuVariant
return specs.Platform{}, errors.Wrapf(errdefs.ErrNotImplemented, "arm support not fully implemented")
} }
return p, nil return p, nil

View file

@ -1,4 +1,4 @@
// +build go1.8,!windows,amd64,!static_build // +build go1.8,!windows,amd64,!static_build,!gccgo
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.

View file

@ -1,4 +1,4 @@
// +build !go1.8 windows !amd64 static_build // +build !go1.8 windows !amd64 static_build gccgo
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.

View file

@ -27,6 +27,7 @@ import (
"github.com/containerd/containerd/remotes/docker/schema1" "github.com/containerd/containerd/remotes/docker/schema1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors" "github.com/pkg/errors"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore" "golang.org/x/sync/semaphore"
) )
@ -62,15 +63,18 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima
defer done(ctx) defer done(ctx)
var unpacks int32 var unpacks int32
var unpackEg *errgroup.Group
var unpackWrapper func(f images.Handler) images.Handler
if pullCtx.Unpack { if pullCtx.Unpack {
// unpacker only supports schema 2 image, for schema 1 this is noop. // unpacker only supports schema 2 image, for schema 1 this is noop.
u, err := c.newUnpacker(ctx, pullCtx) u, err := c.newUnpacker(ctx, pullCtx)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "create unpacker") return nil, errors.Wrap(err, "create unpacker")
} }
unpackWrapper, eg := u.handlerWrapper(ctx, &unpacks) unpackWrapper, unpackEg = u.handlerWrapper(ctx, &unpacks)
defer func() { defer func() {
if err := eg.Wait(); err != nil { if err := unpackEg.Wait(); err != nil {
if retErr == nil { if retErr == nil {
retErr = errors.Wrap(err, "unpack") retErr = errors.Wrap(err, "unpack")
} }
@ -81,7 +85,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima
if wrapper == nil { if wrapper == nil {
return unpackWrapper(h) return unpackWrapper(h)
} }
return wrapper(unpackWrapper(h)) return unpackWrapper(wrapper(h))
} }
} }
@ -90,6 +94,22 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima
return nil, err return nil, err
} }
// NOTE(fuweid): unpacker defers blobs download. before create image
// record in ImageService, should wait for unpacking(including blobs
// download).
if pullCtx.Unpack {
if unpackEg != nil {
if err := unpackEg.Wait(); err != nil {
return nil, err
}
}
}
img, err = c.createNewImage(ctx, img)
if err != nil {
return nil, err
}
i := NewImageWithPlatform(c, img, pullCtx.PlatformMatcher) i := NewImageWithPlatform(c, img, pullCtx.PlatformMatcher)
if pullCtx.Unpack { if pullCtx.Unpack {
@ -201,12 +221,14 @@ func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, lim
} }
} }
img := images.Image{ return images.Image{
Name: name, Name: name,
Target: desc, Target: desc,
Labels: rCtx.Labels, Labels: rCtx.Labels,
} }, nil
}
func (c *Client) createNewImage(ctx context.Context, img images.Image) (images.Image, error) {
is := c.ImageService() is := c.ImageService()
for { for {
if created, err := is.Create(ctx, img); err != nil { if created, err := is.Create(ctx, img); err != nil {

View file

@ -124,7 +124,7 @@ func (r Spec) Hostname() string {
i := strings.Index(r.Locator, "/") i := strings.Index(r.Locator, "/")
if i < 0 { if i < 0 {
i = len(r.Locator) + 1 return r.Locator
} }
return r.Locator[:i] return r.Locator[:i]
} }

View file

@ -196,10 +196,11 @@ func (a *dockerAuthorizer) generateTokenOptions(ctx context.Context, host string
} }
scope, ok := c.parameters["scope"] scope, ok := c.parameters["scope"]
if !ok { if ok {
return tokenOptions{}, errors.Errorf("no scope specified for token auth challenge") to.scopes = append(to.scopes, scope)
} else {
log.G(ctx).WithField("host", host).Debug("no scope specified for token auth challenge")
} }
to.scopes = append(to.scopes, scope)
if a.credentials != nil { if a.credentials != nil {
to.username, to.secret, err = a.credentials(host) to.username, to.secret, err = a.credentials(host)
@ -273,9 +274,6 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (string, error) {
to := ah.common to := ah.common
to.scopes = getTokenScopes(ctx, to.scopes) to.scopes = getTokenScopes(ctx, to.scopes)
if len(to.scopes) == 0 {
return "", errors.Errorf("no scope specified for token auth challenge")
}
// Docs: https://docs.docker.com/registry/spec/auth/scope // Docs: https://docs.docker.com/registry/spec/auth/scope
scoped := strings.Join(to.scopes, " ") scoped := strings.Join(to.scopes, " ")
@ -332,7 +330,9 @@ type postTokenResponse struct {
func (ah *authHandler) fetchTokenWithOAuth(ctx context.Context, to tokenOptions) (string, error) { func (ah *authHandler) fetchTokenWithOAuth(ctx context.Context, to tokenOptions) (string, error) {
form := url.Values{} form := url.Values{}
form.Set("scope", strings.Join(to.scopes, " ")) if len(to.scopes) > 0 {
form.Set("scope", strings.Join(to.scopes, " "))
}
form.Set("service", to.service) form.Set("service", to.service)
// TODO: Allow setting client_id // TODO: Allow setting client_id
form.Set("client_id", "containerd-client") form.Set("client_id", "containerd-client")

View file

@ -95,41 +95,49 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R
images.MediaTypeDockerSchema1Manifest, images.MediaTypeDockerSchema1Manifest,
ocispec.MediaTypeImageManifest, ocispec.MediaTypeImageIndex: ocispec.MediaTypeImageManifest, ocispec.MediaTypeImageIndex:
var firstErr error
for _, host := range r.hosts { for _, host := range r.hosts {
req := r.request(host, http.MethodGet, "manifests", desc.Digest.String()) req := r.request(host, http.MethodGet, "manifests", desc.Digest.String())
rc, err := r.open(ctx, req, desc.MediaType, offset) rc, err := r.open(ctx, req, desc.MediaType, offset)
if err != nil { if err != nil {
if errdefs.IsNotFound(err) { // Store the error for referencing later
continue // try another host if firstErr == nil {
firstErr = err
} }
continue // try another host
return nil, err
} }
return rc, nil return rc, nil
} }
return nil, firstErr
} }
// Finally use blobs endpoints // Finally use blobs endpoints
var firstErr error
for _, host := range r.hosts { for _, host := range r.hosts {
req := r.request(host, http.MethodGet, "blobs", desc.Digest.String()) req := r.request(host, http.MethodGet, "blobs", desc.Digest.String())
rc, err := r.open(ctx, req, desc.MediaType, offset) rc, err := r.open(ctx, req, desc.MediaType, offset)
if err != nil { if err != nil {
if errdefs.IsNotFound(err) { // Store the error for referencing later
continue // try another host if firstErr == nil {
firstErr = err
} }
continue // try another host
return nil, err
} }
return rc, nil return rc, nil
} }
return nil, errors.Wrapf(errdefs.ErrNotFound, if errdefs.IsNotFound(firstErr) {
"could not fetch content descriptor %v (%v) from remote", firstErr = errors.Wrapf(errdefs.ErrNotFound,
desc.Digest, desc.MediaType) "could not fetch content descriptor %v (%v) from remote",
desc.Digest, desc.MediaType)
}
return nil, firstErr
}) })
} }

View file

@ -204,6 +204,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
q.Add("digest", desc.Digest.String()) q.Add("digest", desc.Digest.String())
req = p.request(lhost, http.MethodPut) req = p.request(lhost, http.MethodPut)
req.header.Set("Content-Type", "application/octet-stream")
req.path = lurl.Path + "?" + q.Encode() req.path = lurl.Path + "?" + q.Encode()
} }
p.tracker.SetStatus(ref, Status{ p.tracker.SetStatus(ref, Status{
@ -339,9 +340,9 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di
} }
// 201 is specified return status, some registries return // 201 is specified return status, some registries return
// 200 or 204. // 200, 202 or 204.
switch resp.StatusCode { switch resp.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusNoContent: case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted:
default: default:
return errors.Errorf("unexpected status: %s", resp.Status) return errors.Errorf("unexpected status: %s", resp.Status)
} }

View file

@ -286,7 +286,11 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp
if errors.Cause(err) == ErrInvalidAuthorization { if errors.Cause(err) == ErrInvalidAuthorization {
err = errors.Wrapf(err, "pull access denied, repository does not exist or may require authorization") err = errors.Wrapf(err, "pull access denied, repository does not exist or may require authorization")
} }
return "", ocispec.Descriptor{}, err // Store the error for referencing later
if lastErr == nil {
lastErr = err
}
continue // try another host
} }
resp.Body.Close() // don't care about body contents. resp.Body.Close() // don't care about body contents.

View file

@ -8,6 +8,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type RuncOptions struct { type RuncOptions struct {
Runtime string `protobuf:"bytes,1,opt,name=runtime,proto3" json:"runtime,omitempty"` Runtime string `protobuf:"bytes,1,opt,name=runtime,proto3" json:"runtime,omitempty"`
@ -46,7 +47,7 @@ func (m *RuncOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_RuncOptions.Marshal(b, m, deterministic) return xxx_messageInfo_RuncOptions.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -97,7 +98,7 @@ func (m *CreateOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return xxx_messageInfo_CreateOptions.Marshal(b, m, deterministic) return xxx_messageInfo_CreateOptions.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -144,7 +145,7 @@ func (m *CheckpointOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return xxx_messageInfo_CheckpointOptions.Marshal(b, m, deterministic) return xxx_messageInfo_CheckpointOptions.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -183,7 +184,7 @@ func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -258,7 +259,7 @@ var fileDescriptor_d20e2ba8b3cc58b9 = []byte{
func (m *RuncOptions) Marshal() (dAtA []byte, err error) { func (m *RuncOptions) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -266,48 +267,57 @@ func (m *RuncOptions) Marshal() (dAtA []byte, err error) {
} }
func (m *RuncOptions) MarshalTo(dAtA []byte) (int, error) { func (m *RuncOptions) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *RuncOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Runtime) > 0 { if m.XXX_unrecognized != nil {
dAtA[i] = 0xa i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
i = encodeVarintRunc(dAtA, i, uint64(len(m.Runtime)))
i += copy(dAtA[i:], m.Runtime)
}
if len(m.RuntimeRoot) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.RuntimeRoot)))
i += copy(dAtA[i:], m.RuntimeRoot)
}
if len(m.CriuPath) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuPath)))
i += copy(dAtA[i:], m.CriuPath)
} }
if m.SystemdCgroup { if m.SystemdCgroup {
dAtA[i] = 0x20 i--
i++
if m.SystemdCgroup { if m.SystemdCgroup {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x20
} }
if m.XXX_unrecognized != nil { if len(m.CriuPath) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.CriuPath)
copy(dAtA[i:], m.CriuPath)
i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuPath)))
i--
dAtA[i] = 0x1a
} }
return i, nil if len(m.RuntimeRoot) > 0 {
i -= len(m.RuntimeRoot)
copy(dAtA[i:], m.RuntimeRoot)
i = encodeVarintRunc(dAtA, i, uint64(len(m.RuntimeRoot)))
i--
dAtA[i] = 0x12
}
if len(m.Runtime) > 0 {
i -= len(m.Runtime)
copy(dAtA[i:], m.Runtime)
i = encodeVarintRunc(dAtA, i, uint64(len(m.Runtime)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func (m *CreateOptions) Marshal() (dAtA []byte, err error) { func (m *CreateOptions) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -315,129 +325,133 @@ func (m *CreateOptions) Marshal() (dAtA []byte, err error) {
} }
func (m *CreateOptions) MarshalTo(dAtA []byte) (int, error) { func (m *CreateOptions) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CreateOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.NoPivotRoot { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.NoPivotRoot {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if m.OpenTcp { if len(m.CriuImagePath) > 0 {
dAtA[i] = 0x10 i -= len(m.CriuImagePath)
i++ copy(dAtA[i:], m.CriuImagePath)
if m.OpenTcp { i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuImagePath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x6a
dAtA[i] = 0
}
i++
} }
if m.ExternalUnixSockets { if len(m.CriuWorkPath) > 0 {
dAtA[i] = 0x18 i -= len(m.CriuWorkPath)
i++ copy(dAtA[i:], m.CriuWorkPath)
if m.ExternalUnixSockets { i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuWorkPath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x62
dAtA[i] = 0
}
i++
} }
if m.Terminal { if m.IoGid != 0 {
dAtA[i] = 0x20 i = encodeVarintRunc(dAtA, i, uint64(m.IoGid))
i++ i--
if m.Terminal { dAtA[i] = 0x58
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if m.FileLocks { if m.IoUid != 0 {
dAtA[i] = 0x28 i = encodeVarintRunc(dAtA, i, uint64(m.IoUid))
i++ i--
if m.FileLocks { dAtA[i] = 0x50
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if len(m.EmptyNamespaces) > 0 { if len(m.ShimCgroup) > 0 {
for _, s := range m.EmptyNamespaces { i -= len(m.ShimCgroup)
dAtA[i] = 0x32 copy(dAtA[i:], m.ShimCgroup)
i++ i = encodeVarintRunc(dAtA, i, uint64(len(m.ShimCgroup)))
l = len(s) i--
for l >= 1<<7 { dAtA[i] = 0x4a
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.CgroupsMode) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.CgroupsMode)))
i += copy(dAtA[i:], m.CgroupsMode)
} }
if m.NoNewKeyring { if m.NoNewKeyring {
dAtA[i] = 0x40 i--
i++
if m.NoNewKeyring { if m.NoNewKeyring {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x40
} }
if len(m.ShimCgroup) > 0 { if len(m.CgroupsMode) > 0 {
dAtA[i] = 0x4a i -= len(m.CgroupsMode)
i++ copy(dAtA[i:], m.CgroupsMode)
i = encodeVarintRunc(dAtA, i, uint64(len(m.ShimCgroup))) i = encodeVarintRunc(dAtA, i, uint64(len(m.CgroupsMode)))
i += copy(dAtA[i:], m.ShimCgroup) i--
dAtA[i] = 0x3a
} }
if m.IoUid != 0 { if len(m.EmptyNamespaces) > 0 {
dAtA[i] = 0x50 for iNdEx := len(m.EmptyNamespaces) - 1; iNdEx >= 0; iNdEx-- {
i++ i -= len(m.EmptyNamespaces[iNdEx])
i = encodeVarintRunc(dAtA, i, uint64(m.IoUid)) copy(dAtA[i:], m.EmptyNamespaces[iNdEx])
i = encodeVarintRunc(dAtA, i, uint64(len(m.EmptyNamespaces[iNdEx])))
i--
dAtA[i] = 0x32
}
} }
if m.IoGid != 0 { if m.FileLocks {
dAtA[i] = 0x58 i--
i++ if m.FileLocks {
i = encodeVarintRunc(dAtA, i, uint64(m.IoGid)) dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x28
} }
if len(m.CriuWorkPath) > 0 { if m.Terminal {
dAtA[i] = 0x62 i--
i++ if m.Terminal {
i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuWorkPath))) dAtA[i] = 1
i += copy(dAtA[i:], m.CriuWorkPath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x20
} }
if len(m.CriuImagePath) > 0 { if m.ExternalUnixSockets {
dAtA[i] = 0x6a i--
i++ if m.ExternalUnixSockets {
i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuImagePath))) dAtA[i] = 1
i += copy(dAtA[i:], m.CriuImagePath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
} }
if m.XXX_unrecognized != nil { if m.OpenTcp {
i += copy(dAtA[i:], m.XXX_unrecognized) i--
if m.OpenTcp {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
} }
return i, nil if m.NoPivotRoot {
i--
if m.NoPivotRoot {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) { func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -445,103 +459,106 @@ func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) {
} }
func (m *CheckpointOptions) MarshalTo(dAtA []byte) (int, error) { func (m *CheckpointOptions) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CheckpointOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Exit { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.Exit {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if m.OpenTcp { if len(m.ImagePath) > 0 {
dAtA[i] = 0x10 i -= len(m.ImagePath)
i++ copy(dAtA[i:], m.ImagePath)
if m.OpenTcp { i = encodeVarintRunc(dAtA, i, uint64(len(m.ImagePath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x4a
dAtA[i] = 0
}
i++
} }
if m.ExternalUnixSockets { if len(m.WorkPath) > 0 {
dAtA[i] = 0x18 i -= len(m.WorkPath)
i++ copy(dAtA[i:], m.WorkPath)
if m.ExternalUnixSockets { i = encodeVarintRunc(dAtA, i, uint64(len(m.WorkPath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x42
dAtA[i] = 0
}
i++
} }
if m.Terminal { if len(m.CgroupsMode) > 0 {
dAtA[i] = 0x20 i -= len(m.CgroupsMode)
i++ copy(dAtA[i:], m.CgroupsMode)
if m.Terminal { i = encodeVarintRunc(dAtA, i, uint64(len(m.CgroupsMode)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x3a
dAtA[i] = 0 }
if len(m.EmptyNamespaces) > 0 {
for iNdEx := len(m.EmptyNamespaces) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.EmptyNamespaces[iNdEx])
copy(dAtA[i:], m.EmptyNamespaces[iNdEx])
i = encodeVarintRunc(dAtA, i, uint64(len(m.EmptyNamespaces[iNdEx])))
i--
dAtA[i] = 0x32
} }
i++
} }
if m.FileLocks { if m.FileLocks {
dAtA[i] = 0x28 i--
i++
if m.FileLocks { if m.FileLocks {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x28
} }
if len(m.EmptyNamespaces) > 0 { if m.Terminal {
for _, s := range m.EmptyNamespaces { i--
dAtA[i] = 0x32 if m.Terminal {
i++ dAtA[i] = 1
l = len(s) } else {
for l >= 1<<7 { dAtA[i] = 0
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
i--
dAtA[i] = 0x20
} }
if len(m.CgroupsMode) > 0 { if m.ExternalUnixSockets {
dAtA[i] = 0x3a i--
i++ if m.ExternalUnixSockets {
i = encodeVarintRunc(dAtA, i, uint64(len(m.CgroupsMode))) dAtA[i] = 1
i += copy(dAtA[i:], m.CgroupsMode) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
} }
if len(m.WorkPath) > 0 { if m.OpenTcp {
dAtA[i] = 0x42 i--
i++ if m.OpenTcp {
i = encodeVarintRunc(dAtA, i, uint64(len(m.WorkPath))) dAtA[i] = 1
i += copy(dAtA[i:], m.WorkPath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
} }
if len(m.ImagePath) > 0 { if m.Exit {
dAtA[i] = 0x4a i--
i++ if m.Exit {
i = encodeVarintRunc(dAtA, i, uint64(len(m.ImagePath))) dAtA[i] = 1
i += copy(dAtA[i:], m.ImagePath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { func (m *ProcessDetails) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -549,30 +566,39 @@ func (m *ProcessDetails) Marshal() (dAtA []byte, err error) {
} }
func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ProcessDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ExecID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.ExecID)))
i += copy(dAtA[i:], m.ExecID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ExecID) > 0 {
i -= len(m.ExecID)
copy(dAtA[i:], m.ExecID)
i = encodeVarintRunc(dAtA, i, uint64(len(m.ExecID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintRunc(dAtA []byte, offset int, v uint64) int { func encodeVarintRunc(dAtA []byte, offset int, v uint64) int {
offset -= sovRunc(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *RuncOptions) Size() (n int) { func (m *RuncOptions) Size() (n int) {
if m == nil { if m == nil {
@ -721,14 +747,7 @@ func (m *ProcessDetails) Size() (n int) {
} }
func sovRunc(x uint64) (n int) { func sovRunc(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozRunc(x uint64) (n int) { func sozRunc(x uint64) (n int) {
return sovRunc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovRunc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1721,6 +1740,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error {
func skipRunc(dAtA []byte) (n int, err error) { func skipRunc(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1752,10 +1772,8 @@ func skipRunc(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1776,55 +1794,30 @@ func skipRunc(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthRunc return 0, ErrInvalidLengthRunc
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthRunc
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRunc
}
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 := skipRunc(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthRunc
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupRunc
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthRunc
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthRunc = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthRunc = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowRunc = fmt.Errorf("proto: integer overflow") ErrIntOverflowRunc = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupRunc = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -62,6 +62,9 @@ const (
configFilename = "config.json" configFilename = "config.json"
defaultRuntime = "runc" defaultRuntime = "runc"
defaultShim = "containerd-shim" defaultShim = "containerd-shim"
// cleanupTimeout is default timeout for cleanup operations
cleanupTimeout = 1 * time.Minute
) )
func init() { func init() {
@ -212,7 +215,10 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
} }
defer func() { defer func() {
if err != nil { if err != nil {
if kerr := s.KillShim(ctx); kerr != nil { deferCtx, deferCancel := context.WithTimeout(
namespaces.WithNamespace(context.TODO(), namespace), cleanupTimeout)
defer deferCancel()
if kerr := s.KillShim(deferCtx); kerr != nil {
log.G(ctx).WithError(err).Error("failed to kill shim") log.G(ctx).WithError(err).Error("failed to kill shim")
} }
} }

View file

@ -40,6 +40,7 @@ import (
"github.com/containerd/containerd/events" "github.com/containerd/containerd/events"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/dialer"
v1 "github.com/containerd/containerd/runtime/v1" v1 "github.com/containerd/containerd/runtime/v1"
"github.com/containerd/containerd/runtime/v1/shim" "github.com/containerd/containerd/runtime/v1/shim"
shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1"
@ -228,7 +229,7 @@ func connect(address string, d func(string, time.Duration) (net.Conn, error)) (n
func annonDialer(address string, timeout time.Duration) (net.Conn, error) { func annonDialer(address string, timeout time.Duration) (net.Conn, error) {
address = strings.TrimPrefix(address, "unix://") address = strings.TrimPrefix(address, "unix://")
return net.DialTimeout("unix", "\x00"+address, timeout) return dialer.Dialer("\x00"+address, timeout)
} }
// WithConnect connects to an existing shim // WithConnect connects to an existing shim

File diff suppressed because it is too large Load diff

View file

@ -8,6 +8,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
reflect "reflect" reflect "reflect"
strings "strings" strings "strings"
) )
@ -21,7 +22,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Options struct { type Options struct {
// disable pivot root when creating a container // disable pivot root when creating a container
@ -64,7 +65,7 @@ func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Options.Marshal(b, m, deterministic) return xxx_messageInfo_Options.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -120,7 +121,7 @@ func (m *CheckpointOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return xxx_messageInfo_CheckpointOptions.Marshal(b, m, deterministic) return xxx_messageInfo_CheckpointOptions.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -160,7 +161,7 @@ func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -233,7 +234,7 @@ var fileDescriptor_4e5440d739e9a863 = []byte{
func (m *Options) Marshal() (dAtA []byte, err error) { func (m *Options) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -241,96 +242,108 @@ func (m *Options) Marshal() (dAtA []byte, err error) {
} }
func (m *Options) MarshalTo(dAtA []byte) (int, error) { func (m *Options) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.NoPivotRoot { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.NoPivotRoot {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if m.NoNewKeyring { if len(m.CriuWorkPath) > 0 {
dAtA[i] = 0x10 i -= len(m.CriuWorkPath)
i++ copy(dAtA[i:], m.CriuWorkPath)
if m.NoNewKeyring { i = encodeVarintOci(dAtA, i, uint64(len(m.CriuWorkPath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x5a
dAtA[i] = 0
}
i++
} }
if len(m.ShimCgroup) > 0 { if len(m.CriuImagePath) > 0 {
dAtA[i] = 0x1a i -= len(m.CriuImagePath)
i++ copy(dAtA[i:], m.CriuImagePath)
i = encodeVarintOci(dAtA, i, uint64(len(m.ShimCgroup))) i = encodeVarintOci(dAtA, i, uint64(len(m.CriuImagePath)))
i += copy(dAtA[i:], m.ShimCgroup) i--
} dAtA[i] = 0x52
if m.IoUid != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintOci(dAtA, i, uint64(m.IoUid))
}
if m.IoGid != 0 {
dAtA[i] = 0x28
i++
i = encodeVarintOci(dAtA, i, uint64(m.IoGid))
}
if len(m.BinaryName) > 0 {
dAtA[i] = 0x32
i++
i = encodeVarintOci(dAtA, i, uint64(len(m.BinaryName)))
i += copy(dAtA[i:], m.BinaryName)
}
if len(m.Root) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintOci(dAtA, i, uint64(len(m.Root)))
i += copy(dAtA[i:], m.Root)
}
if len(m.CriuPath) > 0 {
dAtA[i] = 0x42
i++
i = encodeVarintOci(dAtA, i, uint64(len(m.CriuPath)))
i += copy(dAtA[i:], m.CriuPath)
} }
if m.SystemdCgroup { if m.SystemdCgroup {
dAtA[i] = 0x48 i--
i++
if m.SystemdCgroup { if m.SystemdCgroup {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x48
} }
if len(m.CriuImagePath) > 0 { if len(m.CriuPath) > 0 {
dAtA[i] = 0x52 i -= len(m.CriuPath)
i++ copy(dAtA[i:], m.CriuPath)
i = encodeVarintOci(dAtA, i, uint64(len(m.CriuImagePath))) i = encodeVarintOci(dAtA, i, uint64(len(m.CriuPath)))
i += copy(dAtA[i:], m.CriuImagePath) i--
dAtA[i] = 0x42
} }
if len(m.CriuWorkPath) > 0 { if len(m.Root) > 0 {
dAtA[i] = 0x5a i -= len(m.Root)
i++ copy(dAtA[i:], m.Root)
i = encodeVarintOci(dAtA, i, uint64(len(m.CriuWorkPath))) i = encodeVarintOci(dAtA, i, uint64(len(m.Root)))
i += copy(dAtA[i:], m.CriuWorkPath) i--
dAtA[i] = 0x3a
} }
if m.XXX_unrecognized != nil { if len(m.BinaryName) > 0 {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.BinaryName)
copy(dAtA[i:], m.BinaryName)
i = encodeVarintOci(dAtA, i, uint64(len(m.BinaryName)))
i--
dAtA[i] = 0x32
} }
return i, nil if m.IoGid != 0 {
i = encodeVarintOci(dAtA, i, uint64(m.IoGid))
i--
dAtA[i] = 0x28
}
if m.IoUid != 0 {
i = encodeVarintOci(dAtA, i, uint64(m.IoUid))
i--
dAtA[i] = 0x20
}
if len(m.ShimCgroup) > 0 {
i -= len(m.ShimCgroup)
copy(dAtA[i:], m.ShimCgroup)
i = encodeVarintOci(dAtA, i, uint64(len(m.ShimCgroup)))
i--
dAtA[i] = 0x1a
}
if m.NoNewKeyring {
i--
if m.NoNewKeyring {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if m.NoPivotRoot {
i--
if m.NoPivotRoot {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) { func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -338,103 +351,106 @@ func (m *CheckpointOptions) Marshal() (dAtA []byte, err error) {
} }
func (m *CheckpointOptions) MarshalTo(dAtA []byte) (int, error) { func (m *CheckpointOptions) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CheckpointOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Exit { if m.XXX_unrecognized != nil {
dAtA[i] = 0x8 i -= len(m.XXX_unrecognized)
i++ copy(dAtA[i:], m.XXX_unrecognized)
if m.Exit {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
} }
if m.OpenTcp { if len(m.WorkPath) > 0 {
dAtA[i] = 0x10 i -= len(m.WorkPath)
i++ copy(dAtA[i:], m.WorkPath)
if m.OpenTcp { i = encodeVarintOci(dAtA, i, uint64(len(m.WorkPath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x4a
dAtA[i] = 0
}
i++
} }
if m.ExternalUnixSockets { if len(m.ImagePath) > 0 {
dAtA[i] = 0x18 i -= len(m.ImagePath)
i++ copy(dAtA[i:], m.ImagePath)
if m.ExternalUnixSockets { i = encodeVarintOci(dAtA, i, uint64(len(m.ImagePath)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x42
dAtA[i] = 0
}
i++
} }
if m.Terminal { if len(m.CgroupsMode) > 0 {
dAtA[i] = 0x20 i -= len(m.CgroupsMode)
i++ copy(dAtA[i:], m.CgroupsMode)
if m.Terminal { i = encodeVarintOci(dAtA, i, uint64(len(m.CgroupsMode)))
dAtA[i] = 1 i--
} else { dAtA[i] = 0x3a
dAtA[i] = 0 }
if len(m.EmptyNamespaces) > 0 {
for iNdEx := len(m.EmptyNamespaces) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.EmptyNamespaces[iNdEx])
copy(dAtA[i:], m.EmptyNamespaces[iNdEx])
i = encodeVarintOci(dAtA, i, uint64(len(m.EmptyNamespaces[iNdEx])))
i--
dAtA[i] = 0x32
} }
i++
} }
if m.FileLocks { if m.FileLocks {
dAtA[i] = 0x28 i--
i++
if m.FileLocks { if m.FileLocks {
dAtA[i] = 1 dAtA[i] = 1
} else { } else {
dAtA[i] = 0 dAtA[i] = 0
} }
i++ i--
dAtA[i] = 0x28
} }
if len(m.EmptyNamespaces) > 0 { if m.Terminal {
for _, s := range m.EmptyNamespaces { i--
dAtA[i] = 0x32 if m.Terminal {
i++ dAtA[i] = 1
l = len(s) } else {
for l >= 1<<7 { dAtA[i] = 0
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
} }
i--
dAtA[i] = 0x20
} }
if len(m.CgroupsMode) > 0 { if m.ExternalUnixSockets {
dAtA[i] = 0x3a i--
i++ if m.ExternalUnixSockets {
i = encodeVarintOci(dAtA, i, uint64(len(m.CgroupsMode))) dAtA[i] = 1
i += copy(dAtA[i:], m.CgroupsMode) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
} }
if len(m.ImagePath) > 0 { if m.OpenTcp {
dAtA[i] = 0x42 i--
i++ if m.OpenTcp {
i = encodeVarintOci(dAtA, i, uint64(len(m.ImagePath))) dAtA[i] = 1
i += copy(dAtA[i:], m.ImagePath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
} }
if len(m.WorkPath) > 0 { if m.Exit {
dAtA[i] = 0x4a i--
i++ if m.Exit {
i = encodeVarintOci(dAtA, i, uint64(len(m.WorkPath))) dAtA[i] = 1
i += copy(dAtA[i:], m.WorkPath) } else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
} }
if m.XXX_unrecognized != nil { return len(dAtA) - i, nil
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
} }
func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { func (m *ProcessDetails) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -442,30 +458,39 @@ func (m *ProcessDetails) Marshal() (dAtA []byte, err error) {
} }
func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ProcessDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.ExecID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintOci(dAtA, i, uint64(len(m.ExecID)))
i += copy(dAtA[i:], m.ExecID)
}
if m.XXX_unrecognized != nil { if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized) i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
} }
return i, nil if len(m.ExecID) > 0 {
i -= len(m.ExecID)
copy(dAtA[i:], m.ExecID)
i = encodeVarintOci(dAtA, i, uint64(len(m.ExecID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintOci(dAtA []byte, offset int, v uint64) int { func encodeVarintOci(dAtA []byte, offset int, v uint64) int {
offset -= sovOci(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Options) Size() (n int) { func (m *Options) Size() (n int) {
if m == nil { if m == nil {
@ -580,14 +605,7 @@ func (m *ProcessDetails) Size() (n int) {
} }
func sovOci(x uint64) (n int) { func sovOci(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozOci(x uint64) (n int) { func sozOci(x uint64) (n int) {
return sovOci(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovOci(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -1366,6 +1384,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error {
func skipOci(dAtA []byte) (n int, err error) { func skipOci(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1397,10 +1416,8 @@ func skipOci(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1421,55 +1438,30 @@ func skipOci(dAtA []byte) (n int, err error) {
return 0, ErrInvalidLengthOci return 0, ErrInvalidLengthOci
} }
iNdEx += length iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthOci
}
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowOci
}
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 := skipOci(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthOci
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupOci
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthOci
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthOci = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthOci = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowOci = fmt.Errorf("proto: integer overflow") ErrIntOverflowOci = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupOci = fmt.Errorf("proto: unexpected end of group")
) )

View file

@ -20,6 +20,7 @@ import (
containersapi "github.com/containerd/containerd/api/services/containers/v1" containersapi "github.com/containerd/containerd/api/services/containers/v1"
"github.com/containerd/containerd/api/services/diff/v1" "github.com/containerd/containerd/api/services/diff/v1"
imagesapi "github.com/containerd/containerd/api/services/images/v1" imagesapi "github.com/containerd/containerd/api/services/images/v1"
introspectionapi "github.com/containerd/containerd/api/services/introspection/v1"
namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1" namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1"
"github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/containers" "github.com/containerd/containerd/containers"
@ -27,19 +28,21 @@ import (
"github.com/containerd/containerd/images" "github.com/containerd/containerd/images"
"github.com/containerd/containerd/leases" "github.com/containerd/containerd/leases"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/services/introspection"
"github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots"
) )
type services struct { type services struct {
contentStore content.Store contentStore content.Store
imageStore images.Store imageStore images.Store
containerStore containers.Store containerStore containers.Store
namespaceStore namespaces.Store namespaceStore namespaces.Store
snapshotters map[string]snapshots.Snapshotter snapshotters map[string]snapshots.Snapshotter
taskService tasks.TasksClient taskService tasks.TasksClient
diffService DiffService diffService DiffService
eventService EventService eventService EventService
leasesService leases.Manager leasesService leases.Manager
introspectionService introspection.Service
} }
// ServicesOpt allows callers to set options on the services // ServicesOpt allows callers to set options on the services
@ -110,3 +113,10 @@ func WithLeasesService(leasesService leases.Manager) ServicesOpt {
s.leasesService = leasesService s.leasesService = leasesService
} }
} }
// WithIntrospectionService sets the introspection service.
func WithIntrospectionService(in introspectionapi.IntrospectionClient) ServicesOpt {
return func(s *services) {
s.introspectionService = introspection.NewIntrospectionServiceFromClient(in)
}
}

View file

@ -115,7 +115,7 @@ func (s *service) List(req *api.ListContentRequest, session api.Content_ListServ
return nil return nil
}, req.Filters...); err != nil { }, req.Filters...); err != nil {
return err return errdefs.ToGRPC(err)
} }
if len(buffer) > 0 { if len(buffer) > 0 {

View file

@ -0,0 +1,62 @@
/*
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 introspection
import (
context "context"
api "github.com/containerd/containerd/api/services/introspection/v1"
"github.com/containerd/containerd/errdefs"
ptypes "github.com/gogo/protobuf/types"
)
type Service interface {
Plugins(context.Context, []string) (*api.PluginsResponse, error)
Server(context.Context, *ptypes.Empty) (*api.ServerResponse, error)
}
type introspectionRemote struct {
client api.IntrospectionClient
}
var _ = (Service)(&introspectionRemote{})
func NewIntrospectionServiceFromClient(c api.IntrospectionClient) Service {
return &introspectionRemote{client: c}
}
func (i *introspectionRemote) Plugins(ctx context.Context, filters []string) (*api.PluginsResponse, error) {
resp, err := i.client.Plugins(ctx, &api.PluginsRequest{
Filters: filters,
})
if err != nil {
return nil, errdefs.FromGRPC(err)
}
return resp, nil
}
func (i *introspectionRemote) Server(ctx context.Context, in *ptypes.Empty) (*api.ServerResponse, error) {
resp, err := i.client.Server(ctx, in)
if err != nil {
return nil, errdefs.FromGRPC(err)
}
return resp, nil
}

View file

@ -0,0 +1,227 @@
/*
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 introspection
import (
context "context"
"io/ioutil"
"os"
"path/filepath"
"sync"
api "github.com/containerd/containerd/api/services/introspection/v1"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/filters"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/services"
"github.com/gogo/googleapis/google/rpc"
ptypes "github.com/gogo/protobuf/types"
"github.com/google/uuid"
"google.golang.org/grpc"
"google.golang.org/grpc/status"
)
func init() {
plugin.Register(&plugin.Registration{
Type: plugin.ServicePlugin,
ID: services.IntrospectionService,
Requires: []plugin.Type{},
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
// this service works by using the plugin context up till the point
// this service is initialized. Since we require this service last,
// it should provide the full set of plugins.
pluginsPB := pluginsToPB(ic.GetAll())
return &Local{
plugins: pluginsPB,
root: ic.Root,
}, nil
},
})
}
type Local struct {
mu sync.Mutex
plugins []api.Plugin
root string
}
var _ = (api.IntrospectionClient)(&Local{})
func (l *Local) UpdateLocal(root string, plugins []api.Plugin) {
l.mu.Lock()
defer l.mu.Unlock()
l.root = root
l.plugins = plugins
}
func (l *Local) Plugins(ctx context.Context, req *api.PluginsRequest, _ ...grpc.CallOption) (*api.PluginsResponse, error) {
filter, err := filters.ParseAll(req.Filters...)
if err != nil {
return nil, errdefs.ToGRPCf(errdefs.ErrInvalidArgument, err.Error())
}
var plugins []api.Plugin
allPlugins := l.getPlugins()
for _, p := range allPlugins {
if !filter.Match(adaptPlugin(p)) {
continue
}
plugins = append(plugins, p)
}
return &api.PluginsResponse{
Plugins: plugins,
}, nil
}
func (l *Local) getPlugins() []api.Plugin {
l.mu.Lock()
defer l.mu.Unlock()
return l.plugins
}
func (l *Local) Server(ctx context.Context, _ *ptypes.Empty, _ ...grpc.CallOption) (*api.ServerResponse, error) {
u, err := l.getUUID()
if err != nil {
return nil, errdefs.ToGRPC(err)
}
return &api.ServerResponse{
UUID: u,
}, nil
}
func (l *Local) getUUID() (string, error) {
l.mu.Lock()
defer l.mu.Unlock()
data, err := ioutil.ReadFile(l.uuidPath())
if err != nil {
if os.IsNotExist(err) {
return l.generateUUID()
}
return "", err
}
u := string(data)
if _, err := uuid.Parse(u); err != nil {
return "", err
}
return u, nil
}
func (l *Local) generateUUID() (string, error) {
u, err := uuid.NewRandom()
if err != nil {
return "", err
}
path := l.uuidPath()
if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil {
return "", err
}
uu := u.String()
if err := ioutil.WriteFile(path, []byte(uu), 0666); err != nil {
return "", err
}
return uu, nil
}
func (l *Local) uuidPath() string {
return filepath.Join(l.root, "uuid")
}
func adaptPlugin(o interface{}) filters.Adaptor {
obj := o.(api.Plugin)
return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
if len(fieldpath) == 0 {
return "", false
}
switch fieldpath[0] {
case "type":
return obj.Type, len(obj.Type) > 0
case "id":
return obj.ID, len(obj.ID) > 0
case "platforms":
// TODO(stevvooe): Another case here where have multiple values.
// May need to refactor the filter system to allow filtering by
// platform, if this is required.
case "capabilities":
// TODO(stevvooe): Need a better way to match against
// collections. We can only return "the value" but really it
// would be best if we could return a set of values for the
// path, any of which could match.
}
return "", false
})
}
func pluginsToPB(plugins []*plugin.Plugin) []api.Plugin {
var pluginsPB []api.Plugin
for _, p := range plugins {
var platforms []types.Platform
for _, p := range p.Meta.Platforms {
platforms = append(platforms, types.Platform{
OS: p.OS,
Architecture: p.Architecture,
Variant: p.Variant,
})
}
var requires []string
for _, r := range p.Registration.Requires {
requires = append(requires, r.String())
}
var initErr *rpc.Status
if err := p.Err(); err != nil {
st, ok := status.FromError(errdefs.ToGRPC(err))
if ok {
var details []*ptypes.Any
for _, d := range st.Proto().Details {
details = append(details, &ptypes.Any{
TypeUrl: d.TypeUrl,
Value: d.Value,
})
}
initErr = &rpc.Status{
Code: int32(st.Code()),
Message: st.Message(),
Details: details,
}
} else {
initErr = &rpc.Status{
Code: int32(rpc.UNKNOWN),
Message: err.Error(),
}
}
}
pluginsPB = append(pluginsPB, api.Plugin{
Type: p.Registration.Type.String(),
ID: p.Registration.ID,
Requires: requires,
Platforms: platforms,
Capabilities: p.Meta.Capabilities,
Exports: p.Meta.Exports,
InitErr: initErr,
})
}
return pluginsPB
}

View file

@ -0,0 +1,85 @@
/*
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 introspection
import (
context "context"
api "github.com/containerd/containerd/api/services/introspection/v1"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/services"
ptypes "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
"google.golang.org/grpc"
)
func init() {
plugin.Register(&plugin.Registration{
Type: plugin.GRPCPlugin,
ID: "introspection",
Requires: []plugin.Type{"*"},
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
// this service works by using the plugin context up till the point
// this service is initialized. Since we require this service last,
// it should provide the full set of plugins.
plugins, err := ic.GetByType(plugin.ServicePlugin)
if err != nil {
return nil, err
}
p, ok := plugins[services.IntrospectionService]
if !ok {
return nil, errors.New("introspection service not found")
}
i, err := p.Instance()
if err != nil {
return nil, err
}
allPluginsPB := pluginsToPB(ic.GetAll())
localClient, ok := i.(*Local)
if !ok {
return nil, errors.Errorf("Could not create a local client for introspection service")
}
localClient.UpdateLocal(ic.Root, allPluginsPB)
return &server{
local: localClient,
}, nil
},
})
}
type server struct {
local api.IntrospectionClient
}
var _ = (api.IntrospectionServer)(&server{})
func (s *server) Register(server *grpc.Server) error {
api.RegisterIntrospectionServer(server, s)
return nil
}
func (s *server) Plugins(ctx context.Context, req *api.PluginsRequest) (*api.PluginsResponse, error) {
return s.local.Plugins(ctx, req)
}
func (s *server) Server(ctx context.Context, empty *ptypes.Empty) (*api.ServerResponse, error) {
return s.local.Server(ctx, empty)
}

View file

@ -28,6 +28,8 @@ import (
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
) )
// NOTE: Any new map fields added also need to be handled in mergeConfig.
// Config provides containerd configuration data for the server // Config provides containerd configuration data for the server
type Config struct { type Config struct {
// Version of the config file // Version of the config file
@ -321,6 +323,10 @@ func mergeConfig(to, from *Config) error {
to.ProxyPlugins[k] = v to.ProxyPlugins[k] = v
} }
for k, v := range from.Timeouts {
to.Timeouts[k] = v
}
return nil return nil
} }

View file

@ -0,0 +1,38 @@
/*
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 services
const (
// ContentService is id of content service.
ContentService = "content-service"
// SnapshotsService is id of snapshots service.
SnapshotsService = "snapshots-service"
// ImagesService is id of images service.
ImagesService = "images-service"
// ContainersService is id of containers service.
ContainersService = "containers-service"
// TasksService is id of tasks service.
TasksService = "tasks-service"
// NamespacesService is id of namespaces service.
NamespacesService = "namespaces-service"
// LeasesService is id of leases service.
LeasesService = "leases-service"
// DiffService is id of diff service.
DiffService = "diff-service"
// IntrospectionService is the id of introspection service
IntrospectionService = "introspection-service"
)

View file

@ -153,9 +153,10 @@ func (p *proxySnapshotter) Remove(ctx context.Context, key string) error {
return errdefs.FromGRPC(err) return errdefs.FromGRPC(err)
} }
func (p *proxySnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error { func (p *proxySnapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...string) error {
sc, err := p.client.List(ctx, &snapshotsapi.ListSnapshotsRequest{ sc, err := p.client.List(ctx, &snapshotsapi.ListSnapshotsRequest{
Snapshotter: p.snapshotterName, Snapshotter: p.snapshotterName,
Filters: fs,
}) })
if err != nil { if err != nil {
return errdefs.FromGRPC(err) return errdefs.FromGRPC(err)
@ -183,6 +184,13 @@ func (p *proxySnapshotter) Close() error {
return nil return nil
} }
func (p *proxySnapshotter) Cleanup(ctx context.Context) error {
_, err := p.client.Cleanup(ctx, &snapshotsapi.CleanupRequest{
Snapshotter: p.snapshotterName,
})
return errdefs.FromGRPC(err)
}
func toKind(kind snapshotsapi.Kind) snapshots.Kind { func toKind(kind snapshotsapi.Kind) snapshots.Kind {
if kind == snapshotsapi.KindActive { if kind == snapshotsapi.KindActive {
return snapshots.KindActive return snapshots.KindActive

View file

@ -25,6 +25,11 @@ import (
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
) )
const (
inheritedLabelsPrefix = "containerd.io/snapshot/"
labelSnapshotRef = "containerd.io/snapshot.ref"
)
// Kind identifies the kind of snapshot. // Kind identifies the kind of snapshot.
type Kind uint8 type Kind uint8
@ -118,6 +123,9 @@ func (u *Usage) Add(other Usage) {
u.Inodes += other.Inodes u.Inodes += other.Inodes
} }
// WalkFunc defines the callback for a snapshot walk.
type WalkFunc func(context.Context, Info) error
// Snapshotter defines the methods required to implement a snapshot snapshotter for // Snapshotter defines the methods required to implement a snapshot snapshotter for
// allocating, snapshotting and mounting filesystem changesets. The model works // allocating, snapshotting and mounting filesystem changesets. The model works
// by building up sets of changes with parent-child relationships. // by building up sets of changes with parent-child relationships.
@ -314,9 +322,15 @@ type Snapshotter interface {
// removed before proceeding. // removed before proceeding.
Remove(ctx context.Context, key string) error Remove(ctx context.Context, key string) error
// Walk all snapshots in the snapshotter. For each snapshot in the // Walk will call the provided function for each snapshot in the
// snapshotter, the function will be called. // snapshotter which match the provided filters. If no filters are
Walk(ctx context.Context, fn func(context.Context, Info) error) error // given all items will be walked.
// Filters:
// name
// parent
// kind (active,view,committed)
// labels.(label)
Walk(ctx context.Context, fn WalkFunc, filters ...string) error
// Close releases the internal resources. // Close releases the internal resources.
// //
@ -327,6 +341,17 @@ type Snapshotter interface {
Close() error Close() error
} }
// Cleaner defines a type capable of performing asynchronous resource cleanup.
// The Cleaner interface should be used by snapshotters which implement fast
// removal and deferred resource cleanup. This prevents snapshots from needing
// to perform lengthy resource cleanup before acknowledging a snapshot key
// has been removed and available for re-use. This is also useful when
// performing multi-key removal with the intent of cleaning up all the
// resources after each snapshot key has been removed.
type Cleaner interface {
Cleanup(ctx context.Context) error
}
// Opt allows setting mutable snapshot properties on creation // Opt allows setting mutable snapshot properties on creation
type Opt func(info *Info) error type Opt func(info *Info) error
@ -337,3 +362,20 @@ func WithLabels(labels map[string]string) Opt {
return nil return nil
} }
} }
// FilterInheritedLabels filters the provided labels by removing any key which
// isn't a snapshot label. Snapshot labels have a prefix of "containerd.io/snapshot/"
// or are the "containerd.io/snapshot.ref" label.
func FilterInheritedLabels(labels map[string]string) map[string]string {
if labels == nil {
return nil
}
filtered := make(map[string]string)
for k, v := range labels {
if k == labelSnapshotRef || strings.HasPrefix(k, inheritedLabelsPrefix) {
filtered[k] = v
}
}
return filtered
}

View file

@ -68,11 +68,11 @@ func GetLocalListener(path string, uid, gid int) (net.Listener, error) {
} }
func mkdirAs(path string, uid, gid int) error { func mkdirAs(path string, uid, gid int) error {
if _, err := os.Stat(path); err == nil || !os.IsNotExist(err) { if _, err := os.Stat(path); !os.IsNotExist(err) {
return err return err
} }
if err := os.Mkdir(path, 0770); err != nil { if err := os.MkdirAll(path, 0770); err != nil {
return err return err
} }

View file

@ -159,7 +159,7 @@ type Task interface {
// Pids returns a list of system specific process ids inside the task // Pids returns a list of system specific process ids inside the task
Pids(context.Context) ([]ProcessInfo, error) Pids(context.Context) ([]ProcessInfo, error)
// Checkpoint serializes the runtime and memory information of a task into an // Checkpoint serializes the runtime and memory information of a task into an
// OCI Index that can be push and pulled from a remote resource. // OCI Index that can be pushed and pulled from a remote resource.
// //
// Additional software like CRIU maybe required to checkpoint and restore tasks // Additional software like CRIU maybe required to checkpoint and restore tasks
// NOTE: Checkpoint supports to dump task information to a directory, in this way, // NOTE: Checkpoint supports to dump task information to a directory, in this way,

View file

@ -103,3 +103,55 @@ func WithShimCgroup(path string) NewTaskOpts {
return nil return nil
} }
} }
// WithUIDOwner allows console I/O to work with the remapped UID in user namespace
func WithUIDOwner(uid uint32) NewTaskOpts {
return func(ctx context.Context, c *Client, ti *TaskInfo) error {
if CheckRuntime(ti.Runtime(), "io.containerd.runc") {
if ti.Options == nil {
ti.Options = &options.Options{}
}
opts, ok := ti.Options.(*options.Options)
if !ok {
return errors.New("invalid v2 shim create options format")
}
opts.IoUid = uid
} else {
if ti.Options == nil {
ti.Options = &runctypes.CreateOptions{}
}
opts, ok := ti.Options.(*runctypes.CreateOptions)
if !ok {
return errors.New("could not cast TaskInfo Options to CreateOptions")
}
opts.IoUid = uid
}
return nil
}
}
// WithGIDOwner allows console I/O to work with the remapped GID in user namespace
func WithGIDOwner(gid uint32) NewTaskOpts {
return func(ctx context.Context, c *Client, ti *TaskInfo) error {
if CheckRuntime(ti.Runtime(), "io.containerd.runc") {
if ti.Options == nil {
ti.Options = &options.Options{}
}
opts, ok := ti.Options.(*options.Options)
if !ok {
return errors.New("invalid v2 shim create options format")
}
opts.IoGid = gid
} else {
if ti.Options == nil {
ti.Options = &runctypes.CreateOptions{}
}
opts, ok := ti.Options.(*runctypes.CreateOptions)
if !ok {
return errors.New("could not cast TaskInfo Options to CreateOptions")
}
opts.IoGid = gid
}
return nil
}
}

View file

@ -18,34 +18,39 @@ package containerd
import ( import (
"context" "context"
"encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"math/rand"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time"
"github.com/containerd/containerd/content" "github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images" "github.com/containerd/containerd/images"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/mount"
"github.com/containerd/containerd/snapshots"
"github.com/opencontainers/go-digest" "github.com/opencontainers/go-digest"
"github.com/opencontainers/image-spec/identity" "github.com/opencontainers/image-spec/identity"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
) )
type layerState struct { const (
layer rootfs.Layer labelSnapshotRef = "containerd.io/snapshot.ref"
downloaded bool )
unpacked bool
}
type unpacker struct { type unpacker struct {
updateCh chan ocispec.Descriptor updateCh chan ocispec.Descriptor
snapshotter string snapshotter string
config UnpackConfig config UnpackConfig
c *Client c *Client
limiter *semaphore.Weighted
} }
func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacker, error) { func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacker, error) {
@ -67,7 +72,7 @@ func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacke
}, nil }, nil
} }
func (u *unpacker) unpack(ctx context.Context, config ocispec.Descriptor, layers []ocispec.Descriptor) error { func (u *unpacker) unpack(ctx context.Context, h images.Handler, config ocispec.Descriptor, layers []ocispec.Descriptor) error {
p, err := content.ReadBlob(ctx, u.c.ContentStore(), config) p, err := content.ReadBlob(ctx, u.c.ContentStore(), config)
if err != nil { if err != nil {
return err return err
@ -87,85 +92,135 @@ func (u *unpacker) unpack(ctx context.Context, config ocispec.Descriptor, layers
a = u.c.DiffService() a = u.c.DiffService()
cs = u.c.ContentStore() cs = u.c.ContentStore()
states []layerState chain []digest.Digest
chain []digest.Digest
fetchOffset int
fetchC []chan struct{}
fetchErr chan error
) )
// If there is an early return, ensure any ongoing
// fetches get their context cancelled
ctx, cancel := context.WithCancel(ctx)
defer cancel()
EachLayer:
for i, desc := range layers { for i, desc := range layers {
states = append(states, layerState{ parent := identity.ChainID(chain)
layer: rootfs.Layer{ chain = append(chain, diffIDs[i])
Blob: desc,
Diff: ocispec.Descriptor{ chainID := identity.ChainID(chain).String()
MediaType: ocispec.MediaTypeImageLayer, if _, err := sn.Stat(ctx, chainID); err == nil {
Digest: diffIDs[i], // no need to handle
}, continue
}, } else if !errdefs.IsNotFound(err) {
}) return errors.Wrapf(err, "failed to stat snapshot %s", chainID)
}
for {
var layer ocispec.Descriptor
select {
case layer = <-u.updateCh:
case <-ctx.Done():
return ctx.Err()
} }
log.G(ctx).WithField("desc", layer).Debug("layer downloaded")
for i := range states { // inherits annotations which are provided as snapshot labels.
if states[i].layer.Blob.Digest != layer.Digest { labels := snapshots.FilterInheritedLabels(desc.Annotations)
continue if labels == nil {
} labels = make(map[string]string)
// Different layers may have the same digest. When that
// happens, we should continue marking the next layer
// as downloaded.
if states[i].downloaded {
continue
}
states[i].downloaded = true
break
} }
for i := range states { labels[labelSnapshotRef] = chainID
if !states[i].downloaded { labelOpt := snapshots.WithLabels(labels)
var (
key string
mounts []mount.Mount
)
for try := 1; try <= 3; try++ {
// Prepare snapshot with from parent, label as root
key = fmt.Sprintf("extract-%s %s", uniquePart(), chainID)
mounts, err = sn.Prepare(ctx, key, parent.String(), labelOpt)
if err != nil {
if errdefs.IsAlreadyExists(err) {
if _, err := sn.Stat(ctx, chainID); err != nil {
if !errdefs.IsNotFound(err) {
return errors.Wrapf(err, "failed to stat snapshot %s", chainID)
}
// Try again, this should be rare, log it
log.G(ctx).WithField("key", key).WithField("chainid", chainID).Debug("extraction snapshot already exists, chain id not found")
} else {
// no need to handle, snapshot now found with chain id
continue EachLayer
}
} else {
return errors.Wrapf(err, "failed to prepare extraction snapshot %q", key)
}
} else {
break break
} }
if states[i].unpacked { }
continue if err != nil {
return errors.Wrap(err, "unable to prepare extraction snapshot")
}
// Abort the snapshot if commit does not happen
abort := func() {
if err := sn.Remove(ctx, key); err != nil {
log.G(ctx).WithError(err).Errorf("failed to cleanup %q", key)
}
}
if fetchErr == nil {
fetchErr = make(chan error, 1)
fetchOffset = i
fetchC = make([]chan struct{}, len(layers)-fetchOffset)
for i := range fetchC {
fetchC[i] = make(chan struct{})
} }
log.G(ctx).WithFields(logrus.Fields{ go func() {
"desc": states[i].layer.Blob, err := u.fetch(ctx, h, layers[i:], fetchC)
"diff": states[i].layer.Diff, if err != nil {
}).Debug("unpack layer") fetchErr <- err
}
close(fetchErr)
}()
}
unpacked, err := rootfs.ApplyLayerWithOpts(ctx, states[i].layer, chain, sn, a, select {
u.config.SnapshotOpts, u.config.ApplyOpts) case <-ctx.Done():
return ctx.Err()
case err := <-fetchErr:
if err != nil { if err != nil {
return err return err
} }
case <-fetchC[i-fetchOffset]:
}
if unpacked { diff, err := a.Apply(ctx, desc, mounts, u.config.ApplyOpts...)
// Set the uncompressed label after the uncompressed if err != nil {
// digest has been verified through apply. abort()
cinfo := content.Info{ return errors.Wrapf(err, "failed to extract layer %s", diffIDs[i])
Digest: states[i].layer.Blob.Digest, }
Labels: map[string]string{ if diff.Digest != diffIDs[i] {
"containerd.io/uncompressed": states[i].layer.Diff.Digest.String(), abort()
}, return errors.Errorf("wrong diff id calculated on extraction %q", diffIDs[i])
} }
if _, err := cs.Update(ctx, cinfo, "labels.containerd.io/uncompressed"); err != nil {
return err if err = sn.Commit(ctx, chainID, key, labelOpt); err != nil {
} abort()
if errdefs.IsAlreadyExists(err) {
continue
} }
return errors.Wrapf(err, "failed to commit snapshot %s", key)
}
chain = append(chain, states[i].layer.Diff.Digest) // Set the uncompressed label after the uncompressed
states[i].unpacked = true // digest has been verified through apply.
log.G(ctx).WithFields(logrus.Fields{ cinfo := content.Info{
"desc": states[i].layer.Blob, Digest: desc.Digest,
"diff": states[i].layer.Diff, Labels: map[string]string{
}).Debug("layer unpacked") "containerd.io/uncompressed": diff.Digest.String(),
},
} }
// Check whether all layers are unpacked. if _, err := cs.Update(ctx, cinfo, "labels.containerd.io/uncompressed"); err != nil {
if states[len(states)-1].unpacked { return err
break
} }
} }
chainID := identity.ChainID(chain).String() chainID := identity.ChainID(chain).String()
@ -183,16 +238,45 @@ func (u *unpacker) unpack(ctx context.Context, config ocispec.Descriptor, layers
"config": config.Digest, "config": config.Digest,
"chainID": chainID, "chainID": chainID,
}).Debug("image unpacked") }).Debug("image unpacked")
return nil return nil
} }
func (u *unpacker) fetch(ctx context.Context, h images.Handler, layers []ocispec.Descriptor, done []chan struct{}) error {
eg, ctx2 := errgroup.WithContext(ctx)
for i, desc := range layers {
desc := desc
i := i
if u.limiter != nil {
if err := u.limiter.Acquire(ctx, 1); err != nil {
return err
}
}
eg.Go(func() error {
_, err := h.Handle(ctx2, desc)
if u.limiter != nil {
u.limiter.Release(1)
}
if err != nil && errors.Cause(err) != images.ErrSkipDesc {
return err
}
close(done[i])
return nil
})
}
return eg.Wait()
}
func (u *unpacker) handlerWrapper(uctx context.Context, unpacks *int32) (func(images.Handler) images.Handler, *errgroup.Group) { func (u *unpacker) handlerWrapper(uctx context.Context, unpacks *int32) (func(images.Handler) images.Handler, *errgroup.Group) {
eg, uctx := errgroup.WithContext(uctx) eg, uctx := errgroup.WithContext(uctx)
return func(f images.Handler) images.Handler { return func(f images.Handler) images.Handler {
var ( var (
lock sync.Mutex lock sync.Mutex
layers []ocispec.Descriptor layers = map[digest.Digest][]ocispec.Descriptor{}
schema1 bool
) )
return images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { return images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
children, err := f.Handle(ctx, desc) children, err := f.Handle(ctx, desc)
@ -200,44 +284,48 @@ func (u *unpacker) handlerWrapper(uctx context.Context, unpacks *int32) (func(im
return children, err return children, err
} }
// `Pull` only supports one platform, so there is only switch desc.MediaType {
// one manifest to handle, and manifest list can be case images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
// safely skipped. var nonLayers []ocispec.Descriptor
// TODO: support multi-platform unpack. var manifestLayers []ocispec.Descriptor
switch mt := desc.MediaType; {
case mt == images.MediaTypeDockerSchema1Manifest: // Split layers from non-layers, layers will be handled after
lock.Lock() // the config
schema1 = true
lock.Unlock()
case mt == images.MediaTypeDockerSchema2Manifest || mt == ocispec.MediaTypeImageManifest:
lock.Lock()
for _, child := range children { for _, child := range children {
if child.MediaType == images.MediaTypeDockerSchema2Config || if images.IsLayerType(child.MediaType) {
child.MediaType == ocispec.MediaTypeImageConfig { manifestLayers = append(manifestLayers, child)
continue } else {
nonLayers = append(nonLayers, child)
} }
layers = append(layers, child) }
lock.Lock()
for _, nl := range nonLayers {
layers[nl.Digest] = manifestLayers
} }
lock.Unlock() lock.Unlock()
case mt == images.MediaTypeDockerSchema2Config || mt == ocispec.MediaTypeImageConfig:
children = nonLayers
case images.MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig:
lock.Lock() lock.Lock()
l := append([]ocispec.Descriptor{}, layers...) l := layers[desc.Digest]
lock.Unlock() lock.Unlock()
if len(l) > 0 { if len(l) > 0 {
atomic.AddInt32(unpacks, 1) atomic.AddInt32(unpacks, 1)
eg.Go(func() error { eg.Go(func() error {
return u.unpack(uctx, desc, l) return u.unpack(uctx, f, desc, l)
}) })
} }
case images.IsLayerType(mt):
lock.Lock()
update := !schema1
lock.Unlock()
if update {
u.updateCh <- desc
}
} }
return children, nil return children, nil
}) })
}, eg }, eg
} }
func uniquePart() string {
t := time.Now()
var b [3]byte
// Ignore read failures, just decreases uniqueness
rand.Read(b[:])
return fmt.Sprintf("%d-%s", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:]))
}

View file

@ -1,91 +1,96 @@
github.com/containerd/go-runc e029b79d8cda8374981c64eba71f28ec38e5526f github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1
github.com/containerd/console 0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1
github.com/containerd/cgroups abd0b19954a6b05e0963f48427062d1481b7faad github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40 github.com/containerd/btrfs 153935315f4ab9be5bf03650a1341454b05efa5d
github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13 github.com/containerd/cgroups 7347743e5d1e8500d9f27c8e748e689ed991d92b
github.com/containerd/btrfs af5082808c833de0e79c1e72eea9fea239364877 github.com/containerd/console 8375c3424e4d7b114e8a90a4a40c8e1b40d1d4e6
github.com/containerd/continuity f2a389ac0a02ce21c09edd7344677a601970f41c github.com/containerd/continuity 0ec596719c75bfd42908850990acea594b7593ac
github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13
github.com/docker/go-metrics 4ea375f7759c82740c893fc030bc37088d2ec098 github.com/containerd/go-runc a5c2862aed5e6358b305b0e16bfce58e0549b1cd
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 github.com/containerd/ttrpc 92c8520ef9f86600c650dd540266a007bf03670f
github.com/docker/go-units v0.4.0 github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f github.com/coreos/go-systemd/v22 2d78030078ef61b3cae27f42ad6d0e46db51b339 # v22.0.0
github.com/prometheus/client_golang f4fb1b73fb099f396a7f0036bf86aa8def4ed823 github.com/cpuguy83/go-md2man 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19 # v1.0.10
github.com/prometheus/client_model 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/prometheus/common 89604d197083d4781071d3c65855d24ecfb0a563 github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1
github.com/prometheus/procfs cb4147076ac75738c9a7d279075a253c0cc5acbd github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 github.com/godbus/dbus/v5 37bf87eef99d69c4f1d3528bd66e3a87dc201472 # v5.0.3
github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/gogo/googleapis 01e0f9cca9b92166042241267ee2a5cdf5cff46c # v1.3.2
github.com/gogo/protobuf v1.2.1 github.com/gogo/protobuf 5628607bb4c51c3157aacc3a50f0ab707582b805 # v1.3.1
github.com/gogo/googleapis v1.2.0 github.com/golang/protobuf d23c5127dc24889085f8ccea5c9d560a57a879d8 # v1.3.3
github.com/golang/protobuf v1.2.0 github.com/google/go-cmp 3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0
github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 # v1.0.1-59-g29686db github.com/google/uuid 0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1
github.com/opencontainers/runc d736ef14f0288d6993a1845745d6756cfc9ddd5a # v1.0.0-rc9 github.com/grpc-ecosystem/go-grpc-prometheus c225b8c3b01faf2899099b768856a9e916e5087b # v1.2.0
github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/hashicorp/errwrap 8a6fb523712970c966eefc6b39ed2c5e74880354 # v1.0.0
github.com/sirupsen/logrus v1.4.1 github.com/hashicorp/go-multierror 886a7fbe3eb1c874d46f623bfa70af45f425b3d1 # v1.0.0
github.com/urfave/cli v1.22.0 github.com/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3
golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3 github.com/imdario/mergo 7c29201646fa3de8506f701213473dd407f19646 # v0.3.7
google.golang.org/grpc 6eaf6f47437a6b4e2153a190160ef39a92c7eceb # v1.23.0 github.com/konsorten/go-windows-terminal-sequences 5c8c8bd35d3832f5d134ae1e1e375b69a4d25242 # v1.0.1
github.com/pkg/errors v0.8.1 github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7 github.com/Microsoft/go-winio 6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14
golang.org/x/sys 9eafafc0a87e0fd0aeeba439a4573537970c44c7 https://github.com/golang/sys github.com/Microsoft/hcsshim 0b571ac85d7c5842b26d2571de4868634a4c39d7 # v0.8.7-24-g0b571ac8
github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e github.com/opencontainers/image-spec d60099175f88c47cd379c4738d158884749ed235 # v1.0.1
github.com/BurntSushi/toml v0.3.1 github.com/opencontainers/runc dc9208a3303feef5b3839f4323d9beb36df0a9dd # v1.0.0-rc10
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0 github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 # v1.0.1-59-g29686db
github.com/Microsoft/go-winio v0.4.14 github.com/pkg/errors ba968bfe8b2f7e042a574c888954fccecfa385b4 # v0.8.1
github.com/Microsoft/hcsshim 9e921883ac929bbe515b39793ece99ce3a9d7706 github.com/prometheus/client_golang c42bebe5a5cddfc6b28cd639103369d8a75dfa89 # v1.3.0
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 github.com/prometheus/client_model d1d2010b5beead3fa1c5f271a5cf626e40b3ad6e # v0.1.0
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 github.com/prometheus/common 287d3e634a1e550c9e463dd7e5a75a422c614505 # v0.7.0
github.com/containerd/ttrpc 92c8520ef9f86600c650dd540266a007bf03670f github.com/prometheus/procfs 6d489fc7f1d9cd890a250f3ea3431b1744b9623f # v0.0.8
github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2 github.com/russross/blackfriday 05f3235734ad95d0016f6a23902f06461fcf567a # v1.5.2
gotest.tools v2.3.0 github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1
github.com/google/go-cmp v0.2.0 github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2
go.etcd.io/bbolt v1.3.3 github.com/urfave/cli bfe2e925cfb6d44b40ad3a779165ea7e8aff9212 # v1.22.0
github.com/hashicorp/errwrap v1.0.0 go.etcd.io/bbolt a0458a2b35708eef59eb5f620ceb3cd1c01a824d # v1.3.3
github.com/hashicorp/go-multierror v1.0.0 go.opencensus.io 9c377598961b706d1542bd2d84d538b5094d596e # v0.22.0
github.com/hashicorp/golang-lru v0.5.3 golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3
go.opencensus.io v0.22.0 golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e
github.com/imdario/mergo v0.3.7 golang.org/x/sys c990c680b611ac1aeb7d8f2af94a825f98d69720 https://github.com/golang/sys
github.com/cpuguy83/go-md2man v1.0.10 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
github.com/russross/blackfriday v1.5.2 google.golang.org/genproto e50cd9704f63023d62cd06a1994b98227fc4d21a
google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1
gotest.tools 1083505acf35a0bd8a696b26837e1fb3187a7a83 # v2.3.0
# cri dependencies # cri dependencies
github.com/containerd/cri 0ebf032aac5f6029f95a94e42161e9db7a7e84df # release/1.3+ github.com/containerd/cri c0294ebfe0b4342db85c0faf7727ceb8d8c3afce # master
github.com/containerd/go-cni 0d360c50b10b350b6bb23863fd4dfb1c232b01c9 github.com/containerd/go-cni 0d360c50b10b350b6bb23863fd4dfb1c232b01c9
github.com/containernetworking/cni v0.7.1 github.com/containernetworking/cni 4cfb7b568922a3c79a23e438dc52fe537fc9687e # v0.7.1
github.com/containernetworking/plugins v0.7.6 github.com/containernetworking/plugins 9f96827c7cabb03f21d86326000c00f61e181f6a # v0.7.6
github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1
github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580
github.com/docker/docker 86f080cff0914e9694068ed78d503701667c4c00 github.com/docker/docker d1d5f6476656c6aad457e2a91d3436e66b6f2251
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528 github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
github.com/emicklei/go-restful v2.9.5 github.com/emicklei/go-restful b993709ae1a4f6dd19cfa475232614441b11c9d5 # v2.9.5
github.com/google/gofuzz v1.0.0 github.com/google/gofuzz f140a6486e521aad38f5917de355cbf147cc0496 # v1.0.0
github.com/json-iterator/go v1.1.7 github.com/json-iterator/go 03217c3e97663914aec3faafde50d081f197a0a2 # v1.1.8
github.com/modern-go/reflect2 1.0.1 github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3
github.com/modern-go/concurrent 1.0.3 github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1
github.com/opencontainers/selinux v1.2.2 github.com/opencontainers/selinux 5215b1806f52b1fcc2070a8826c542c9d33cd3cf
github.com/seccomp/libseccomp-golang v0.9.1 github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1
github.com/tchap/go-patricia v2.2.6 github.com/stretchr/testify 221dbe5ed46703ee255b1da0dec05086f5035f62 # v1.4.0
golang.org/x/crypto 5c40567a22f818bd14a1ea7245dad9f8ef0691aa github.com/tchap/go-patricia 666120de432aea38ab06bd5c818f04f4129882c9 # v2.2.6
golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33 golang.org/x/crypto 1d94cc7ab1c630336ab82ccb9c9cda72a875c382
golang.org/x/time 85acf8d2951cb2a3bde7632f9ff273ef0379bcbd golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33
gopkg.in/inf.v0 v0.9.0 golang.org/x/time 9d24e82272b4f38b78bc8cff74fa936d31ccd8ef
gopkg.in/yaml.v2 v2.2.2 gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1
k8s.io/api kubernetes-1.16.0-rc.2 gopkg.in/yaml.v2 53403b58ad1b561927d19068c655246f2db79d48 # v2.2.8
k8s.io/apimachinery kubernetes-1.16.0-rc.2 k8s.io/api 7643814f1c97f24ccfb38c2b85a7bb3c7f494346 # kubernetes-1.17.1
k8s.io/apiserver kubernetes-1.16.0-rc.2 k8s.io/apimachinery 79c2a76c473a20cdc4ce59cae4b72529b5d9d16b # kubernetes-1.17.1
k8s.io/cri-api kubernetes-1.16.0-rc.2 k8s.io/apiserver 5381f05fcb881d39af12eeecab5645364229300c # kubernetes-1.17.1
k8s.io/client-go kubernetes-1.16.0-rc.2 k8s.io/client-go 69012f50f4b0243bccdb82c24402a10224a91f51 # kubernetes-1.17.1
k8s.io/klog v0.4.0 k8s.io/cri-api 775aa3c1cf7380ba8b7362f5a52f1e6d2e130bb9 # kubernetes-1.17.1
k8s.io/kubernetes v1.16.0-rc.2 k8s.io/klog 2ca9ad30301bf30a8a6e0fa2110db6b8df699a91 # v1.0.0
k8s.io/utils c2654d5206da6b7b6ace12841e8f359bb89b443c k8s.io/kubernetes d224476cd0730baca2b6e357d144171ed74192d6 # v1.17.1
sigs.k8s.io/yaml v1.1.0 k8s.io/utils e782cd3c129fc98ee807f3c889c0f26eb7c9daf5
sigs.k8s.io/yaml fd68e9863619f6ec2fdd8625fe1f02e7c877e480 # v1.1.0
# zfs dependencies # zfs dependencies
github.com/containerd/zfs 2ceb2dbb8154202ed1b8fd32e4ea25b491d7b251 github.com/containerd/zfs 9abf673ca6ff9ab8d9bd776a4ceff8f6dc699c3d
github.com/mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb github.com/mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb
github.com/google/uuid v1.1.1
# aufs dependencies # aufs dependencies
github.com/containerd/aufs f894a800659b6e11c1a13084abd1712f346e349c github.com/containerd/aufs 371312c1e31c210a21e49bf3dfd3f31729ed9f2f
# cgroups dependencies
github.com/cilium/ebpf 60c3aa43f488292fe2ee50fb8b833b383ca8ebbb

View file

@ -21,10 +21,10 @@ import (
) )
var ( var (
ErrClosed = errors.New("fifo closed") ErrClosed = errors.New("fifo closed")
ErrCtrlClosed = errors.New("control of closed fifo") ErrCtrlClosed = errors.New("control of closed fifo")
ErrRdFrmWRONLY = errors.New("reading from write-only fifo") ErrRdFrmWRONLY = errors.New("reading from write-only fifo")
ErrReadClosed = errors.New("reading from a closed fifo") ErrReadClosed = errors.New("reading from a closed fifo")
ErrWrToRDONLY = errors.New("writing to read-only fifo") ErrWrToRDONLY = errors.New("writing to read-only fifo")
ErrWriteClosed = errors.New("writing to a closed fifo") ErrWriteClosed = errors.New("writing to a closed fifo")
) )

View file

@ -23,8 +23,8 @@ import (
"sync" "sync"
"syscall" "syscall"
"context"
"github.com/pkg/errors" "github.com/pkg/errors"
"golang.org/x/net/context"
) )
type fifo struct { type fifo struct {

Some files were not shown because too many files have changed in this diff Show more