From 55540b30728c40a9c6e1b6491f176ccb69b2eb79 Mon Sep 17 00:00:00 2001 From: iQQBot Date: Sat, 30 Nov 2024 04:16:07 +0800 Subject: [PATCH] [ws-daemon] mount nfs in workspace network (#20404) --- components/ws-daemon/pkg/iws/iws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ws-daemon/pkg/iws/iws.go b/components/ws-daemon/pkg/iws/iws.go index a2916cb909cff6..a79f568cf415ec 100644 --- a/components/ws-daemon/pkg/iws/iws.go +++ b/components/ws-daemon/pkg/iws/iws.go @@ -766,7 +766,7 @@ func (wbs *InWorkspaceServiceServer) MountNfs(ctx context.Context, req *api.Moun } log.WithField("source", req.Source).WithField("target", req.Target).WithField("staging", nodeStaging).WithField("args", req.Args).Info("Mounting nfs") - cmd := exec.CommandContext(ctx, "mount", "-t", "nfs4", "-o", req.Args, req.Source, nodeStaging) + cmd := exec.CommandContext(ctx, "nsenter", "-n", "-t", strconv.Itoa(int(supervisorPID)), "mount", "-t", "nfs4", "-o", req.Args, req.Source, nodeStaging) cmd.Stderr = os.Stderr cmd.Stdin = os.Stdin