mirror of https://github.com/k3s-io/k3s
![]() The slice of strings more precisely captures the hierarchic nature of the cgroup paths we use to represent pods and their groupings. It also ensures we're reducing the chances of passing an incorrect path format to a cgroup driver that requires a different path naming, since now explicit conversions are always needed. The new constructor NewCgroupName starts from an existing CgroupName, which enforces a hierarchy where a root is always needed. It also performs checking on the component names to ensure invalid characters ("/" and "_") are not in use. A RootCgroupName for the top of the cgroup hierarchy tree is introduced. This refactor results in a net reduction of around 30 lines of code, mainly with the demise of ConvertCgroupNameToSystemd which had fairly complicated logic in it and was doing just too many things. There's a small TODO in a helper updateSystemdCgroupInfo that was introduced to make this commit possible. That logic really belongs in libcontainer, I'm planning to send a PR there to include it there. (The API already takes a field with that information, only that field is only processed in cgroupfs and not systemd driver, we should fix that.) Tested by running the e2e-node tests on both Ubuntu 16.04 (with cgroupfs driver) and CentOS 7 (with systemd driver.) |
||
---|---|---|
.. | ||
BUILD | ||
cadvisor_stats_provider.go | ||
cadvisor_stats_provider_test.go | ||
cri_stats_provider.go | ||
cri_stats_provider_test.go | ||
helper.go | ||
helper_test.go | ||
log_metrics_provider.go | ||
log_metrics_provider_test.go | ||
stats_provider.go | ||
stats_provider_linux.go | ||
stats_provider_test.go | ||
stats_provider_unsupported.go |