Prevent panic in build controller when pod has already been deleted
handleCompletedBuild may be called with a nil pod, but isOOMKilled()
doesn't check whether the pod is nil first.
@@ -1017,6 +1017,9 @@ func (bc *BuildController) handleActiveBuild(build *buildapi.Build, pod *v1.Pod)
}
func isOOMKilled(pod *v1.Pod) bool {
+ if pod == nil {
+ return false
+ }
if pod.Status.Reason == "OOMKilled" {
return true
}
