mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 04:52:08 +00:00
Fix TerminationMessagePath
This commit is contained in:
parent
2a690cc5e2
commit
5dbac3a8b8
@ -382,7 +382,9 @@ 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 mount.Destination == terminationMessagePath {
|
||||||
|
path := mount.Source
|
||||||
if data, err := ioutil.ReadFile(path); err != nil {
|
if data, err := ioutil.ReadFile(path); err != nil {
|
||||||
message = fmt.Sprintf("Error on reading termination-log %s: %v", path, err)
|
message = fmt.Sprintf("Error on reading termination-log %s: %v", path, err)
|
||||||
} else {
|
} else {
|
||||||
@ -390,6 +392,7 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
status.State = kubecontainer.ContainerStateExited
|
status.State = kubecontainer.ContainerStateExited
|
||||||
status.Message = message
|
status.Message = message
|
||||||
status.Reason = reason
|
status.Reason = reason
|
||||||
|
Loading…
Reference in New Issue
Block a user