Merge pull request #135526 from dims/debug-mounter-issue

Fix mounter issue with latest ubuntu 24.04 (nfs tests)
This commit is contained in:
Kubernetes Prow Robot 2025-12-17 23:27:23 -08:00 committed by GitHub
commit fba3338407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,6 +28,7 @@ const (
// Location of the mount file to use
chrootCmd = "chroot"
mountCmd = "mount"
mountBin = "/bin/mount"
rootfs = "rootfs"
nfsRPCBindErrMsg = "mount.nfs: rpc.statd is not running but is required for remote locking.\nmount.nfs: Either use '-o nolock' to keep locks local, or start statd.\nmount.nfs: an incorrect mount option was specified\n"
rpcBindCmd = "/sbin/rpcbind"
@ -60,12 +61,12 @@ func main() {
}
}
// MountInChroot is to run mount within chroot with the passing root directory
// mountInChroot runs mount within chroot with the passing root directory
func mountInChroot(rootfsPath string, args []string) error {
if _, err := os.Stat(rootfsPath); os.IsNotExist(err) {
return fmt.Errorf("path <%s> does not exist", rootfsPath)
}
args = append([]string{rootfsPath, mountCmd}, args...)
args = append([]string{rootfsPath, mountBin}, args...)
output, err := exec.Command(chrootCmd, args...).CombinedOutput()
if err == nil {
return nil