@@ -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 .GetDiskId (), existingDisk .GetStatus (), existingDisk .GetZone (), existingDisk .LocationType ()))
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 ()))
184
184
}
185
185
186
186
// If there is no validation error, immediately return success
@@ -225,16 +225,16 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
225
225
if err := gce .ValidateDiskParameters (diskFromSourceVolume , params ); err != nil {
226
226
return nil , status .Errorf (codes .InvalidArgument , `CreateVolume source volume parameters do not match CreateVolumeRequest Parameters: %v` , err )
227
227
}
228
- // // Verify the source disk is ready.
229
- // if err == nil {
230
- // ready, err := isDiskReady(diskFromSourceVolume)
231
- // if err != nil {
232
- // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v had error checking ready status: %v", volKey, err))
233
- // }
234
- // if !ready {
235
- // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v is not ready", volKey))
236
- // }
237
- // }
228
+ // Verify the source disk is ready.
229
+ if err == nil {
230
+ ready , err := isDiskReady (diskFromSourceVolume )
231
+ if err != nil {
232
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("CreateVolume disk from source volume %v had error checking ready status: %v" , volKey , err ))
233
+ }
234
+ if ! ready {
235
+ return nil , status .Error (codes .Internal , fmt .Sprintf ("CreateVolume disk from source volume %v is not ready" , volKey ))
236
+ }
237
+ }
238
238
}
239
239
}
240
240
// Create the disk
@@ -1083,7 +1083,7 @@ func generateCreateVolumeResponse(disk *gce.CloudDisk, zones []string) *csi.Crea
1083
1083
},
1084
1084
}
1085
1085
snapshotID := disk .GetSnapshotId ()
1086
- diskID := disk .GetDiskId ()
1086
+ diskID := disk .GetSourceDiskId ()
1087
1087
if diskID != "" || snapshotID != "" {
1088
1088
contentSource := & csi.VolumeContentSource {}
1089
1089
if snapshotID != "" {
0 commit comments