mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Update due to inconsistent message got from kube-openapi
This commit is contained in:
parent
4bb5516163
commit
025a4ac38e
@ -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)
|
||||
|
@ -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`,
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user