mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix 'virtual_subtype' grain for kubernetes and libpod containers
All the containers started by kubelet (hence kubernetes) are assigned to the `kubepods` cgroup slice (see [1]). That happens despite of the Container Runtime Interface being used. Containers started via tools using `libpod` [2] (eg: podman) are assigned to the `libpod_parent` cgroup slice. [1] https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/node-allocatable.md#recommended-cgroups-setup [2] https://github.com/projectatomic/libpod Signed-off-by: Flavio Castelli <fcastelli@suse.com>
This commit is contained in:
parent
7874c908ac
commit
ac1d943394
@ -821,6 +821,10 @@ def _virtual(osdata):
|
||||
fhr_contents = fhr.read()
|
||||
if ':/lxc/' in fhr_contents:
|
||||
grains['virtual_subtype'] = 'LXC'
|
||||
elif ':/kubepods/' in fhr_contents:
|
||||
grains['virtual_subtype'] = 'kubernetes'
|
||||
elif ':/libpod_parent/' in fhr_contents:
|
||||
grains['virtual_subtype'] = 'libpod'
|
||||
else:
|
||||
if any(x in fhr_contents
|
||||
for x in (':/system.slice/docker', ':/docker/',
|
||||
|
Loading…
Reference in New Issue
Block a user