Merge pull request #1383 from vbatts/platform-002
lib: abstract out selinux call
This commit is contained in:
commit
b212244889
3 changed files with 17 additions and 2 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/opencontainers/selinux/go-selinux"
|
||||
)
|
||||
|
||||
// Default paths if none are specified
|
||||
|
@ -284,7 +283,7 @@ func DefaultConfig() *Config {
|
|||
ConmonEnv: []string{
|
||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
},
|
||||
SELinux: selinux.GetEnabled(),
|
||||
SELinux: selinuxEnabled(),
|
||||
SeccompProfile: seccompProfilePath,
|
||||
ApparmorProfile: apparmorProfileName,
|
||||
CgroupManager: cgroupManager,
|
||||
|
|
9
lib/config_linux.go
Normal file
9
lib/config_linux.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
// +build linux
|
||||
|
||||
package lib
|
||||
|
||||
import selinux "github.com/opencontainers/selinux/go-selinux"
|
||||
|
||||
func selinuxEnabled() bool {
|
||||
return selinux.GetEnabled()
|
||||
}
|
7
lib/config_unsupported.go
Normal file
7
lib/config_unsupported.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
// +build !linux
|
||||
|
||||
package lib
|
||||
|
||||
func selinuxEnabled() bool {
|
||||
return false
|
||||
}
|
Loading…
Reference in a new issue