elotl / kip

Virtual-kubelet provider running pods in cloud instances
Apache License 2.0
223 stars 14 forks source link

preserve unit statuses when restarting a failed pod #71

Closed justnoise closed 4 years ago

justnoise commented 4 years ago

I'll admit that restarting failed pods is a bit of a strange thing to do and we should talk about whether we want to do that.

To keep things clean and avoid bugs, the old goal was to start with a (mostly) fresh PodStatus when restarting a pod. That's still a pretty good goal. Here we copy over the last unitState into LastTerminatedState when restarting a failed pod. That data will be preserved for the user to query until the pod is restarted. Keeping that data around shouldn't cause any issues in the controller.