nri-plugins icon indicating copy to clipboard operation
nri-plugins copied to clipboard

The -host-root flag not fully applied

Open marquiz opened this issue 2 years ago • 2 comments

At a quick look to the codebase (while writing #72) it appeared that the -host-root flag of the resource policies are not applied correctly in all places, causing unintended behavior.

I spotted these packages:

  • https://github.com/containers/nri-plugins/tree/main/pkg/cgroups
  • https://github.com/containers/nri-plugins/tree/main/pkg/cgroupstats
  • https://github.com/containers/nri-plugins/tree/main/pkg/resmgr/control/memory
  • https://github.com/containers/nri-plugins/tree/main/pkg/topology

I might've misread/misunderstood the code but please check.

marquiz avatar Jun 20 '23 15:06 marquiz

In pkg/topology the -host-root flag should be applied: https://github.com/containers/nri-plugins/blob/19bbdd5438fd30bf09c7e33930a5877b9f4b4418/pkg/resmgr/resource-manager.go#L93.

The others are probably not set correctly. Some of those are also unused. And, for instance, I'm not sure if we should keep the memory controller at all or just remove it. The necessary related kernel-side code has never been merged upstream, and it does not function without it.

But let's fix those which are in use and maybe remove the rest.

klihub avatar Jun 21 '23 11:06 klihub

In pkg/topology the -host-root flag should be applied:

I was probably looking at this which looks suspicious:

https://github.com/containers/nri-plugins/blob/19bbdd5438fd30bf09c7e33930a5877b9f4b4418/pkg/topology/topology.go#L74

marquiz avatar Jun 22 '23 07:06 marquiz

Incorrecnt/insufficient sysroot usage in the pkg/topology package has been fixed and should work now correctly.

klihub avatar Apr 14 '25 07:04 klihub