Skip to content

Commit

Permalink
Merge pull request #68 from wnxn/bugfix/check_driver
Browse files Browse the repository at this point in the history
Fixbug: check driver timeout
  • Loading branch information
k8s-ci-robot authored Sep 17, 2018
2 parents 5a4cc3b + 599ca57 commit cf1ef8e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/csi-attacher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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())
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cf1ef8e

Please sign in to comment.