Skip to content

Commit

Permalink
Fix wrong cgroup path for PLEG (#325)
Browse files Browse the repository at this point in the history
* fix wrong cgroup path when watch pods

Signed-off-by: Cheimu <xerhoneyfc@gmail.com>

* fix import order

Signed-off-by: Cheimu <xerhoneyfc@gmail.com>

* reformat comments

Signed-off-by: Cheimu <xerhoneyfc@gmail.com>

Co-authored-by: Jason Liu <jasonliu747@gmail.com>
  • Loading branch information
cheimu and jasonliu747 authored Jun 30, 2022
1 parent a6b005f commit 1fa6ec8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/koordlet/pleg/pleg.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"k8s.io/klog/v2"

"github.com/koordinator-sh/koordinator/pkg/util"
"github.com/koordinator-sh/koordinator/pkg/util/system"
)

const (
Expand Down Expand Up @@ -134,7 +135,9 @@ func (p *pleg) RemoverHandler(id HandlerID) PodLifeCycleHandler {
func (p *pleg) Run(stopCh <-chan struct{}) error {
qosClasses := []corev1.PodQOSClass{corev1.PodQOSGuaranteed, corev1.PodQOSBurstable, corev1.PodQOSBestEffort}
for _, qosClass := range qosClasses {
cgroupPath := path.Join(p.cgroupRootPath, util.GetPodQoSRelativePath(qosClass))
// here we choose cpu subsystem as ground truth,
// since we only need to watch one of all subsystems, and cpu subsystem always and must exist
cgroupPath := path.Join(p.cgroupRootPath, system.CgroupCPUDir, util.GetPodQoSRelativePath(qosClass))
err := p.podWatcher.AddWatch(cgroupPath)
if err != nil {
klog.Errorf("failed to watch path %v err %v", cgroupPath, err)
Expand Down

0 comments on commit 1fa6ec8

Please sign in to comment.