scheduler: ValidateNodeResourcesFitArgs will check ScoringStrategy.Type field and print supported ScoringStrategyType list on error

This commit is contained in:
SataQiu
2022-07-26 13:23:03 +08:00
parent 3987c8ad91
commit 107dee6f04
4 changed files with 44 additions and 25 deletions

View File

@@ -283,7 +283,7 @@ func TestLeastAllocatedScoringStrategy(t *testing.T) {
wantErrs: field.ErrorList{
&field.Error{
Type: field.ErrorTypeInvalid,
Field: "resources[0].weight",
Field: "scoringStrategy.resources[0].weight",
},
},
},
@@ -306,7 +306,7 @@ func TestLeastAllocatedScoringStrategy(t *testing.T) {
wantErrs: field.ErrorList{
&field.Error{
Type: field.ErrorTypeInvalid,
Field: "resources[1].weight",
Field: "scoringStrategy.resources[1].weight",
},
},
},
@@ -327,7 +327,7 @@ func TestLeastAllocatedScoringStrategy(t *testing.T) {
wantErrs: field.ErrorList{
&field.Error{
Type: field.ErrorTypeInvalid,
Field: "resources[1].weight",
Field: "scoringStrategy.resources[1].weight",
},
},
},