@@ -321,13 +321,16 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
321
321
// https://github.com/container-storage-interface/spec/blob/master/spec.md#createvolume
322
322
// mutable_parameters MUST take precedence over the values from parameters.
323
323
mutableParams := req .GetMutableParameters ()
324
- if mutableParams != nil {
324
+ // If the disk type is pd-*, the IOPS and Throughput parameters are ignored.
325
+ if mutableParams != nil && ! strings .HasPrefix (params .DiskType , "pd" ) {
325
326
p , err := common .ExtractModifyVolumeParameters (mutableParams )
326
327
if err != nil {
327
328
return nil , status .Errorf (codes .InvalidArgument , "Invalid mutable parameters: %v" , err )
328
329
}
329
330
params .ProvisionedIOPSOnCreate = p .IOPS
330
331
params .ProvisionedThroughputOnCreate = p .Throughput
332
+ } else {
333
+ klog .V (4 ).Infof ("Ignoring IOPS and throughput parameters for unsupported disk type %s" , params .DiskType )
331
334
}
332
335
333
336
// Determine multiWriter
@@ -550,12 +553,12 @@ func (gceCS *GCEControllerServer) ControllerModifyVolume(ctx context.Context, re
550
553
return nil , status .Error (codes .InvalidArgument , "volume ID must be provided" )
551
554
}
552
555
553
- diskTypeForMetric := metrics .DefaultDiskTypeForMetric
556
+ diskType := metrics .DefaultDiskTypeForMetric
554
557
enableConfidentialCompute := metrics .DefaultEnableConfidentialCompute
555
558
enableStoragePools := metrics .DefaultEnableStoragePools
556
559
557
560
defer func () {
558
- gceCS .Metrics .RecordOperationErrorMetrics ("ModifyVolume" , err , diskTypeForMetric , enableConfidentialCompute , enableStoragePools )
561
+ gceCS .Metrics .RecordOperationErrorMetrics ("ModifyVolume" , err , diskType , enableConfidentialCompute , enableStoragePools )
559
562
}()
560
563
561
564
project , volKey , err := common .VolumeIDToKey (volumeID )
@@ -581,7 +584,8 @@ func (gceCS *GCEControllerServer) ControllerModifyVolume(ctx context.Context, re
581
584
582
585
return nil , status .Errorf (codes .Internal , "failed to get volume : %s" , volumeID )
583
586
}
584
- diskTypeForMetric = existingDisk .GetPDType ()
587
+ diskType = existingDisk .GetPDType ()
588
+ // TODO : not sure how this metric should be reported
585
589
if existingDisk .GetEnableStoragePools () {
586
590
enableStoragePools = "enabled"
587
591
} else {
0 commit comments