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.
This commit is contained in:
Danielle Lancashire
2020-02-21 10:37:12 +01:00
committed by Tim Gross
parent 27e29a30bb
commit 08ad2b97e4

View File

@@ -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