mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
commit
412b3f4869
@ -62,7 +62,7 @@ type UnexpectedStatusError struct {
|
|||||||
|
|
||||||
// Error returns a textual description of 'u'.
|
// Error returns a textual description of 'u'.
|
||||||
func (u *UnexpectedStatusError) Error() string {
|
func (u *UnexpectedStatusError) Error() string {
|
||||||
return fmt.Sprintf("request [%#v] failed (%d) %s: %s", u.Request, u.Response.StatusCode, u.Response.Status, u.Body)
|
return fmt.Sprintf("request [%+v] failed (%d) %s: %s", u.Request, u.Response.StatusCode, u.Response.Status, u.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestConstructionError is returned when there's an error assembling a request.
|
// RequestConstructionError is returned when there's an error assembling a request.
|
||||||
@ -242,7 +242,7 @@ func (r *Request) Body(obj interface{}) *Request {
|
|||||||
}
|
}
|
||||||
r.body = bytes.NewBuffer(data)
|
r.body = bytes.NewBuffer(data)
|
||||||
default:
|
default:
|
||||||
r.err = fmt.Errorf("unknown type used for body: %#v", obj)
|
r.err = fmt.Errorf("unknown type used for body: %+v", obj)
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ func (r *Request) Watch() (watch.Interface, error) {
|
|||||||
if resp.Body != nil {
|
if resp.Body != nil {
|
||||||
body, _ = ioutil.ReadAll(resp.Body)
|
body, _ = ioutil.ReadAll(resp.Body)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("for request '%v', got status: %v\nbody: %v", req.URL, resp.StatusCode, string(body))
|
return nil, fmt.Errorf("for request '%+v', got status: %v\nbody: %v", req.URL, resp.StatusCode, string(body))
|
||||||
}
|
}
|
||||||
return watch.NewStreamWatcher(watchjson.NewDecoder(resp.Body, r.codec)), nil
|
return watch.NewStreamWatcher(watchjson.NewDecoder(resp.Body, r.codec)), nil
|
||||||
}
|
}
|
||||||
|
@ -168,8 +168,8 @@ func (rl *respLogger) Write(b []byte) (int, error) {
|
|||||||
func (rl *respLogger) Flush() {
|
func (rl *respLogger) Flush() {
|
||||||
if flusher, ok := rl.w.(http.Flusher); ok {
|
if flusher, ok := rl.w.(http.Flusher); ok {
|
||||||
flusher.Flush()
|
flusher.Flush()
|
||||||
} else {
|
} else if glog.V(2) {
|
||||||
glog.V(2).Infof("Unable to convert %v into http.Flusher", rl.w)
|
glog.InfoDepth(1, fmt.Sprintf("Unable to convert %+v into http.Flusher", rl.w))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user