mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -390,7 +390,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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user