mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
fix error message in validation test
This commit is contained in:
parent
3a62089790
commit
7ffe791486
@ -28,8 +28,8 @@ import (
|
|||||||
|
|
||||||
func expectPrefix(t *testing.T, prefix string, errs errors.ErrorList) {
|
func expectPrefix(t *testing.T, prefix string, errs errors.ErrorList) {
|
||||||
for i := range errs {
|
for i := range errs {
|
||||||
if !strings.HasPrefix(errs[i].(errors.ValidationError).Field, prefix) {
|
if f, p := errs[i].(errors.ValidationError).Field, prefix; !strings.HasPrefix(f, p) {
|
||||||
t.Errorf("expected prefix '%s' for %v", errs[i])
|
t.Errorf("expected prefix '%s' for field '%s' (%v)", p, f, errs[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user