Skip to content

Commit f740e1d

Browse files
committed
update isIntegralGuaranteed
1 parent 17d374d commit f740e1d

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

pkg/resourcemonitor/podresourcesscanner.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ func (resMon *PodResourcesScanner) isWatchable(podNamespace string, podName stri
6363
return false, false, err
6464
}
6565

66-
// Check Pod is guaranteed QOS class and has exclusive CPUs or devices
67-
if pod.Status.QOSClass != corev1.PodQOSGuaranteed {
68-
return false, false, nil
69-
}
70-
71-
isIntegralGuaranteed := hasExclusiveCPUs(pod)
66+
isIntegralGuaranteed := pod.Status.QOSClass == corev1.PodQOSGuaranteed && hasExclusiveCPUs(pod)
7267

7368
if resMon.namespace == "*" && (isIntegralGuaranteed || hasDevice) {
7469
return true, isIntegralGuaranteed, nil

pkg/resourcemonitor/podresourcesscanner_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,6 @@ func TestPodScanner(t *testing.T) {
548548
},
549549
},
550550
},
551-
Status: corev1.PodStatus{
552-
QOSClass: corev1.PodQOSGuaranteed,
553-
},
554551
}
555552
fakeCli = fakeclient.NewSimpleClientset(pod)
556553
resScan.(*PodResourcesScanner).k8sClient = fakeCli

0 commit comments

Comments
 (0)