File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -122,13 +122,12 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
122
122
Message : pod .Status .Message ,
123
123
}, nil
124
124
}
125
- if _ , hook := pod .Annotations [AnnotationIgnoreRestartPolicy ]; hook {
125
+ policy := pod .Spec .RestartPolicy
126
+ if _ , ok := pod .Annotations [AnnotationIgnoreRestartPolicy ]; ok || policy == corev1 .RestartPolicyAlways {
126
127
return getHealthStatus (pod )
127
- } else {
128
- switch pod .Spec .RestartPolicy {
129
- case corev1 .RestartPolicyAlways :
130
- return getHealthStatus (pod )
131
- case corev1 .RestartPolicyOnFailure , corev1 .RestartPolicyNever :
128
+ }
129
+
130
+ if policy == corev1 .RestartPolicyOnFailure || policy == corev1 .RestartPolicyNever {
132
131
// Most pods set with a restart policy of OnFailure or Never, have a finite life.
133
132
// These pods are typically resource hooks. Thus, we consider these as Progressing
134
133
// instead of healthy. If this is unwanted, e.g., when the pod is managed by an
You can’t perform that action at this time.
0 commit comments