Browse Source

vendor: update containerd to b41633746

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Tonis Tiigi 7 years ago
parent
commit
f0e6158266

+ 4 - 4
vendor.conf

@@ -114,14 +114,14 @@ github.com/googleapis/gax-go v2.0.0
 google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9
 google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9
 
 
 # containerd
 # containerd
-github.com/containerd/containerd 08f7ee9828af1783dc98cc5cc1739e915697c667
+github.com/containerd/containerd b41633746ed4833f52c3c071e8edcfa2713e5677
 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
 github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
 github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
-github.com/containerd/console 9290d21dc56074581f619579c43d970b4514bc08
+github.com/containerd/console 5d1b48d6114b8c9666f0c8b916f871af97b0a761
 github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd
 github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd
-github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788
-github.com/stevvooe/ttrpc d4528379866b0ce7e9d71f3eb96f0582fc374577
+github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
+github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
 github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
 github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
 
 
 # cluster
 # cluster

+ 4 - 0
vendor/github.com/containerd/console/console_linux.go

@@ -262,10 +262,14 @@ func (ec *EpollConsole) Shutdown(close func(int) error) error {
 
 
 // signalRead signals that the console is readable.
 // signalRead signals that the console is readable.
 func (ec *EpollConsole) signalRead() {
 func (ec *EpollConsole) signalRead() {
+	ec.readc.L.Lock()
 	ec.readc.Signal()
 	ec.readc.Signal()
+	ec.readc.L.Unlock()
 }
 }
 
 
 // signalWrite signals that the console is writable.
 // signalWrite signals that the console is writable.
 func (ec *EpollConsole) signalWrite() {
 func (ec *EpollConsole) signalWrite() {
+	ec.writec.L.Lock()
 	ec.writec.Signal()
 	ec.writec.Signal()
+	ec.writec.L.Unlock()
 }
 }

+ 11 - 0
vendor/github.com/containerd/containerd/cio/io.go

@@ -255,3 +255,14 @@ func (l *logIO) Wait() {
 func (l *logIO) Close() error {
 func (l *logIO) Close() error {
 	return nil
 	return nil
 }
 }
+
+// Load the io for a container but do not attach
+//
+// Allows io to be loaded on the task for deletion without
+// starting copy routines
+func Load(set *FIFOSet) (IO, error) {
+	return &cio{
+		config:  set.Config,
+		closers: []io.Closer{set},
+	}, nil
+}

+ 7 - 2
vendor/github.com/containerd/containerd/container.go

@@ -307,6 +307,12 @@ func (c *container) get(ctx context.Context) (containers.Container, error) {
 
 
 // get the existing fifo paths from the task information stored by the daemon
 // get the existing fifo paths from the task information stored by the daemon
 func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, error) {
 func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, error) {
+	fifoSet := loadFifos(response)
+	return ioAttach(fifoSet)
+}
+
+// loadFifos loads the containers fifos
+func loadFifos(response *tasks.GetResponse) *cio.FIFOSet {
 	path := getFifoDir([]string{
 	path := getFifoDir([]string{
 		response.Process.Stdin,
 		response.Process.Stdin,
 		response.Process.Stdout,
 		response.Process.Stdout,
@@ -315,13 +321,12 @@ func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO,
 	closer := func() error {
 	closer := func() error {
 		return os.RemoveAll(path)
 		return os.RemoveAll(path)
 	}
 	}
-	fifoSet := cio.NewFIFOSet(cio.Config{
+	return cio.NewFIFOSet(cio.Config{
 		Stdin:    response.Process.Stdin,
 		Stdin:    response.Process.Stdin,
 		Stdout:   response.Process.Stdout,
 		Stdout:   response.Process.Stdout,
 		Stderr:   response.Process.Stderr,
 		Stderr:   response.Process.Stderr,
 		Terminal: response.Process.Terminal,
 		Terminal: response.Process.Terminal,
 	}, closer)
 	}, closer)
-	return ioAttach(fifoSet)
 }
 }
 
 
 // getFifoDir looks for any non-empty path for a stdio fifo
 // getFifoDir looks for any non-empty path for a stdio fifo

+ 2 - 0
vendor/github.com/containerd/containerd/oci/spec_unix.go

@@ -153,7 +153,9 @@ func createDefaultSpec(ctx context.Context, id string) (*Spec, error) {
 		},
 		},
 		Linux: &specs.Linux{
 		Linux: &specs.Linux{
 			MaskedPaths: []string{
 			MaskedPaths: []string{
+				"/proc/acpi",
 				"/proc/kcore",
 				"/proc/kcore",
+				"/proc/keys",
 				"/proc/latency_stats",
 				"/proc/latency_stats",
 				"/proc/timer_list",
 				"/proc/timer_list",
 				"/proc/timer_stats",
 				"/proc/timer_stats",

+ 1 - 1
vendor/github.com/containerd/containerd/runtime/linux/process.go

@@ -26,8 +26,8 @@ import (
 	"github.com/containerd/containerd/errdefs"
 	"github.com/containerd/containerd/errdefs"
 	"github.com/containerd/containerd/runtime"
 	"github.com/containerd/containerd/runtime"
 	shim "github.com/containerd/containerd/runtime/shim/v1"
 	shim "github.com/containerd/containerd/runtime/shim/v1"
+	"github.com/containerd/ttrpc"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
-	"github.com/stevvooe/ttrpc"
 )
 )
 
 
 // Process implements a linux process
 // Process implements a linux process

+ 1 - 1
vendor/github.com/containerd/containerd/runtime/linux/task.go

@@ -32,9 +32,9 @@ import (
 	"github.com/containerd/containerd/runtime/shim/client"
 	"github.com/containerd/containerd/runtime/shim/client"
 	shim "github.com/containerd/containerd/runtime/shim/v1"
 	shim "github.com/containerd/containerd/runtime/shim/v1"
 	runc "github.com/containerd/go-runc"
 	runc "github.com/containerd/go-runc"
+	"github.com/containerd/ttrpc"
 	"github.com/gogo/protobuf/types"
 	"github.com/gogo/protobuf/types"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
-	"github.com/stevvooe/ttrpc"
 )
 )
 
 
 // Task on a linux based system
 // Task on a linux based system

+ 1 - 1
vendor/github.com/containerd/containerd/runtime/shim/client/client.go

@@ -31,9 +31,9 @@ import (
 
 
 	"golang.org/x/sys/unix"
 	"golang.org/x/sys/unix"
 
 
+	"github.com/containerd/ttrpc"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 	"github.com/sirupsen/logrus"
-	"github.com/stevvooe/ttrpc"
 
 
 	"github.com/containerd/containerd/events"
 	"github.com/containerd/containerd/events"
 	"github.com/containerd/containerd/log"
 	"github.com/containerd/containerd/log"

+ 1 - 1
vendor/github.com/containerd/containerd/runtime/shim/v1/shim.pb.go

@@ -50,7 +50,7 @@ import strings "strings"
 import reflect "reflect"
 import reflect "reflect"
 
 
 import context "context"
 import context "context"
-import ttrpc "github.com/stevvooe/ttrpc"
+import ttrpc "github.com/containerd/ttrpc"
 
 
 import io "io"
 import io "io"
 
 

+ 19 - 14
vendor/github.com/containerd/containerd/vendor.conf

@@ -1,7 +1,7 @@
 github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd5
 github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd5
-github.com/containerd/console 9290d21dc56074581f619579c43d970b4514bc08
+github.com/containerd/console 5d1b48d6114b8c9666f0c8b916f871af97b0a761
 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
-github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788
+github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
 github.com/containerd/btrfs 2e1aa0ddf94f91fa282b6ed87c23bf0d64911244
 github.com/containerd/btrfs 2e1aa0ddf94f91fa282b6ed87c23bf0d64911244
 github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
 github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
@@ -37,13 +37,14 @@ github.com/Microsoft/hcsshim v0.6.11
 github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
 github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
 google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
 google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
-github.com/stevvooe/ttrpc d4528379866b0ce7e9d71f3eb96f0582fc374577
+github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
 github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
 github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
 gotest.tools v2.1.0
 gotest.tools v2.1.0
 github.com/google/go-cmp v0.1.0
 github.com/google/go-cmp v0.1.0
 
 
-github.com/containerd/cri 8bcb9a95394e8d7845da1d6a994d3ac2a86d22f0
-github.com/containerd/go-cni f2d7272f12d045b16ed924f50e91f9f9cecc55a7
+# cri dependencies
+github.com/containerd/cri v1.11.0
+github.com/containerd/go-cni 5882530828ecf62032409b298a3e8b19e08b6534
 github.com/blang/semver v3.1.0
 github.com/blang/semver v3.1.0
 github.com/containernetworking/cni v0.6.0
 github.com/containernetworking/cni v0.6.0
 github.com/containernetworking/plugins v0.7.0
 github.com/containernetworking/plugins v0.7.0
@@ -57,22 +58,26 @@ github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed
 github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
 github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
 github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
 github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
 github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
 github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
-github.com/json-iterator/go 1.0.4
-github.com/opencontainers/runtime-tools 6073aff4ac61897f75895123f7e24135204a404d
+github.com/json-iterator/go f2b4162afba35581b6d4a50d3b8f34e33c144682
+github.com/modern-go/reflect2 05fbef0ca5da472bbf96c9322b84a53edc03c9fd
+github.com/modern-go/concurrent 1.0.3
+github.com/opencontainers/runtime-tools v0.6.0
 github.com/opencontainers/selinux 4a2974bf1ee960774ffd517717f1f45325af0206
 github.com/opencontainers/selinux 4a2974bf1ee960774ffd517717f1f45325af0206
 github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
 github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
-github.com/spf13/pflag v1.0.0
 github.com/tchap/go-patricia 5ad6cdb7538b0097d5598c7e57f0a24072adf7dc
 github.com/tchap/go-patricia 5ad6cdb7538b0097d5598c7e57f0a24072adf7dc
+github.com/xeipuuv/gojsonpointer 4e3ac2762d5f479393488629ee9370b50873b3a6
+github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b
+github.com/xeipuuv/gojsonschema 1d523034197ff1f222f6429836dd36a2457a1874
 golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
 golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
 golang.org/x/time f51c12702a4d776e4c1fa9b0fabab841babae631
 golang.org/x/time f51c12702a4d776e4c1fa9b0fabab841babae631
 gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
 gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
 gopkg.in/yaml.v2 53feefa2559fb8dfa8d81baad31be332c97d6c77
 gopkg.in/yaml.v2 53feefa2559fb8dfa8d81baad31be332c97d6c77
-k8s.io/api 7e796de92438aede7cb5d6bcf6c10f4fa65db560
-k8s.io/apimachinery fcb9a12f7875d01f8390b28faedc37dcf2e713b9
-k8s.io/apiserver 4a8377c547bbff4576a35b5b5bf4026d9b5aa763
-k8s.io/client-go b9a0cf870f239c4a4ecfd3feb075a50e7cbe1473
-k8s.io/kubernetes v1.10.0
-k8s.io/utils 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e
+k8s.io/api 9e5ffd1f1320950b238cfce291b926411f0af722
+k8s.io/apimachinery ed135c5b96450fd24e5e981c708114fbbd950697
+k8s.io/apiserver a90e3a95c2e91b944bfca8225c4e0d12e42a9eb5
+k8s.io/client-go 03bfb9bdcfe5482795b999f39ca3ed9ad42ce5bb
+k8s.io/kubernetes v1.11.0
+k8s.io/utils 733eca437aa39379e4bcc25e726439dfca40fcff
 
 
 # zfs dependencies
 # zfs dependencies
 github.com/containerd/zfs 9a0b8b8b5982014b729cd34eb7cd7a11062aa6ec
 github.com/containerd/zfs 9a0b8b8b5982014b729cd34eb7cd7a11062aa6ec

+ 0 - 0
vendor/github.com/stevvooe/ttrpc/LICENSE → vendor/github.com/containerd/ttrpc/LICENSE


+ 2 - 2
vendor/github.com/stevvooe/ttrpc/README.md → vendor/github.com/containerd/ttrpc/README.md

@@ -1,6 +1,6 @@
 # ttrpc
 # ttrpc
 
 
-[![Build Status](https://travis-ci.org/stevvooe/ttrpc.svg?branch=master)](https://travis-ci.org/stevvooe/ttrpc)
+[![Build Status](https://travis-ci.org/containerd/ttrpc.svg?branch=master)](https://travis-ci.org/containerd/ttrpc)
 
 
 GRPC for low-memory environments.
 GRPC for low-memory environments.
 
 
@@ -25,7 +25,7 @@ Create a gogo vanity binary (see
 [`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an
 [`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an
 example with the ttrpc plugin enabled.
 example with the ttrpc plugin enabled.
 
 
-It's recommended to use [`protobuild`](https://github.com/stevvooe/protobuild)
+It's recommended to use [`protobuild`](https://github.com//stevvooe/protobuild)
 to build the protobufs for this project, but this will work with protoc
 to build the protobufs for this project, but this will work with protoc
 directly, if required.
 directly, if required.
 
 

+ 16 - 0
vendor/github.com/stevvooe/ttrpc/channel.go → vendor/github.com/containerd/ttrpc/channel.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (

+ 18 - 2
vendor/github.com/stevvooe/ttrpc/client.go → vendor/github.com/containerd/ttrpc/client.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (
@@ -9,9 +25,9 @@ import (
 	"sync"
 	"sync"
 	"syscall"
 	"syscall"
 
 
-	"github.com/containerd/containerd/log"
 	"github.com/gogo/protobuf/proto"
 	"github.com/gogo/protobuf/proto"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
+	"github.com/sirupsen/logrus"
 	"google.golang.org/grpc/status"
 	"google.golang.org/grpc/status"
 )
 )
 
 
@@ -180,7 +196,7 @@ func (c *Client) run() {
 		case msg := <-incoming:
 		case msg := <-incoming:
 			call, ok := waiters[msg.StreamID]
 			call, ok := waiters[msg.StreamID]
 			if !ok {
 			if !ok {
-				log.L.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID)
+				logrus.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID)
 				continue
 				continue
 			}
 			}
 
 

+ 42 - 0
vendor/github.com/containerd/ttrpc/codec.go

@@ -0,0 +1,42 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+package ttrpc
+
+import (
+	"github.com/gogo/protobuf/proto"
+	"github.com/pkg/errors"
+)
+
+type codec struct{}
+
+func (c codec) Marshal(msg interface{}) ([]byte, error) {
+	switch v := msg.(type) {
+	case proto.Message:
+		return proto.Marshal(v)
+	default:
+		return nil, errors.Errorf("ttrpc: cannot marshal unknown type: %T", msg)
+	}
+}
+
+func (c codec) Unmarshal(p []byte, msg interface{}) error {
+	switch v := msg.(type) {
+	case proto.Message:
+		return proto.Unmarshal(p, v)
+	default:
+		return errors.Errorf("ttrpc: cannot unmarshal into unknown type: %T", msg)
+	}
+}

+ 39 - 0
vendor/github.com/containerd/ttrpc/config.go

@@ -0,0 +1,39 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+package ttrpc
+
+import "github.com/pkg/errors"
+
+type serverConfig struct {
+	handshaker Handshaker
+}
+
+type ServerOpt func(*serverConfig) error
+
+// WithServerHandshaker can be passed to NewServer to ensure that the
+// handshaker is called before every connection attempt.
+//
+// Only one handshaker is allowed per server.
+func WithServerHandshaker(handshaker Handshaker) ServerOpt {
+	return func(c *serverConfig) error {
+		if c.handshaker != nil {
+			return errors.New("only one handshaker allowed per server")
+		}
+		c.handshaker = handshaker
+		return nil
+	}
+}

+ 16 - 0
vendor/github.com/stevvooe/ttrpc/handshake.go → vendor/github.com/containerd/ttrpc/handshake.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (

+ 23 - 8
vendor/github.com/stevvooe/ttrpc/server.go → vendor/github.com/containerd/ttrpc/server.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (
@@ -9,8 +25,8 @@ import (
 	"sync/atomic"
 	"sync/atomic"
 	"time"
 	"time"
 
 
-	"github.com/containerd/containerd/log"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
+	"github.com/sirupsen/logrus"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/status"
 	"google.golang.org/grpc/status"
 )
 )
@@ -51,12 +67,11 @@ func (s *Server) Register(name string, methods map[string]Method) {
 	s.services.register(name, methods)
 	s.services.register(name, methods)
 }
 }
 
 
-func (s *Server) Serve(l net.Listener) error {
+func (s *Server) Serve(ctx context.Context, l net.Listener) error {
 	s.addListener(l)
 	s.addListener(l)
 	defer s.closeListener(l)
 	defer s.closeListener(l)
 
 
 	var (
 	var (
-		ctx        = context.Background()
 		backoff    time.Duration
 		backoff    time.Duration
 		handshaker = s.config.handshaker
 		handshaker = s.config.handshaker
 	)
 	)
@@ -88,7 +103,7 @@ func (s *Server) Serve(l net.Listener) error {
 				}
 				}
 
 
 				sleep := time.Duration(rand.Int63n(int64(backoff)))
 				sleep := time.Duration(rand.Int63n(int64(backoff)))
-				log.L.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
+				logrus.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
 				time.Sleep(sleep)
 				time.Sleep(sleep)
 				continue
 				continue
 			}
 			}
@@ -100,7 +115,7 @@ func (s *Server) Serve(l net.Listener) error {
 
 
 		approved, handshake, err := handshaker.Handshake(ctx, conn)
 		approved, handshake, err := handshaker.Handshake(ctx, conn)
 		if err != nil {
 		if err != nil {
-			log.L.WithError(err).Errorf("ttrpc: refusing connection after handshake")
+			logrus.WithError(err).Errorf("ttrpc: refusing connection after handshake")
 			conn.Close()
 			conn.Close()
 			continue
 			continue
 		}
 		}
@@ -416,12 +431,12 @@ func (c *serverConn) run(sctx context.Context) {
 		case response := <-responses:
 		case response := <-responses:
 			p, err := c.server.codec.Marshal(response.resp)
 			p, err := c.server.codec.Marshal(response.resp)
 			if err != nil {
 			if err != nil {
-				log.L.WithError(err).Error("failed marshaling response")
+				logrus.WithError(err).Error("failed marshaling response")
 				return
 				return
 			}
 			}
 
 
 			if err := ch.send(ctx, response.id, messageTypeResponse, p); err != nil {
 			if err := ch.send(ctx, response.id, messageTypeResponse, p); err != nil {
-				log.L.WithError(err).Error("failed sending message on channel")
+				logrus.WithError(err).Error("failed sending message on channel")
 				return
 				return
 			}
 			}
 
 
@@ -432,7 +447,7 @@ func (c *serverConn) run(sctx context.Context) {
 			// requests due to a terminal error.
 			// requests due to a terminal error.
 			recvErr = nil // connection is now "closing"
 			recvErr = nil // connection is now "closing"
 			if err != nil && err != io.EOF {
 			if err != nil && err != io.EOF {
-				log.L.WithError(err).Error("error receiving message")
+				logrus.WithError(err).Error("error receiving message")
 			}
 			}
 		case <-shutdown:
 		case <-shutdown:
 			return
 			return

+ 16 - 0
vendor/github.com/stevvooe/ttrpc/services.go → vendor/github.com/containerd/ttrpc/services.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (

+ 16 - 0
vendor/github.com/stevvooe/ttrpc/types.go → vendor/github.com/containerd/ttrpc/types.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (

+ 16 - 0
vendor/github.com/stevvooe/ttrpc/unixcreds_linux.go → vendor/github.com/containerd/ttrpc/unixcreds_linux.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package ttrpc
 package ttrpc
 
 
 import (
 import (

+ 16 - 0
vendor/github.com/containerd/typeurl/types.go

@@ -1,3 +1,19 @@
+/*
+   Copyright The containerd Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package typeurl
 package typeurl
 
 
 import (
 import (

+ 0 - 26
vendor/github.com/stevvooe/ttrpc/codec.go

@@ -1,26 +0,0 @@
-package ttrpc
-
-import (
-	"github.com/gogo/protobuf/proto"
-	"github.com/pkg/errors"
-)
-
-type codec struct{}
-
-func (c codec) Marshal(msg interface{}) ([]byte, error) {
-	switch v := msg.(type) {
-	case proto.Message:
-		return proto.Marshal(v)
-	default:
-		return nil, errors.Errorf("ttrpc: cannot marshal unknown type: %T", msg)
-	}
-}
-
-func (c codec) Unmarshal(p []byte, msg interface{}) error {
-	switch v := msg.(type) {
-	case proto.Message:
-		return proto.Unmarshal(p, v)
-	default:
-		return errors.Errorf("ttrpc: cannot unmarshal into unknown type: %T", msg)
-	}
-}

+ 0 - 23
vendor/github.com/stevvooe/ttrpc/config.go

@@ -1,23 +0,0 @@
-package ttrpc
-
-import "github.com/pkg/errors"
-
-type serverConfig struct {
-	handshaker Handshaker
-}
-
-type ServerOpt func(*serverConfig) error
-
-// WithServerHandshaker can be passed to NewServer to ensure that the
-// handshaker is called before every connection attempt.
-//
-// Only one handshaker is allowed per server.
-func WithServerHandshaker(handshaker Handshaker) ServerOpt {
-	return func(c *serverConfig) error {
-		if c.handshaker != nil {
-			return errors.New("only one handshaker allowed per server")
-		}
-		c.handshaker = handshaker
-		return nil
-	}
-}