Fix volume limit for EBS on m5 and c5 instances

This commit is contained in:
Hemant Kumar
2018-07-19 15:05:58 -04:00
parent b9bd7f2ffb
commit 45b8107378
3 changed files with 65 additions and 16 deletions

View File

@@ -3913,7 +3913,6 @@ func TestVolumeZonePredicateWithVolumeBinding(t *testing.T) {
func TestGetMaxVols(t *testing.T) {
previousValue := os.Getenv(KubeMaxPDVols)
defaultValue := 39
tests := []struct {
rawMaxVols string
@@ -3922,12 +3921,12 @@ func TestGetMaxVols(t *testing.T) {
}{
{
rawMaxVols: "invalid",
expected: defaultValue,
expected: -1,
name: "Unable to parse maximum PD volumes value, using default value",
},
{
rawMaxVols: "-2",
expected: defaultValue,
expected: -1,
name: "Maximum PD volumes must be a positive value, using default value",
},
{
@@ -3940,7 +3939,7 @@ func TestGetMaxVols(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
os.Setenv(KubeMaxPDVols, test.rawMaxVols)
result := getMaxVols(defaultValue)
result := getMaxVolLimitFromEnv()
if result != test.expected {
t.Errorf("expected %v got %v", test.expected, result)
}