Skip to content

Commit

Permalink
set safe default for CSI plugin MaxVolumes (hashicorp#7583)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Apr 1, 2020
1 parent 245a4c0 commit ec457bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/csi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package csi
import (
"context"
"fmt"
"math"
"net"
"time"

Expand Down Expand Up @@ -373,6 +374,10 @@ func (c *client) NodeGetInfo(ctx context.Context) (*NodeGetInfoResponse, error)

result.NodeID = resp.GetNodeId()
result.MaxVolumes = resp.GetMaxVolumesPerNode()
if result.MaxVolumes == 0 {
// set safe default so that scheduler ignores this constraint when not set
result.MaxVolumes = math.MaxInt64
}

return result, nil
}
Expand Down

0 comments on commit ec457bf

Please sign in to comment.