@@ -122,22 +122,21 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
122
122
Message : pod .Status .Message ,
123
123
}, nil
124
124
}
125
- policy := pod .Spec .RestartPolicy
125
+ policy := pod .Spec .RestartPolicy
126
126
if _ , ok := pod .Annotations [AnnotationIgnoreRestartPolicy ]; ok || policy == corev1 .RestartPolicyAlways {
127
127
return getHealthStatus (pod )
128
128
}
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
141
140
}
142
141
}
143
142
return & HealthStatus {
0 commit comments