From 08ad2b97e4d0177cdb75e34b2d26a529a546d8df Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Fri, 21 Feb 2020 10:37:12 +0100 Subject: [PATCH] csi: Add /dev mounts to CSI Plugins CSI Plugins that manage devices need not just access to the CSI directory, but also to manage devices inside `/dev`. This commit introduces a `/dev:/dev` mount to the container so that they may do so. --- client/allocrunner/taskrunner/plugin_supervisor_hook.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/allocrunner/taskrunner/plugin_supervisor_hook.go b/client/allocrunner/taskrunner/plugin_supervisor_hook.go index e66cb95e4..dde88586f 100644 --- a/client/allocrunner/taskrunner/plugin_supervisor_hook.go +++ b/client/allocrunner/taskrunner/plugin_supervisor_hook.go @@ -113,8 +113,15 @@ func (h *csiPluginSupervisorHook) Prestart(ctx context.Context, Readonly: false, PropagationMode: "bidirectional", } + devMount := &drivers.MountConfig{ + TaskPath: "/dev", + HostPath: "/dev", + Readonly: false, + } mounts := ensureMountpointInserted(h.runner.hookResources.getMounts(), configMount) + mounts = ensureMountpointInserted(mounts, devMount) + h.runner.hookResources.setMounts(mounts) resp.Done = true