File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,19 @@ func GetPodStatus(pod *corev1.Pod) string {
105105 case corev1 .PodSucceeded :
106106 return PodStatusSucceeded
107107 case corev1 .PodFailed :
108+ for _ , containerStatus := range pod .Status .ContainerStatuses {
109+ if containerStatus .LastTerminationState .Terminated != nil {
110+ exitCode := containerStatus .LastTerminationState .Terminated .ExitCode
111+ if killStatuses [exitCode ] {
112+ return PodStatusKilled
113+ }
114+ } else if containerStatus .State .Terminated != nil {
115+ exitCode := containerStatus .State .Terminated .ExitCode
116+ if killStatuses [exitCode ] {
117+ return PodStatusKilled
118+ }
119+ }
120+ }
108121 return PodStatusFailed
109122 case corev1 .PodRunning :
110123 if pod .ObjectMeta .DeletionTimestamp != nil {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
2929 "github.com/cortexlabs/cortex/pkg/lib/sets/strset"
3030 "github.com/cortexlabs/cortex/pkg/operator/aws"
3131 ocontext "github.com/cortexlabs/cortex/pkg/operator/context"
32+ "github.com/cortexlabs/cortex/pkg/operator/k8s"
3233)
3334
3435type WorkloadSpec struct {
@@ -148,7 +149,12 @@ func UpdateDataWorkflowErrors(failedPods []corev1.Pod) error {
148149 if savedStatus .Start == nil {
149150 savedStatus .Start = nowTime
150151 }
152+
151153 savedStatus .ExitCode = resource .ExitCodeDataFailed
154+ if k8s .GetPodStatus (& pod ) == k8s .PodStatusKilled {
155+ savedStatus .ExitCode = resource .ExitCodeDataKilled
156+ }
157+
152158 savedStatusesToUpload = append (savedStatusesToUpload , savedStatus )
153159 }
154160 }
You can’t perform that action at this time.
0 commit comments