diff --git a/cmd/crio/main.go b/cmd/crio/main.go index a1c0bad9..0c4bfa3b 100644 --- a/cmd/crio/main.go +++ b/cmd/crio/main.go @@ -17,7 +17,6 @@ import ( "github.com/kubernetes-incubator/cri-o/lib" "github.com/kubernetes-incubator/cri-o/server" "github.com/kubernetes-incubator/cri-o/version" - "github.com/opencontainers/selinux/go-selinux" "github.com/sirupsen/logrus" "github.com/soheilhy/cmux" "github.com/urfave/cli" @@ -429,7 +428,7 @@ func main() { config := c.App.Metadata["config"].(*server.Config) if !config.SELinux { - selinux.SetDisabled() + disableSELinux() } if _, err := os.Stat(config.Runtime); os.IsNotExist(err) { diff --git a/cmd/crio/selinux_linux.go b/cmd/crio/selinux_linux.go new file mode 100644 index 00000000..a32c1d58 --- /dev/null +++ b/cmd/crio/selinux_linux.go @@ -0,0 +1,9 @@ +// +build linux + +package main + +import selinux "github.com/opencontainers/selinux/go-selinux" + +func disableSELinux() { + selinux.SetDisabled() +} diff --git a/cmd/crio/selinux_unsupported.go b/cmd/crio/selinux_unsupported.go new file mode 100644 index 00000000..8e719ac1 --- /dev/null +++ b/cmd/crio/selinux_unsupported.go @@ -0,0 +1,9 @@ +// +build !linux + +package main + +import "github.com/sirupsen/logrus" + +func disableSELinux() { + logrus.Infof("there is no selinux to disable") +}