@@ -446,15 +446,9 @@ func (cloud *CloudProvider) InsertDisk(ctx context.Context, project string, volK
446
446
func (cloud * CloudProvider ) UpdateDisk (ctx context.Context , project string , volKey * meta.Key , existingDisk * CloudDisk , params common.ModifyVolumeParameters ) error {
447
447
448
448
klog .V (5 ).Infof ("Updating disk %v" , volKey )
449
-
450
- switch volKey .Type () {
451
- case meta .Zonal :
452
- return cloud .updateZonalDisk (ctx , project , volKey , existingDisk , params )
453
- case meta .Regional :
454
- return cloud .updateRegionalDisk (ctx , project , volKey , existingDisk , params )
455
- default :
456
- return fmt .Errorf ("could not update disk, key was neither zonal nor regional, instead got: %v" , volKey .String ())
457
- }
449
+ // hyperdisks are zonal disks
450
+ // pd-disks do not support modification of IOPS and Throughput
451
+ return cloud .updateZonalDisk (ctx , project , volKey , existingDisk , params )
458
452
}
459
453
460
454
func (cloud * CloudProvider ) updateZonalDisk (ctx context.Context , project string , volKey * meta.Key , existingDisk * CloudDisk , params common.ModifyVolumeParameters ) error {
@@ -478,25 +472,6 @@ func (cloud *CloudProvider) updateZonalDisk(ctx context.Context, project string,
478
472
return nil
479
473
}
480
474
481
- func (cloud * CloudProvider ) updateRegionalDisk (ctx context.Context , project string , volKey * meta.Key , existingDisk * CloudDisk , params common.ModifyVolumeParameters ) error {
482
-
483
- updatedDisk := & computev1.Disk {
484
- Name : existingDisk .GetName (),
485
- ProvisionedIops : params .IOPS ,
486
- ProvisionedThroughput : params .Throughput ,
487
- }
488
-
489
- diskUpdateOp := cloud .service .RegionDisks .Update (project , volKey .Region , volKey .Name , updatedDisk )
490
- diskUpdateOp .Paths ("provisionedIops" , "provisionedThroughput" )
491
- updateOpResult , err := diskUpdateOp .Context (ctx ).Do ()
492
-
493
- if err != nil {
494
- return fmt .Errorf ("error updating disk %v: %w" , volKey , err )
495
- }
496
- fmt .Printf ("http status : %d" , updateOpResult .HTTPStatusCode )
497
- return nil
498
- }
499
-
500
475
func convertV1CustomerEncryptionKeyToBeta (v1Key * computev1.CustomerEncryptionKey ) * computebeta.CustomerEncryptionKey {
501
476
return & computebeta.CustomerEncryptionKey {
502
477
KmsKeyName : v1Key .KmsKeyName ,
0 commit comments