Skip to content

Commit

Permalink
Remove premature CreateVolume error if requested IOPS is below minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Dec 27, 2023
1 parent 0c45916 commit f57bf3d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
2 changes: 0 additions & 2 deletions pkg/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -1517,8 +1517,6 @@ func capIOPS(volumeType string, requestedCapacityGiB int64, requestedIops int64,
if allowIncrease {
iops = minTotalIOPS
klog.V(5).InfoS("[Debug] Increased IOPS to the min supported limit", "volumeType", volumeType, "requestedCapacityGiB", requestedCapacityGiB, "limit", iops)
} else {
return 0, fmt.Errorf("invalid IOPS: %d is too low, it must be at least %d", iops, minTotalIOPS)
}
}
if iops > maxTotalIOPS {
Expand Down
34 changes: 0 additions & 34 deletions pkg/cloud/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,6 @@ func TestCreateDisk(t *testing.T) {
expCreateVolumeInput: nil,
expErr: fmt.Errorf("invalid StorageClass parameters; specify either IOPS or IOPSPerGb, not both"),
},
{
name: "fail: io1 with too low iopsPerGB",
volumeName: "vol-test-name",
diskOptions: &DiskOptions{
CapacityBytes: util.GiBToBytes(4),
Tags: map[string]string{VolumeNameTagKey: "vol-test", AwsEbsDriverTagKey: "true"},
VolumeType: VolumeTypeIO1,
IOPSPerGB: 1,
},
expDisk: &Disk{
VolumeID: "vol-test",
CapacityGiB: 4,
AvailabilityZone: defaultZone,
},
expCreateVolumeInput: nil,
expErr: fmt.Errorf("invalid IOPS: 4 is too low, it must be at least 100"),
},
{
name: "success: small io1 with too high iopsPerGB",
volumeName: "vol-test-name",
Expand Down Expand Up @@ -650,23 +633,6 @@ func TestCreateDisk(t *testing.T) {
},
expErr: nil,
},
{
name: "fail: io2 with too low iopsPerGB",
volumeName: "vol-test-name",
diskOptions: &DiskOptions{
CapacityBytes: util.GiBToBytes(4),
Tags: map[string]string{VolumeNameTagKey: "vol-test", AwsEbsDriverTagKey: "true"},
VolumeType: VolumeTypeIO2,
IOPSPerGB: 1,
},
expDisk: &Disk{
VolumeID: "vol-test",
CapacityGiB: 4,
AvailabilityZone: defaultZone,
},
expCreateVolumeInput: nil,
expErr: fmt.Errorf("invalid IOPS: 4 is too low, it must be at least 100"),
},
{
name: "success: small io2 with too high iopsPerGB",
volumeName: "vol-test-name",
Expand Down

0 comments on commit f57bf3d

Please sign in to comment.