Skip to content

Commit

Permalink
Merge pull request #132 from jmencak/4.5-bz1834693-rhel7
Browse files Browse the repository at this point in the history
Bug 1834693: Fix issues with profile application on non-RHCOS platforms with host tuned.
  • Loading branch information
openshift-merge-robot committed May 12, 2020
2 parents 19cadc0 + 01112cb commit e2cf2dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/tuned/tuned.go
Expand Up @@ -251,13 +251,13 @@ func disableSystemTuned() {
stdout bytes.Buffer
stderr bytes.Buffer
)
klog.V(1).Infof("disabling system tuned...")
klog.Infof("disabling system tuned...")
cmd := exec.Command("/usr/bin/systemctl", "disable", "tuned", "--now")
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {
klog.V(1).Infof("failed to disable system tuned: %s", stderr.String()) // do not use log.Printf(), tuned has its own timestamping
klog.V(1).Infof("failed to disable system tuned: %v: %s", err, stderr.String()) // do not use log.Printf(), tuned has its own timestamping
}
}

Expand Down Expand Up @@ -613,6 +613,7 @@ func (c *Controller) informerEventHandler(workqueueKey wqKey) cache.ResourceEven
return
}

workqueueKey.name = accessor.GetName()
if workqueueKey.kind == wqKindProfile && workqueueKey.name == getNodeName() {
// When moving this code elsewhere, consider whether it is desirable
// to disable system tuned on nodes that should not be managed by
Expand All @@ -621,7 +622,7 @@ func (c *Controller) informerEventHandler(workqueueKey wqKey) cache.ResourceEven
}

klog.V(2).Infof("add event to workqueue due to %s (add)", util.ObjectInfo(o))
c.workqueue.Add(wqKey{kind: workqueueKey.kind, name: accessor.GetName()})
c.workqueue.Add(wqKey{kind: workqueueKey.kind, name: workqueueKey.name})
},
UpdateFunc: func(o, n interface{}) {
newAccessor, err := kmeta.Accessor(n)
Expand Down

0 comments on commit e2cf2dc

Please sign in to comment.