Use golangci-lint.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-08-07 01:04:49 -07:00
parent c7b48c09d7
commit 9bf53555a0
3 changed files with 13 additions and 44 deletions

View File

@@ -21,6 +21,7 @@ import (
"encoding/json"
"flag"
"fmt"
"net"
"os/exec"
"strconv"
"strings"
@@ -350,7 +351,13 @@ func RawRuntimeClient() (runtime.RuntimeServiceClient, error) {
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
conn, err := grpc.DialContext(ctx, addr, grpc.WithInsecure(), grpc.WithDialer(dialer))
conn, err := grpc.DialContext(ctx, addr, grpc.WithInsecure(), grpc.WithContextDialer(
func(ctx context.Context, addr string) (net.Conn, error) {
if deadline, ok := ctx.Deadline(); ok {
return dialer(addr, time.Until(deadline))
}
return dialer(addr, 0)
}))
if err != nil {
return nil, errors.Wrap(err, "failed to connect cri endpoint")
}