PodRestarted checks if the operator pod was restarted
(operatorPod corev1.Pod)
| 266 | |
| 267 | // PodRestarted checks if the operator pod was restarted |
| 268 | func PodRestarted(operatorPod corev1.Pod) bool { |
| 269 | restartCount := 0 |
| 270 | for _, containerStatus := range operatorPod.Status.ContainerStatuses { |
| 271 | if containerStatus.Name == "manager" { |
| 272 | restartCount = int(containerStatus.RestartCount) |
| 273 | } |
| 274 | } |
| 275 | return restartCount != 0 |
| 276 | } |
| 277 | |
| 278 | // GetPodName returns the name of the current operator pod |
| 279 | // NOTE: will return an error if the pod is being deleted |
no outgoing calls
no test coverage detected