Skip to content

Commit 19ecd49

Browse files
committed
implement ctr -connect-timeout
Signed-off-by: Lajos Papp <[email protected]>
1 parent 9339104 commit 19ecd49

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmd/ctr/commands/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func AppContext(context *cli.Context) (gocontext.Context, gocontext.CancelFunc)
4747

4848
// NewClient returns a new containerd client
4949
func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error) {
50+
timeoutOpt := containerd.WithTimeout(context.GlobalDuration("connect-timeout"))
51+
opts = append(opts, timeoutOpt)
5052
client, err := containerd.New(context.GlobalString("address"), opts...)
5153
if err != nil {
5254
return nil, nil, nil, err

0 commit comments

Comments
 (0)