Merge pull request #2021 from giuseppe/drop-modprobe

drivers: drop modprobe calls
This commit is contained in:
openshift-merge-bot[bot] 2024-07-12 12:15:34 +00:00 committed by GitHub
commit ab74785ce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 15 deletions

View File

@ -30,7 +30,6 @@ import (
"io"
"io/fs"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
@ -183,15 +182,7 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
}
// Return a nil error if the kernel supports aufs
// We cannot modprobe because inside dind modprobe fails
// to run
func supportsAufs() error {
// We can try to modprobe aufs first before looking at
// proc/filesystems for when aufs is supported
if err := exec.Command("modprobe", "aufs").Run(); err != nil {
logrus.Warnf("Execution of `modprobe aufs` ended with error: %v", err)
}
if unshare.IsRootless() {
return ErrAufsNested
}

View File

@ -688,14 +688,8 @@ func SupportsNativeOverlay(home, runhome string) (bool, error) {
}
func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGID int) (supportsDType bool, err error) {
// We can try to modprobe overlay first
selinuxLabelTest := selinux.PrivContainerMountLabel()
if err := exec.Command("modprobe", "overlay").Run(); err != nil {
logrus.Warnf("Execution of `modprobe overlay` ended with error: %v", err)
}
logLevel := logrus.ErrorLevel
if unshare.IsRootless() {
logLevel = logrus.DebugLevel