@@ -122,22 +122,21 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
122122 Message : pod .Status .Message ,
123123 }, nil
124124 }
125- policy := pod .Spec .RestartPolicy
125+ policy := pod .Spec .RestartPolicy
126126 if _ , ok := pod .Annotations [AnnotationIgnoreRestartPolicy ]; ok || policy == corev1 .RestartPolicyAlways {
127127 return getHealthStatus (pod )
128128 }
129-
130- if policy == corev1 .RestartPolicyOnFailure || policy == corev1 .RestartPolicyNever {
131- // Most pods set with a restart policy of OnFailure or Never, have a finite life.
132- // These pods are typically resource hooks. Thus, we consider these as Progressing
133- // instead of healthy. If this is unwanted, e.g., when the pod is managed by an
134- // operator and therefore has a restart policy of OnFailure or Never, then use the
135- // the AnnotationIgnoreRestartPolicy annotation.
136- return & HealthStatus {
137- Status : HealthStatusProgressing ,
138- Message : pod .Status .Message ,
139- }, nil
140- }
129+
130+ if policy == corev1 .RestartPolicyOnFailure || policy == corev1 .RestartPolicyNever {
131+ // Most pods set with a restart policy of OnFailure or Never, have a finite life.
132+ // These pods are typically resource hooks. Thus, we consider these as Progressing
133+ // instead of healthy. If this is unwanted, e.g., when the pod is managed by an
134+ // operator and therefore has a restart policy of OnFailure or Never, then use the
135+ // the AnnotationIgnoreRestartPolicy annotation.
136+ return & HealthStatus {
137+ Status : HealthStatusProgressing ,
138+ Message : pod .Status .Message ,
139+ }, nil
141140 }
142141 }
143142 return & HealthStatus {
0 commit comments