Skip to content

Commit d9d6ac5

Browse files
committed
rename podHasIntegralCPUs
1 parent 5d40f79 commit d9d6ac5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/resourcemonitor/podresourcesscanner.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
corev1 "k8s.io/api/core/v1"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
client "k8s.io/client-go/kubernetes"
28-
"k8s.io/klog/v2"
2928
podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1"
3029

3130
"github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2"
@@ -69,16 +68,16 @@ func (resMon *PodResourcesScanner) isWatchable(podResource *podresourcesapi.PodR
6968
return false, false, err
7069
}
7170

72-
podHasExclusiveCPUs := hasExclusiveCPUs(pod)
71+
isPodHasIntegralCPUs := podHasIntegralCPUs(pod)
7372
isPodGuaranteed := qos.GetPodQOS(pod) == corev1.PodQOSGuaranteed
7473

75-
return isPodGuaranteed || hasDevice(podResource), podHasExclusiveCPUs, nil
74+
return isPodGuaranteed || hasDevice(podResource), isPodHasIntegralCPUs, nil
7675
}
7776

78-
// hasExclusiveCPUs returns true if a guaranteed pod is allocated exclusive CPUs else returns false.
77+
// podHasIntegralCPUs returns true if a guaranteed pod is allocated exclusive CPUs else returns false.
7978
// In isWatchable() function we check for the pod QoS and proceed if it is guaranteed (i.e. request == limit)
8079
// and hence we only check for request in the function below.
81-
func hasExclusiveCPUs(pod *corev1.Pod) bool {
80+
func podHasIntegralCPUs(pod *corev1.Pod) bool {
8281
for _, container := range pod.Spec.InitContainers {
8382
if hasIntegralCPUs(&container) {
8483
return true

0 commit comments

Comments
 (0)