mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-30 10:10:21 +00:00
rbd: check nbd tool features only for rbd driver
calling setRbdNbdToolFeatures inside an init
gets called in main.go for both cephfs and rbd
driver. instead of calling it in init function
calling this in rbd driver.go as this is specific
to rbd.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit dffb6e72c2
)
This commit is contained in:
parent
9245b58a9f
commit
3521465e60
@ -153,6 +153,8 @@ func (r *Driver) Run(conf *util.Config) {
|
|||||||
log.FatalLogMsg(err.Error())
|
log.FatalLogMsg(err.Error())
|
||||||
}
|
}
|
||||||
rbd.SetGlobalInt("krbdFeatures", krbdFeatures)
|
rbd.SetGlobalInt("krbdFeatures", krbdFeatures)
|
||||||
|
|
||||||
|
rbd.SetRbdNbdToolFeatures()
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.IsControllerServer {
|
if conf.IsControllerServer {
|
||||||
|
@ -92,10 +92,6 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
setRbdNbdToolFeatures()
|
|
||||||
}
|
|
||||||
|
|
||||||
// rbdDeviceInfo strongly typed JSON spec for rbd device list output (of type krbd).
|
// rbdDeviceInfo strongly typed JSON spec for rbd device list output (of type krbd).
|
||||||
type rbdDeviceInfo struct {
|
type rbdDeviceInfo struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
@ -216,8 +212,9 @@ func waitForPath(ctx context.Context, pool, namespace, image string, maxRetries
|
|||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
// set features available with rbd-nbd, and NBD module loaded status.
|
// SetRbdNbdToolFeatures sets features available with rbd-nbd, and NBD module
|
||||||
func setRbdNbdToolFeatures() {
|
// loaded status.
|
||||||
|
func SetRbdNbdToolFeatures() {
|
||||||
var stderr string
|
var stderr string
|
||||||
// check if the module is loaded or compiled in
|
// check if the module is loaded or compiled in
|
||||||
_, err := os.Stat(fmt.Sprintf("/sys/module/%s", moduleNbd))
|
_, err := os.Stat(fmt.Sprintf("/sys/module/%s", moduleNbd))
|
||||||
|
Loading…
Reference in New Issue
Block a user