fix(inputs.prometheus): Don't collect metrics from finished pods (#13629)

This commit is contained in:
Maxim Ivanov 2023-07-21 09:09:44 +00:00 committed by GitHub
parent cb966ebf6b
commit 9d894e7dee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -368,7 +368,7 @@ func podHasMatchingNamespace(pod *corev1.Pod, p *Prometheus) bool {
func podReady(pod *corev1.Pod) bool {
for _, cond := range pod.Status.Conditions {
if cond.Type == corev1.PodReady {
return true
return pod.Status.Phase == corev1.PodRunning
}
}
return false