Merge pull request #23658 from Random-Liu/fix-termination-message-path
Fix TerminationMessagePath
This commit is contained in:
@@ -384,7 +384,9 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin
|
||||
|
||||
terminationMessagePath := containerInfo.TerminationMessagePath
|
||||
if terminationMessagePath != "" {
|
||||
if path, found := iResult.Volumes[terminationMessagePath]; found {
|
||||
for _, mount := range iResult.Mounts {
|
||||
if mount.Destination == terminationMessagePath {
|
||||
path := mount.Source
|
||||
if data, err := ioutil.ReadFile(path); err != nil {
|
||||
message = fmt.Sprintf("Error on reading termination-log %s: %v", path, err)
|
||||
} else {
|
||||
@@ -392,6 +394,7 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
status.State = kubecontainer.ContainerStateExited
|
||||
status.Message = message
|
||||
status.Reason = reason
|
||||
|
Reference in New Issue
Block a user