@@ -121,8 +121,8 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
121121 return nil , status .Error (codes .AlreadyExists , "Volume Already exists with same name and different capacity" )
122122 }
123123
124- if volumes [0 ].Status != openstack .VolumeAvailableStatus {
125- return nil , status .Error (codes .Internal , fmt .Sprintf ("Volume %s is not in available state" , volumes [0 ].ID ))
124+ if vols [0 ].Status != openstack .VolumeAvailableStatus {
125+ return nil , status .Error (codes .Internal , fmt .Sprintf ("Volume %s is not in available state" , vols [0 ].ID ))
126126 }
127127 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 )
128128 return getCreateVolumeResponse (& vols [0 ], nil , ignoreVolumeAZ , req .GetAccessibilityRequirements ()), nil
@@ -253,7 +253,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
253253 }
254254
255255 targetStatus := []string {openstack .VolumeAvailableStatus }
256- err = cloud .WaitVolumeTargetStatusWithCustomBackoff (vol .ID , targetStatus ,
256+ err = cloud .WaitVolumeTargetStatusWithCustomBackoff (ctx , vol .ID , targetStatus ,
257257 & wait.Backoff {
258258 Duration : 20 * time .Second ,
259259 Steps : 5 ,
0 commit comments