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