Update due to inconsistent message got from kube-openapi

This commit is contained in:
cici37 2022-03-24 13:11:42 -07:00
parent 4bb5516163
commit 025a4ac38e
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ func ValidateCustomResource(fldPath *field.Path, customResource interface{}, val
if i, ok := err.Value.(int64); ok {
max = i
}
allErrs = append(allErrs, field.TooMany(errPath, -1, int(max)))
allErrs = append(allErrs, field.TooMany(errPath, int(max), -1))
case openapierrors.TooManyPropertiesCode:
max := int64(-1)

View File

@ -561,7 +561,7 @@ func TestValidateCustomResource(t *testing.T) {
},
failingObjects: []failingObject{
{object: map[string]interface{}{"fieldX": []interface{}{"a", "b", "c"}}, expectErrs: []string{
`fieldX: Too many: must have at most 3 items`,
`fieldX: Too many: 3: has too many items`,
}},
},
},