Kubelet server was not returning a 500 on errors writing logs

Writing 200 first masks the second error. 200 is defaulted by the Go
http stack automatically.
This commit is contained in:
Clayton Coleman 2016-01-28 00:15:44 -05:00
parent 4f559b3af7
commit 8448b60f51

View File

@ -440,7 +440,6 @@ func (s *Server) getContainerLogs(request *restful.Request, response *restful.Re
fw = limitwriter.New(fw, *logOptions.LimitBytes)
}
response.Header().Set("Transfer-Encoding", "chunked")
response.WriteHeader(http.StatusOK)
if err := s.host.GetKubeletContainerLogs(kubecontainer.GetPodFullName(pod), containerName, logOptions, fw, fw); err != nil {
if err != limitwriter.ErrMaximumWrite {
response.WriteError(http.StatusInternalServerError, err)