The -host-root flag not fully applied
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.
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.
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
Incorrecnt/insufficient sysroot usage in the pkg/topology package has been fixed and should work now correctly.