Merge pull request #47357 from yujuhong/rm-oomkilled

Automatic merge from submit-queue (batch tested with PRs 47357, 49514, 49271, 49572, 49476)

Using only the exit code to decide when to fall back on logs

We expect the exit code to be non-zero if the the container process was
OOM killed. Remove the check that uses the "Reason" field.
pull/6/head
Kubernetes Submit Queue 2017-07-26 12:03:42 -07:00 committed by GitHub
commit 4b0fde198d
1 changed files with 1 additions and 1 deletions

View File

@ -426,7 +426,7 @@ func (m *kubeGenericRuntimeManager) getPodContainerStatuses(uid kubetypes.UID, n
// Populate the termination message if needed.
annotatedInfo := getContainerInfoFromAnnotations(status.Annotations)
labeledInfo := getContainerInfoFromLabels(status.Labels)
fallbackToLogs := annotatedInfo.TerminationMessagePolicy == v1.TerminationMessageFallbackToLogsOnError && (cStatus.ExitCode != 0 || cStatus.Reason == "OOMKilled")
fallbackToLogs := annotatedInfo.TerminationMessagePolicy == v1.TerminationMessageFallbackToLogsOnError && cStatus.ExitCode != 0
tMessage, checkLogs := getTerminationMessage(status, annotatedInfo.TerminationMessagePath, fallbackToLogs)
if checkLogs {
path := buildFullContainerLogsPath(uid, labeledInfo.ContainerName, annotatedInfo.RestartCount)