MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / PodRestarted

Function PodRestarted

tests/utils/operator/operator.go:268–276  ·  view source on GitHub ↗

PodRestarted checks if the operator pod was restarted

(operatorPod corev1.Pod)

Source from the content-addressed store, hash-verified

266
267// PodRestarted checks if the operator pod was restarted
268func 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

Callers 2

suite_test.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected