@@ -291,11 +291,11 @@ func ValidateDiskParameters(disk *CloudDisk, params common.DiskParameters) error
291291 return fmt .Errorf ("actual pd type %s did not match the expected param %s" , disk .GetPDType (), params .DiskType )
292292 }
293293
294- if params .ReplicationType == "none" && disk .Type () != Zonal {
294+ if params .ReplicationType == "none" && disk .Type () != Zonal && disk . Type () != ZonalAlpha {
295295 return fmt .Errorf ("actual disk replication type %v did not match expected param %s" , disk .Type (), params .ReplicationType )
296296 }
297297
298- if params .ReplicationType == "regional-pd" && disk .Type () != Regional {
298+ if params .ReplicationType == "regional-pd" && disk .Type () != Regional && disk . Type () != RegionalAlpha {
299299 return fmt .Errorf ("actual disk replication type %v did not match expected param %s" , disk .Type (), "regional-pd" )
300300 }
301301
@@ -393,7 +393,7 @@ func (cloud *CloudProvider) insertRegionalDisk(ctx context.Context, volKey *meta
393393 }
394394 if err != nil {
395395 if IsGCEError (err , "alreadyExists" ) {
396- disk , err := cloud .GetDisk (ctx , volKey , GCEAPIVersionV1 )
396+ disk , err := cloud .GetDisk (ctx , volKey , gceAPIVersion )
397397 if err != nil {
398398 return err
399399 }
@@ -413,7 +413,7 @@ func (cloud *CloudProvider) insertRegionalDisk(ctx context.Context, volKey *meta
413413 err = cloud .waitForRegionalOp (ctx , opName , volKey .Region )
414414 if err != nil {
415415 if IsGCEError (err , "alreadyExists" ) {
416- disk , err := cloud .GetDisk (ctx , volKey , GCEAPIVersionV1 )
416+ disk , err := cloud .GetDisk (ctx , volKey , gceAPIVersion )
417417 if err != nil {
418418 return err
419419 }
@@ -723,16 +723,6 @@ func opIsDone(op *computev1.Operation) (bool, error) {
723723 return true , nil
724724}
725725
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-
736726func (cloud * CloudProvider ) GetInstanceOrError (ctx context.Context , instanceZone , instanceName string ) (* computev1.Instance , error ) {
737727 klog .V (5 ).Infof ("Getting instance %v from zone %v" , instanceName , instanceZone )
738728 svc := cloud .service
0 commit comments