Skip to content

Commit

Permalink
Merge pull request #24504 from Random-Liu/automated-cherry-pick-of-#2…
Browse files Browse the repository at this point in the history
…3658-upstream-release-1.2

Automated cherry pick of #23658
  • Loading branch information
zmerlynn committed Apr 20, 2016
2 parents f2d4b68 + 0afc625 commit 812b3b7
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

0 comments on commit 812b3b7

Please sign in to comment.