rpc-maas icon indicating copy to clipboard operation
rpc-maas copied to clipboard

Make storage check use df in container namespace

Open JCallicoat opened this issue 3 years ago • 3 comments

The previous method of using chroot to check container storage fails when the container uses a symlink from /etc/mtab to ../proc/self/mounts since the container is running in an isolated pid/mnt namespace and /proc/self is not visible in the chroot.

This commit uses the the attach_wait method from the lxc module to run the df command in the container pid/mnt namespace and parses the df output to gather usage percentage for each mounted device.

Fixes #724

JCallicoat avatar Mar 02 '21 07:03 JCallicoat