@@ -291,11 +291,11 @@ func ValidateDiskParameters(disk *CloudDisk, params common.DiskParameters) error
291
291
return fmt .Errorf ("actual pd type %s did not match the expected param %s" , disk .GetPDType (), params .DiskType )
292
292
}
293
293
294
- if params .ReplicationType == "none" && disk .Type () != Zonal {
294
+ if params .ReplicationType == "none" && disk .Type () != Zonal && disk . Type () != ZonalAlpha {
295
295
return fmt .Errorf ("actual disk replication type %v did not match expected param %s" , disk .Type (), params .ReplicationType )
296
296
}
297
297
298
- if params .ReplicationType == "regional-pd" && disk .Type () != Regional {
298
+ if params .ReplicationType == "regional-pd" && disk .Type () != Regional && disk . Type () != RegionalAlpha {
299
299
return fmt .Errorf ("actual disk replication type %v did not match expected param %s" , disk .Type (), "regional-pd" )
300
300
}
301
301
@@ -393,7 +393,7 @@ func (cloud *CloudProvider) insertRegionalDisk(ctx context.Context, volKey *meta
393
393
}
394
394
if err != nil {
395
395
if IsGCEError (err , "alreadyExists" ) {
396
- disk , err := cloud .GetDisk (ctx , volKey , GCEAPIVersionV1 )
396
+ disk , err := cloud .GetDisk (ctx , volKey , gceAPIVersion )
397
397
if err != nil {
398
398
return err
399
399
}
@@ -413,7 +413,7 @@ func (cloud *CloudProvider) insertRegionalDisk(ctx context.Context, volKey *meta
413
413
err = cloud .waitForRegionalOp (ctx , opName , volKey .Region )
414
414
if err != nil {
415
415
if IsGCEError (err , "alreadyExists" ) {
416
- disk , err := cloud .GetDisk (ctx , volKey , GCEAPIVersionV1 )
416
+ disk , err := cloud .GetDisk (ctx , volKey , gceAPIVersion )
417
417
if err != nil {
418
418
return err
419
419
}
@@ -723,16 +723,6 @@ func opIsDone(op *computev1.Operation) (bool, error) {
723
723
return true , nil
724
724
}
725
725
726
- func alphaOpIsDone (op * computealpha.Operation ) (bool , error ) {
727
- if op == nil || op .Status != operationStatusDone {
728
- return false , nil
729
- }
730
- if op .Error != nil && len (op .Error .Errors ) > 0 && op .Error .Errors [0 ] != nil {
731
- return true , fmt .Errorf ("operation %v failed (%v): %v" , op .Name , op .Error .Errors [0 ].Code , op .Error .Errors [0 ].Message )
732
- }
733
- return true , nil
734
- }
735
-
736
726
func (cloud * CloudProvider ) GetInstanceOrError (ctx context.Context , instanceZone , instanceName string ) (* computev1.Instance , error ) {
737
727
klog .V (5 ).Infof ("Getting instance %v from zone %v" , instanceName , instanceZone )
738
728
svc := cloud .service
0 commit comments