mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-23 21:40:20 +00:00
rbd: enable mapping and unmapping from a network namespace
Make rbdplugin pod work in a non-initial network namespace (i.e. with "hostNetwork: false") by skipping waiting for udev events when mapping and unmapping images. CSI use case is very simple: all that is needed is a device node which is immediately fed to mkfs, so we should be able to tolerate udev not being finished with the device just fine. Fixes: #1323 Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
c2493686b7
commit
04644c1d58
@ -215,7 +215,15 @@ func appendDeviceTypeAndOptions(cmdArgs []string, isNbd bool, userOptions string
|
||||
}
|
||||
|
||||
cmdArgs = append(cmdArgs, "--device-type", accessType)
|
||||
if !isNbd {
|
||||
// Enable mapping and unmapping images from a non-initial network
|
||||
// namespace (e.g. for Multus CNI). The network namespace must be
|
||||
// owned by the initial user namespace.
|
||||
cmdArgs = append(cmdArgs, "--options", "noudev")
|
||||
}
|
||||
if userOptions != "" {
|
||||
// userOptions is appended after, possibly overriding the above
|
||||
// default options.
|
||||
cmdArgs = append(cmdArgs, "--options", userOptions)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user