@@ -522,11 +522,7 @@ func (gceCS *GCEControllerServer) createMultiZoneDisk(ctx context.Context, req *
522
522
volumeId := fmt .Sprintf ("projects/%s/zones/%s/disks/%s" , gceCS .CloudProvider .GetDefaultProject (), common .MultiZoneValue , req .GetName ())
523
523
klog .V (4 ).Infof ("CreateVolume succeeded for multi-zone disks in zones %s: %v" , zones , multiZoneVolKey )
524
524
525
- resp , err := gceCS .generateCreateVolumeResponseWithVolumeId (createdDisks [0 ], zones , params , dataCacheParams , enableDataCache , volumeId )
526
- if err != nil {
527
- return nil , fmt .Errorf ("failed to generate createVolumeResponse: %w" , err )
528
- }
529
- return resp , nil
525
+ return gceCS .generateCreateVolumeResponseWithVolumeId (createdDisks [0 ], zones , params , dataCacheParams , enableDataCache , volumeId ), nil
530
526
}
531
527
532
528
func (gceCS * GCEControllerServer ) getZonesWithDiskNameAndType (ctx context.Context , name string , diskType string ) ([]string , error ) {
@@ -632,12 +628,7 @@ func (gceCS *GCEControllerServer) createSingleDeviceDisk(ctx context.Context, re
632
628
return nil , common .LoggedError ("CreateVolume failed: %v" , err )
633
629
}
634
630
635
- resp , err := gceCS .generateCreateVolumeResponseWithVolumeId (disk , zones , params , dataCacheParams , enableDataCache , volumeID )
636
- if err != nil {
637
- return nil , fmt .Errorf ("failed to generate createVolumeResponse: %w" , err )
638
- }
639
-
640
- return resp , nil
631
+ return gceCS .generateCreateVolumeResponseWithVolumeId (disk , zones , params , dataCacheParams , enableDataCache , volumeID ), nil
641
632
}
642
633
643
634
func getAccessMode (req * csi.CreateVolumeRequest , params common.DiskParameters ) (string , error ) {
@@ -2418,7 +2409,7 @@ func extractVolumeContext(context map[string]string) (*PDCSIContext, error) {
2418
2409
return info , nil
2419
2410
}
2420
2411
2421
- func (gceCS * GCEControllerServer ) generateCreateVolumeResponseWithVolumeId (disk * gce.CloudDisk , zones []string , params common.DiskParameters , dataCacheParams common.DataCacheParameters , enableDataCache bool , volumeId string ) ( * csi.CreateVolumeResponse , error ) {
2412
+ func (gceCS * GCEControllerServer ) generateCreateVolumeResponseWithVolumeId (disk * gce.CloudDisk , zones []string , params common.DiskParameters , dataCacheParams common.DataCacheParameters , enableDataCache bool , volumeId string ) * csi.CreateVolumeResponse {
2422
2413
tops := []* csi.Topology {}
2423
2414
for _ , zone := range zones {
2424
2415
top := & csi.Topology {
@@ -2485,7 +2476,7 @@ func (gceCS *GCEControllerServer) generateCreateVolumeResponseWithVolumeId(disk
2485
2476
}
2486
2477
createResp .Volume .ContentSource = contentSource
2487
2478
}
2488
- return createResp , nil
2479
+ return createResp
2489
2480
}
2490
2481
2491
2482
func getResourceId (resourceLink string ) (string , error ) {
0 commit comments