implement ctr -connect-timeout

Signed-off-by: Lajos Papp <lalyos@yahoo.com>
This commit is contained in:
Lajos Papp 2019-09-16 12:26:00 +02:00
parent 93391048bd
commit 19ecd49ed0

View File

@ -47,6 +47,8 @@ func AppContext(context *cli.Context) (gocontext.Context, gocontext.CancelFunc)
// NewClient returns a new containerd client
func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error) {
timeoutOpt := containerd.WithTimeout(context.GlobalDuration("connect-timeout"))
opts = append(opts, timeoutOpt)
client, err := containerd.New(context.GlobalString("address"), opts...)
if err != nil {
return nil, nil, nil, err