Remove dependency on libcontainer/system

This swaps the RunningInUserNS() function that we're using
from libcontainer/system with the one in containerd/sys.

This removes the dependency on libcontainer/system, given
these were the only functions we're using from that package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2020-05-04 14:25:42 +02:00
parent 9413131c7d
commit 0e1b7bdb59
9 changed files with 2 additions and 411 deletions

View File

@@ -19,8 +19,8 @@
package server
import (
"github.com/containerd/containerd/sys"
cni "github.com/containerd/go-cni"
runcsystem "github.com/opencontainers/runc/libcontainer/system"
"github.com/opencontainers/selinux/go-selinux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -34,7 +34,7 @@ const networkAttachCount = 2
func (c *criService) initPlatform() error {
var err error
if runcsystem.RunningInUserNS() {
if sys.RunningInUserNS() {
if !(c.config.DisableCgroup && !c.apparmorEnabled() && c.config.RestrictOOMScoreAdj) {
logrus.Warn("Running containerd in a user namespace typically requires disable_cgroup, disable_apparmor, restrict_oom_score_adj set to be true")
}