@@ -1203,6 +1203,12 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project
1203
1203
if err != nil {
1204
1204
return nil , status .Errorf (codes .InvalidArgument , "Invalid volume key: %v" , volKey )
1205
1205
}
1206
+
1207
+ volumeIsMultiZone := isMultiZoneVolKey (volKey )
1208
+ if gceCS .multiZoneVolumeHandleConfig .Enable && volumeIsMultiZone {
1209
+ return nil , fmt .Errorf ("Snapshots are not supported with the `multi-zone` PV volumeHandle feature." )
1210
+ }
1211
+
1206
1212
// Check if PD snapshot already exists
1207
1213
var snapshot * compute.Snapshot
1208
1214
snapshot , err = gceCS .CloudProvider .GetSnapshot (ctx , project , snapshotName )
@@ -1482,6 +1488,7 @@ func (gceCS *GCEControllerServer) ListSnapshots(ctx context.Context, req *csi.Li
1482
1488
}
1483
1489
1484
1490
func (gceCS * GCEControllerServer ) ControllerExpandVolume (ctx context.Context , req * csi.ControllerExpandVolumeRequest ) (* csi.ControllerExpandVolumeResponse , error ) {
1491
+
1485
1492
var err error
1486
1493
diskTypeForMetric := metrics .DefaultDiskTypeForMetric
1487
1494
enableConfidentialCompute := metrics .DefaultEnableConfidentialCompute
@@ -1504,12 +1511,19 @@ func (gceCS *GCEControllerServer) ControllerExpandVolume(ctx context.Context, re
1504
1511
return nil , status .Errorf (codes .InvalidArgument , "ControllerExpandVolume Volume ID is invalid: %v" , err .Error ())
1505
1512
}
1506
1513
project , volKey , err = gceCS .CloudProvider .RepairUnderspecifiedVolumeKey (ctx , project , volKey )
1514
+
1507
1515
if err != nil {
1508
1516
if gce .IsGCENotFoundError (err ) {
1509
1517
return nil , status .Errorf (codes .NotFound , "ControllerExpandVolume could not find volume with ID %v: %v" , volumeID , err .Error ())
1510
1518
}
1511
1519
return nil , common .LoggedError ("ControllerExpandVolume error repairing underspecified volume key: " , err )
1512
1520
}
1521
+
1522
+ volumeIsMultiZone := isMultiZoneVolKey (volKey )
1523
+ if gceCS .multiZoneVolumeHandleConfig .Enable && volumeIsMultiZone {
1524
+ return nil , fmt .Errorf ("Resize operation is not supported with the `multi-zone` PVC volumeHandle feature. Please re-create the disk from source if you want a larger size." )
1525
+ }
1526
+
1513
1527
sourceDisk , err := gceCS .CloudProvider .GetDisk (ctx , project , volKey , gce .GCEAPIVersionV1 )
1514
1528
diskTypeForMetric , enableConfidentialCompute , enableStoragePools = metrics .GetMetricParameters (sourceDisk )
1515
1529
resizedGb , err := gceCS .CloudProvider .ResizeDisk (ctx , project , volKey , reqBytes )
0 commit comments