Signed-off-by: John Howard <john.howard@microsoft.com>
| ... | ... |
@@ -114,7 +114,7 @@ github.com/googleapis/gax-go v2.0.0 |
| 114 | 114 |
google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9 |
| 115 | 115 |
|
| 116 | 116 |
# containerd |
| 117 |
-github.com/containerd/containerd v1.2.0-beta.0 |
|
| 117 |
+github.com/containerd/containerd 3f42445e38d1081f4b8c3b8d7d1ed1860198ed7a |
|
| 118 | 118 |
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c |
| 119 | 119 |
github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b |
| 120 | 120 |
github.com/containerd/cgroups 5e610833b72089b37d0e615de9a92dfc043757c2 |
| ... | ... |
@@ -259,7 +259,7 @@ func fileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *win |
| 259 | 259 |
if err != nil {
|
| 260 | 260 |
return "", 0, nil, err |
| 261 | 261 |
} |
| 262 |
- fileInfo.FileAttributes = uintptr(attr) |
|
| 262 |
+ fileInfo.FileAttributes = uint32(attr) |
|
| 263 | 263 |
} else {
|
| 264 | 264 |
if hdr.Typeflag == tar.TypeDir {
|
| 265 | 265 |
fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY |
| ... | ... |
@@ -82,6 +82,9 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
|
| 82 | 82 |
return nil, err |
| 83 | 83 |
} |
| 84 | 84 |
} |
| 85 |
+ if copts.timeout == 0 {
|
|
| 86 |
+ copts.timeout = 10 * time.Second |
|
| 87 |
+ } |
|
| 85 | 88 |
rt := fmt.Sprintf("%s.%s", plugin.RuntimePlugin, runtime.GOOS)
|
| 86 | 89 |
if copts.defaultRuntime != "" {
|
| 87 | 90 |
rt = copts.defaultRuntime |
| ... | ... |
@@ -115,7 +118,7 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
|
| 115 | 115 |
) |
| 116 | 116 |
} |
| 117 | 117 |
connector := func() (*grpc.ClientConn, error) {
|
| 118 |
- ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) |
|
| 118 |
+ ctx, cancel := context.WithTimeout(context.Background(), copts.timeout) |
|
| 119 | 119 |
defer cancel() |
| 120 | 120 |
conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...) |
| 121 | 121 |
if err != nil {
|
| ... | ... |
@@ -17,6 +17,8 @@ |
| 17 | 17 |
package containerd |
| 18 | 18 |
|
| 19 | 19 |
import ( |
| 20 |
+ "time" |
|
| 21 |
+ |
|
| 20 | 22 |
"github.com/containerd/containerd/images" |
| 21 | 23 |
"github.com/containerd/containerd/platforms" |
| 22 | 24 |
"github.com/containerd/containerd/remotes" |
| ... | ... |
@@ -28,6 +30,7 @@ type clientOpts struct {
|
| 28 | 28 |
defaultRuntime string |
| 29 | 29 |
services *services |
| 30 | 30 |
dialOptions []grpc.DialOption |
| 31 |
+ timeout time.Duration |
|
| 31 | 32 |
} |
| 32 | 33 |
|
| 33 | 34 |
// ClientOpt allows callers to set options on the containerd client |
| ... | ... |
@@ -71,6 +74,14 @@ func WithServices(opts ...ServicesOpt) ClientOpt {
|
| 71 | 71 |
} |
| 72 | 72 |
} |
| 73 | 73 |
|
| 74 |
+// WithTimeout sets the connection timeout for the client |
|
| 75 |
+func WithTimeout(d time.Duration) ClientOpt {
|
|
| 76 |
+ return func(c *clientOpts) error {
|
|
| 77 |
+ c.timeout = d |
|
| 78 |
+ return nil |
|
| 79 |
+ } |
|
| 80 |
+} |
|
| 81 |
+ |
|
| 74 | 82 |
// RemoteOpt allows the caller to set distribution options for a remote |
| 75 | 83 |
type RemoteOpt func(*Client, *RemoteContext) error |
| 76 | 84 |
|
| ... | ... |
@@ -20,7 +20,7 @@ github.com/gogo/protobuf v1.0.0 |
| 20 | 20 |
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef |
| 21 | 21 |
github.com/golang/protobuf v1.1.0 |
| 22 | 22 |
github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce # v1.0.1-43-gd810dbc |
| 23 |
-github.com/opencontainers/runc 69663f0bd4b60df09991c08812a60108003fa340 |
|
| 23 |
+github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd |
|
| 24 | 24 |
github.com/sirupsen/logrus v1.0.0 |
| 25 | 25 |
github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c |
| 26 | 26 |
golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac |
| ... | ... |
@@ -32,8 +32,8 @@ github.com/opencontainers/image-spec v1.0.1 |
| 32 | 32 |
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c |
| 33 | 33 |
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895 |
| 34 | 34 |
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0 |
| 35 |
-github.com/Microsoft/go-winio v0.4.7 |
|
| 36 |
-github.com/Microsoft/hcsshim v0.6.11 |
|
| 35 |
+github.com/Microsoft/go-winio v0.4.10 |
|
| 36 |
+github.com/Microsoft/hcsshim v0.6.14 |
|
| 37 | 37 |
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd |
| 38 | 38 |
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 |
| 39 | 39 |
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 |