Refactor pkg/util/selinux

This commit is contained in:
Paul Morie
2016-10-25 11:51:11 -04:00
parent ea423110cc
commit 7fb99442a6
9 changed files with 56 additions and 43 deletions

View File

@@ -18,14 +18,16 @@ limitations under the License.
package selinux
type realSelinuxContextRunner struct{}
func (_ *realSelinuxContextRunner) SetContext(dir, context string) error {
// NOP
return nil
// SELinuxEnabled always returns false on non-linux platforms.
func SELinuxEnabled() bool {
return false
}
func (_ *realSelinuxContextRunner) Getfilecon(path string) (string, error) {
// NOP
// realSELinuxRunner is the NOP implementation of the SELinuxRunner interface.
type realSELinuxRunner struct{}
var _ SELinuxRunner = &realSELinuxRunner{}
func (_ *realSELinuxRunner) Getfilecon(path string) (string, error) {
return "", nil
}