Commit d0d75ce6 authored by Lantao Liu's avatar Lantao Liu Committed by Pengfei Ni

Make kubelet `ReadLogs` backward compatible.

parent 95eea8a8
...@@ -730,10 +730,7 @@ func (m *kubeGenericRuntimeManager) GetContainerLogs(pod *v1.Pod, containerID ku ...@@ -730,10 +730,7 @@ func (m *kubeGenericRuntimeManager) GetContainerLogs(pod *v1.Pod, containerID ku
glog.V(4).Infof("failed to get container status for %v: %v", containerID.String(), err) glog.V(4).Infof("failed to get container status for %v: %v", containerID.String(), err)
return fmt.Errorf("Unable to retrieve container logs for %v", containerID.String()) return fmt.Errorf("Unable to retrieve container logs for %v", containerID.String())
} }
labeledInfo := getContainerInfoFromLabels(status.Labels) return m.ReadLogs(status.GetLogPath(), containerID.ID, logOptions, stdout, stderr)
annotatedInfo := getContainerInfoFromAnnotations(status.Annotations)
path := buildFullContainerLogsPath(pod.UID, labeledInfo.ContainerName, annotatedInfo.RestartCount)
return m.ReadLogs(path, containerID.ID, logOptions, stdout, stderr)
} }
// GetExec gets the endpoint the runtime will serve the exec request from. // GetExec gets the endpoint the runtime will serve the exec request from.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment