fix(inputs.prometheus): Don't collect metrics from finished pods (#13629)
This commit is contained in:
parent
cb966ebf6b
commit
9d894e7dee
|
|
@ -368,7 +368,7 @@ func podHasMatchingNamespace(pod *corev1.Pod, p *Prometheus) bool {
|
||||||
func podReady(pod *corev1.Pod) bool {
|
func podReady(pod *corev1.Pod) bool {
|
||||||
for _, cond := range pod.Status.Conditions {
|
for _, cond := range pod.Status.Conditions {
|
||||||
if cond.Type == corev1.PodReady {
|
if cond.Type == corev1.PodReady {
|
||||||
return true
|
return pod.Status.Phase == corev1.PodRunning
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue