mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Merge pull request #59484 from verb/debug-kubelet-1
Add support for Ephemeral Containers to the kubelet
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user