From 599ca57bbcfc26c767bffe7d949568177dd7ce9d Mon Sep 17 00:00:00 2001 From: Wiley Wang Date: Tue, 28 Aug 2018 16:28:36 +0800 Subject: [PATCH] Increase Probe context timeout --- cmd/csi-attacher/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/csi-attacher/main.go b/cmd/csi-attacher/main.go index c184c97fd..f92963adf 100644 --- a/cmd/csi-attacher/main.go +++ b/cmd/csi-attacher/main.go @@ -104,6 +104,12 @@ func main() { os.Exit(1) } + // Check it's ready + if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil { + glog.Error(err.Error()) + os.Exit(1) + } + // Find driver name. ctx, cancel := context.WithTimeout(context.Background(), csiTimeout) defer cancel() @@ -114,12 +120,6 @@ func main() { } glog.V(2).Infof("CSI driver name: %q", attacher) - // Check it's ready - if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil { - glog.Error(err.Error()) - os.Exit(1) - } - supportsService, err := csiConn.SupportsPluginControllerService(ctx) if err != nil { glog.Error(err.Error()) @@ -195,7 +195,7 @@ func waitForDriverReady(csiConn connection.CSIConnection, timeout time.Duration) finish := now.Add(timeout) var err error for { - ctx, cancel := context.WithTimeout(context.Background(), csiTimeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() err = csiConn.Probe(ctx) if err == nil {