@@ -180,7 +180,7 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
180
180
return nil , status .Error (codes .Internal , fmt .Sprintf ("CreateVolume disk %v had error checking ready status: %v" , volKey , err ))
181
181
}
182
182
if ! ready {
183
- return nil , status .Error (codes .Internal , fmt .Sprintf ("CreateVolume existing disk %v is not ready. Existing disk state= name: %v, ID: %v, status: %v, zone: %v, location-type: %v " , volKey , existingDisk . GetName (), existingDisk . GetSourceDiskId (), existingDisk . GetStatus (), existingDisk . GetZone (), existingDisk . LocationType () ))
183
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("CreateVolume existing disk %v is not ready." , volKey ))
184
184
}
185
185
186
186
// If there is no validation error, immediately return success
@@ -207,15 +207,10 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
207
207
if content .GetVolume () != nil {
208
208
volumeContentSourceVolumeID = content .GetVolume ().GetVolumeId ()
209
209
// Verify that the source VolumeID is in the correct format.
210
- _ , _ , err := common .VolumeIDToKey (volumeContentSourceVolumeID )
210
+ project , volKey , err := common .VolumeIDToKey (volumeContentSourceVolumeID )
211
211
if err != nil {
212
212
return nil , status .Error (codes .InvalidArgument , fmt .Sprintf ("CreateVolume source volume ID is invalid: %v" , err ))
213
213
}
214
- // Verify the volume in VolumeContentSource exists.
215
- if acquired := gceCS .volumeLocks .TryAcquire (volumeContentSourceVolumeID ); acquired {
216
- return nil , status .Errorf (codes .NotFound , "CreateVolume source volume %s does not exist" , volumeContentSourceVolumeID )
217
- }
218
- defer gceCS .volumeLocks .Release (volumeContentSourceVolumeID )
219
214
220
215
// Verify that the volume in VolumeContentSource exists.
221
216
diskFromSourceVolume , err := gceCS .CloudProvider .GetDisk (ctx , project , volKey , gceAPIVersion )
0 commit comments