Skip to content

Commit

Permalink
Fix TerminationMessagePath
Browse files Browse the repository at this point in the history
  • Loading branch information
Random-Liu committed Mar 30, 2016
1 parent 2a690cc commit 5dbac3a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/kubelet/dockertools/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,14 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin

terminationMessagePath := containerInfo.TerminationMessagePath
if terminationMessagePath != "" {
if path, found := iResult.Volumes[terminationMessagePath]; found {
if data, err := ioutil.ReadFile(path); err != nil {
message = fmt.Sprintf("Error on reading termination-log %s: %v", path, err)
} else {
message = string(data)
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 {
message = string(data)
}
}
}
}
Expand Down

1 comment on commit 5dbac3a

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 20263 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 267 Build time: 00:05:28

Please sign in to comment.