Merge pull request #59484 from verb/debug-kubelet-1

Add support for Ephemeral Containers to the kubelet
This commit is contained in:
Kubernetes Prow Robot
2019-08-21 00:29:17 -07:00
committed by GitHub
11 changed files with 375 additions and 86 deletions

View File

@@ -555,22 +555,7 @@ func (s *Server) getContainerLogs(request *restful.Request, response *restful.Re
return
}
// Check if containerName is valid.
containerExists := false
for _, container := range pod.Spec.Containers {
if container.Name == containerName {
containerExists = true
break
}
}
if !containerExists {
for _, container := range pod.Spec.InitContainers {
if container.Name == containerName {
containerExists = true
break
}
}
}
if !containerExists {
if kubecontainer.GetContainerSpec(pod, containerName) == nil {
response.WriteError(http.StatusNotFound, fmt.Errorf("container %q not found in pod %q", containerName, podID))
return
}