Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #89: Increase probe timeout #90

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func main() {
os.Exit(1)
}

// Check it's ready
if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil {
glog.Error(err.Error())
os.Exit(1)
}

// Pass a context with a timeout
ctx, cancel := context.WithTimeout(context.Background(), csiTimeout)
defer cancel()
Expand All @@ -140,12 +146,6 @@ func main() {
}
glog.V(2).Infof("CSI driver name: %q", *snapshotter)

// Check it's ready
if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil {
glog.Error(err.Error())
os.Exit(1)
}

// Find out if the driver supports create/delete snapshot.
supportsCreateSnapshot, err := csiConn.SupportsControllerCreateSnapshot(ctx)
if err != nil {
Expand Down Expand Up @@ -206,7 +206,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