Cadvisor returns richer errors to the kubelet server.

This commit is contained in:
Prashanth Balasubramanian
2015-02-13 08:54:06 -08:00
parent 49b92d43b6
commit 9427f75788
4 changed files with 126 additions and 7 deletions

View File

@@ -400,7 +400,13 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) {
http.Error(w, "unknown resource.", http.StatusNotFound)
return
}
if err != nil {
switch err {
case nil:
break
case ErrNoKubeletContainers, ErrContainerNotFound:
http.Error(w, err.Error(), http.StatusNotFound)
return
default:
s.error(w, err)
return
}