mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
Better formatting of matcher errors
This commit is contained in:
@@ -88,7 +88,11 @@ func (m ErrorMatcher) Render(e *Error) string {
|
||||
}
|
||||
if m.matchValue {
|
||||
comma()
|
||||
buf.WriteString(fmt.Sprintf("Value=%v", e.BadValue))
|
||||
if s, ok := e.BadValue.(string); ok {
|
||||
buf.WriteString(fmt.Sprintf("Value=%q", s))
|
||||
} else {
|
||||
buf.WriteString(fmt.Sprintf("Value=%v", e.BadValue))
|
||||
}
|
||||
}
|
||||
if m.matchOrigin || m.requireOriginWhenInvalid && e.Type == ErrorTypeInvalid {
|
||||
comma()
|
||||
|
||||
Reference in New Issue
Block a user