Skip to content

Commit

Permalink
fix: always retrieve volume wwn
Browse files Browse the repository at this point in the history
  • Loading branch information
David-T-White committed Sep 22, 2023
1 parent 3d962cf commit 2359f1b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/controller/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,21 @@ func (controller *Controller) CreateVolume(ctx context.Context, req *csi.CreateV
return nil, err2
}
}
wwn, _ = controller.client.GetVolumeWwn(volumeName)

} else {
volume, _, err2 := controller.client.CreateVolume(volumeName, sizeStr, parameters[common.PoolConfigKey], poolType)
_, _, 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 err != nil {
klog.ErrorS(err, "Error retrieving WWN of new volume", "volumeName", volumeName)
return nil, err
}

if storageProtocol == common.StorageProtocolISCSI {
// Fill iSCSI context parameters
targetId, err1 := storageapi.GetTargetId(controller.client.Info, "iSCSI")
Expand Down

0 comments on commit 2359f1b

Please sign in to comment.