Restart pods only when Pods are Terminating

More of a query

I am using pods to run test cases in parallel

Sometimes due to resource issues, few pods terminate

I have currently set the Restart Policy as Never for the Pods

I would like to restart the pod, only when Pods gets into Terminating status, is that possible through some option now

Note: As i am running tests, i cannot set restart Policy:on Failure as it would rerun the failed tests in pods again.

You would need to make your own operator or tooling to do this. The options for restart policies are “Always”, “Never”, and “OnFailure”. Anything else requires custom tooling.