@@ -120,8 +120,8 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
120120 return nil , status .Error (codes .AlreadyExists , "Volume Already exists with same name and different capacity" )
121121 }
122122
123- if volumes [0 ].Status != openstack .VolumeAvailableStatus {
124- return nil , status .Error (codes .Internal , fmt .Sprintf ("Volume %s is not in available state" , volumes [0 ].ID ))
123+ if vols [0 ].Status != openstack .VolumeAvailableStatus {
124+ return nil , status .Error (codes .Internal , fmt .Sprintf ("Volume %s is not in available state" , vols [0 ].ID ))
125125 }
126126 klog .V (4 ).Infof ("Volume %s already exists in Availability Zone: %s of size %d GiB" , vols [0 ].ID , vols [0 ].AvailabilityZone , vols [0 ].Size )
127127 accessibleTopology := getTopology (& vols [0 ], accessibleTopologyReq , cs .Driver .withTopology , ignoreVolumeAZ )
@@ -259,7 +259,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
259259 }
260260
261261 targetStatus := []string {openstack .VolumeAvailableStatus }
262- err = cloud .WaitVolumeTargetStatusWithCustomBackoff (vol .ID , targetStatus ,
262+ err = cloud .WaitVolumeTargetStatusWithCustomBackoff (ctx , vol .ID , targetStatus ,
263263 & wait.Backoff {
264264 Duration : 20 * time .Second ,
265265 Steps : 5 ,
0 commit comments