Add support to query kubelet's logs and cadvisor's stats through

apiserver by passing rawquery.

minor changes

Fixed a minor rebase issues.

Using ioutil.ReadAll instead of httputil.DumpResponse
This commit is contained in:
Dawn Chen
2014-07-15 00:04:30 -07:00
parent 7910ae8159
commit 064237a5b8
91 changed files with 30435 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ type kubeletInterface interface {
GetRootInfo(req *info.ContainerInfoRequest) (*info.ContainerInfo, error)
GetMachineInfo() (*info.MachineInfo, error)
GetPodInfo(name string) (api.PodInfo, error)
ServeLogs(w http.ResponseWriter, req *http.Request)
}
func (s *Server) error(w http.ResponseWriter, err error) {
@@ -131,6 +132,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
w.Header().Add("Content-type", "application/json")
w.Write(data)
case strings.HasPrefix(u.Path, "/logs/"):
s.Kubelet.ServeLogs(w, req)
default:
s.DelegateHandler.ServeHTTP(w, req)
}