Merge pull request #253 from mrunalp/fix_selinux_shm

Remove unnecessary check for mount label for /dev/shm
This commit is contained in:
Antonio Murdaca 2016-12-10 14:18:07 +01:00 committed by GitHub
commit a27a41431e

View file

@ -338,11 +338,8 @@ func setupShm(podSandboxDir, mountLabel string) (shmPath string, err error) {
return "", err
}
shmOptions := "mode=1777,size=" + strconv.Itoa(defaultShmSize)
if mountLabel != "" {
shmOptions = label.FormatMountLabel(shmOptions, mountLabel)
}
if err = syscall.Mount("shm", shmPath, "tmpfs", uintptr(syscall.MS_NOEXEC|syscall.MS_NOSUID|syscall.MS_NODEV), shmOptions); err != nil {
if err = syscall.Mount("shm", shmPath, "tmpfs", uintptr(syscall.MS_NOEXEC|syscall.MS_NOSUID|syscall.MS_NODEV),
label.FormatMountLabel(shmOptions, mountLabel)); err != nil {
return "", fmt.Errorf("failed to mount shm tmpfs for pod: %v", err)
}
return shmPath, nil