Skip to content

Commit

Permalink
fix provisioning with no immediate topology
Browse files Browse the repository at this point in the history
  • Loading branch information
pohly committed Nov 10, 2020
1 parent b89078f commit 89655f7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,12 +1336,13 @@ func (p *csiProvisioner) checkCapacity(ctx context.Context, claim *v1.Persistent
return false, err
}

// In practice, we expect exactly one entry here. But we have
// to be prepared for more than one (=> check all, success if there
// is at least one) and none (=> check once without topology).
topologies := result.req.AccessibilityRequirements.Requisite
if len(topologies) == 0 {
topologies = []*csi.Topology{nil}
// In practice, we expect exactly one entry here once a node
// has been selected. But we have to be prepared for more than
// one (=> check all, success if there is at least one) and
// none (no node selected => check once without topology).
topologies := []*csi.Topology{nil}
if result.req.AccessibilityRequirements != nil && len(result.req.AccessibilityRequirements.Requisite) > 0 {
topologies = result.req.AccessibilityRequirements.Requisite
}
for _, topology := range topologies {
req := &csi.GetCapacityRequest{
Expand Down

0 comments on commit 89655f7

Please sign in to comment.