@@ -324,8 +324,6 @@ func (cloud *CloudProvider) ListSnapshots(ctx context.Context, filter string) ([
324
324
func (cloud * CloudProvider ) GetDisk (ctx context.Context , project string , key * meta.Key , gceAPIVersion GCEAPIVersion ) (* CloudDisk , error ) {
325
325
klog .V (5 ).Infof ("Getting disk %v" , key )
326
326
327
- // Override GCEAPIVersion as hyperdisk is only available in beta and we cannot get the disk-type with get disk call.
328
- gceAPIVersion = GCEAPIVersionBeta
329
327
switch key .Type () {
330
328
case meta .Zonal :
331
329
if gceAPIVersion == GCEAPIVersionBeta {
@@ -407,11 +405,6 @@ func (cloud *CloudProvider) ValidateExistingDisk(ctx context.Context, resp *Clou
407
405
reqBytes , common .GbToBytes (resp .GetSizeGb ()), limBytes )
408
406
}
409
407
410
- // We are assuming here that a multiWriter disk could be used as non-multiWriter
411
- if multiWriter && ! resp .GetMultiWriter () {
412
- return fmt .Errorf ("disk already exists with incompatible capability. Need MultiWriter. Got non-MultiWriter" )
413
- }
414
-
415
408
return ValidateDiskParameters (resp , params )
416
409
}
417
410
@@ -553,9 +546,6 @@ func convertV1DiskToBetaDisk(v1Disk *computev1.Disk) *computebeta.Disk {
553
546
AccessMode : v1Disk .AccessMode ,
554
547
}
555
548
556
- // Hyperdisk doesn't currently support multiWriter (https://cloud.google.com/compute/docs/disks/hyperdisks#limitations),
557
- // but if multiWriter + hyperdisk is supported in the future, we want the PDCSI driver to support this feature without
558
- // any additional code change.
559
549
if v1Disk .ProvisionedIops > 0 {
560
550
betaDisk .ProvisionedIops = v1Disk .ProvisionedIops
561
551
}
@@ -619,9 +609,6 @@ func convertBetaDiskToV1Disk(betaDisk *computebeta.Disk) *computev1.Disk {
619
609
AccessMode : betaDisk .AccessMode ,
620
610
}
621
611
622
- // Hyperdisk doesn't currently support multiWriter (https://cloud.google.com/compute/docs/disks/hyperdisks#limitations),
623
- // but if multiWriter + hyperdisk is supported in the future, we want the PDCSI driver to support this feature without
624
- // any additional code change.
625
612
if betaDisk .ProvisionedIops > 0 {
626
613
v1Disk .ProvisionedIops = betaDisk .ProvisionedIops
627
614
}
@@ -651,7 +638,8 @@ func (cloud *CloudProvider) insertRegionalDisk(
651
638
gceAPIVersion = GCEAPIVersionV1
652
639
)
653
640
654
- if multiWriter {
641
+ // Use beta API for non-hyperdisk types in multi-writer mode.
642
+ if multiWriter && ! strings .Contains (params .DiskType , "hyperdisk" ) {
655
643
gceAPIVersion = GCEAPIVersionBeta
656
644
}
657
645
@@ -778,7 +766,9 @@ func (cloud *CloudProvider) insertZonalDisk(
778
766
opName string
779
767
gceAPIVersion = GCEAPIVersionV1
780
768
)
781
- if multiWriter {
769
+
770
+ // Use beta API for non-hyperdisk types in multi-writer mode.
771
+ if multiWriter && ! strings .Contains (params .DiskType , "hyperdisk" ) {
782
772
gceAPIVersion = GCEAPIVersionBeta
783
773
}
784
774
0 commit comments