Skip to content

Commit c7083ee

Browse files
Merge pull request #2369 from dmcgowan/update-grpc
Update grpc to 1.12
2 parents 80bbaff + 55afe33 commit c7083ee

71 files changed

Lines changed: 11201 additions & 4964 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
8989
gopts := []grpc.DialOption{
9090
grpc.WithBlock(),
9191
grpc.WithInsecure(),
92-
grpc.WithTimeout(60 * time.Second),
9392
grpc.FailOnNonTempDialError(true),
9493
grpc.WithBackoffMaxDelay(3 * time.Second),
9594
grpc.WithDialer(dialer.Dialer),
@@ -109,7 +108,9 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
109108
)
110109
}
111110
connector := func() (*grpc.ClientConn, error) {
112-
conn, err := grpc.Dial(dialer.DialAddress(address), gopts...)
111+
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
112+
defer cancel()
113+
conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...)
113114
if err != nil {
114115
return nil, errors.Wrapf(err, "failed to dial %q", address)
115116
}

client_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ import (
2121
"context"
2222
"flag"
2323
"fmt"
24-
"io/ioutil"
25-
golog "log"
2624
"os"
2725
"os/exec"
2826
"testing"
2927
"time"
3028

31-
"google.golang.org/grpc/grpclog"
32-
3329
"github.com/containerd/containerd/images"
3430
"github.com/containerd/containerd/log"
3531
"github.com/containerd/containerd/namespaces"
@@ -50,9 +46,6 @@ var (
5046
)
5147

5248
func init() {
53-
// Discard grpc logs so that they don't mess with our stdio
54-
grpclog.SetLogger(golog.New(ioutil.Discard, "", golog.LstdFlags))
55-
5649
flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests")
5750
flag.BoolVar(&noDaemon, "no-daemon", false, "Do not start a dedicated daemon for the tests")
5851
flag.BoolVar(&noCriu, "no-criu", false, "Do not run the checkpoint tests")

cmd/containerd/command/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
gocontext "context"
2121
"fmt"
2222
"io/ioutil"
23-
golog "log"
2423
"net"
2524
"os"
2625
"os/signal"
@@ -50,7 +49,7 @@ high performance container runtime
5049

5150
func init() {
5251
// Discard grpc logs so that they don't mess with our stdio
53-
grpclog.SetLogger(golog.New(ioutil.Discard, "", golog.LstdFlags))
52+
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
5453

5554
cli.VersionPrinter = func(c *cli.Context) {
5655
fmt.Println(c.App.Name, version.Package, c.App.Version, version.Revision)

cmd/containerd/command/publish.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ func connect(address string, d func(string, time.Duration) (net.Conn, error)) (*
9595
gopts := []grpc.DialOption{
9696
grpc.WithBlock(),
9797
grpc.WithInsecure(),
98-
grpc.WithTimeout(60 * time.Second),
9998
grpc.WithDialer(d),
10099
grpc.FailOnNonTempDialError(true),
101100
grpc.WithBackoffMaxDelay(3 * time.Second),
102101
}
103-
conn, err := grpc.Dial(dialer.DialAddress(address), gopts...)
102+
ctx, cancel := gocontext.WithTimeout(gocontext.Background(), 60*time.Second)
103+
defer cancel()
104+
conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...)
104105
if err != nil {
105106
return nil, errors.Wrapf(err, "failed to dial %q", address)
106107
}

cmd/ctr/app/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package app
1919
import (
2020
"fmt"
2121
"io/ioutil"
22-
"log"
2322

2423
"github.com/containerd/containerd/cmd/ctr/commands/containers"
2524
"github.com/containerd/containerd/cmd/ctr/commands/content"
@@ -44,7 +43,7 @@ var extraCmds = []cli.Command{}
4443

4544
func init() {
4645
// Discard grpc logs so that they don't mess with our stdio
47-
grpclog.SetLogger(log.New(ioutil.Discard, "", log.LstdFlags))
46+
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
4847

4948
cli.VersionPrinter = func(c *cli.Context) {
5049
fmt.Println(c.App.Name, version.Package, c.App.Version)

vendor.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
1818
github.com/matttproud/golang_protobuf_extensions v1.0.0
1919
github.com/gogo/protobuf v1.0.0
2020
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
21-
github.com/golang/protobuf 1643683e1b54a9e88ad26d98f81400c8c9d9f4f9
21+
github.com/golang/protobuf v1.1.0
2222
github.com/opencontainers/runtime-spec v1.0.1
2323
github.com/opencontainers/runc 69663f0bd4b60df09991c08812a60108003fa340
2424
github.com/sirupsen/logrus v1.0.0
2525
github.com/pmezard/go-difflib v1.0.0
2626
github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
2727
golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac
28-
google.golang.org/grpc v1.10.1
28+
google.golang.org/grpc v1.12.0
2929
github.com/pkg/errors v0.8.0
3030
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
3131
golang.org/x/sys 314a259e304ff91bd6985da2a7149bbf91237993 https://github.com/golang/sys

vendor/github.com/golang/protobuf/README.md

Lines changed: 52 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golang/protobuf/proto/clone.go

Lines changed: 35 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)