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