detect evicted pods and set status properly
@@ -166,6 +166,19 @@ func (c *Controller) syncFunctionInvocation(cr *v1alpha1.IBFunctionInvocation, l
log.Info("Updating job status")
return sdk.Update(cr)
}
+
+ if pod.Status.Phase == "Failed" {
+ cr.Status.State = corev1.ContainerState{
+ Terminated: &corev1.ContainerStateTerminated{
+ ExitCode: 200,
+ Reason: pod.Status.Reason,
+ Message: pod.Status.Message,
+ },
+ }
+
+ log.Info("Updating job status")
+ return sdk.Update(cr)
+ }
}
return nil
