mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-03 11:40:24 +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>
(cherry picked from commit 04644c1d58
)
This commit is contained in:
parent
ca59d53a60
commit
64f3361ff4
@ -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