feat(scheduling): implement azure, cinder, ebs and gce as filter plugin

This commit is contained in:
draveness
2019-12-27 16:53:28 +08:00
parent f1cbbda291
commit 320ac4e277
17 changed files with 1387 additions and 2873 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package predicates
import (
"os"
"reflect"
"strconv"
"strings"
@@ -1719,44 +1718,3 @@ func TestPodToleratesTaints(t *testing.T) {
})
}
}
func TestGetMaxVols(t *testing.T) {
previousValue := os.Getenv(KubeMaxPDVols)
tests := []struct {
rawMaxVols string
expected int
name string
}{
{
rawMaxVols: "invalid",
expected: -1,
name: "Unable to parse maximum PD volumes value, using default value",
},
{
rawMaxVols: "-2",
expected: -1,
name: "Maximum PD volumes must be a positive value, using default value",
},
{
rawMaxVols: "40",
expected: 40,
name: "Parse maximum PD volumes value from env",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
os.Setenv(KubeMaxPDVols, test.rawMaxVols)
result := getMaxVolLimitFromEnv()
if result != test.expected {
t.Errorf("expected %v got %v", test.expected, result)
}
})
}
os.Unsetenv(KubeMaxPDVols)
if previousValue != "" {
os.Setenv(KubeMaxPDVols, previousValue)
}
}