From a3129e6edad242aa9b21250acc7d44027cd77edb Mon Sep 17 00:00:00 2001 From: Murcherla Date: Tue, 19 May 2020 10:31:38 -0500 Subject: [PATCH] added WithNoProxy dialopts to ignore proxies for grpc connection when dealing with unix socket --- cmd/grpc-health-probe/main.go | 3 ++- go.mod | 2 +- go.sum | 1 + pkg/cri/cri.go | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/grpc-health-probe/main.go b/cmd/grpc-health-probe/main.go index 99f6b4ab4f..7a3dada463 100644 --- a/cmd/grpc-health-probe/main.go +++ b/cmd/grpc-health-probe/main.go @@ -86,7 +86,8 @@ func main() { opts := []grpc.DialOption{ grpc.WithUserAgent(userAgent), - grpc.WithBlock()} + grpc.WithBlock(), + grpc.WithNoProxy()} opts = append(opts, grpc.WithInsecure()) diff --git a/go.mod b/go.mod index 192fd50b50..6ba95824d4 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( golang.org/x/net v0.0.0-20200202094626-16171245cfb2 golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect - google.golang.org/grpc v1.28.0 + google.golang.org/grpc v1.29.0 gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 k8s.io/api v0.0.0-20180712090710-2d6f90ab1293 diff --git a/go.sum b/go.sum index 80a013b0cc..6d306cc148 100644 --- a/go.sum +++ b/go.sum @@ -237,6 +237,7 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/pkg/cri/cri.go b/pkg/cri/cri.go index e2fe304d39..b50e7b05c7 100644 --- a/pkg/cri/cri.go +++ b/pkg/cri/cri.go @@ -53,7 +53,7 @@ func (c *Client) GetRunningPodSandboxes(log logger.Logger) (map[string]*SandboxI socketPath = criSocketPath } log.Debugf("Getting running pod sandboxes from %q", socketPath) - conn, err := grpc.Dial(socketPath, grpc.WithInsecure()) + conn, err := grpc.Dial(socketPath, grpc.WithInsecure(), grpc.WithNoProxy(), grpc.WithBlock()) if err != nil { return nil, err }