Skip to content

Commit

Permalink
perf: Only call getVolumeWWN if we didn't get it in response of Creat…
Browse files Browse the repository at this point in the history
…eVolume call
  • Loading branch information
David-T-White committed Oct 11, 2023
1 parent 5e00c39 commit bb2a524
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/controller/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@ func (controller *Controller) CreateVolume(ctx context.Context, req *csi.CreateV
}

} else {
_, _, err2 := controller.client.CreateVolume(volumeName, sizeStr, parameters[common.PoolConfigKey], poolType)
volume, _, err2 := controller.client.CreateVolume(volumeName, sizeStr, parameters[common.PoolConfigKey], poolType)
if err2 != nil {
return nil, err
}
if volume != nil {
wwn = volume.Wwn
}
}
}

wwn, err = controller.client.GetVolumeWwn(volumeName)
if wwn == "" {
wwn, err = controller.client.GetVolumeWwn(volumeName)
}
if err != nil {
klog.ErrorS(err, "Error retrieving WWN of new volume", "volumeName", volumeName)
return nil, err
Expand Down

0 comments on commit bb2a524

Please sign in to comment.