mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
@ -47,8 +47,7 @@ type rbd struct {
|
||||
}
|
||||
|
||||
var (
|
||||
rbdDriver *rbd
|
||||
version = "1.0.0"
|
||||
version = "1.0.0"
|
||||
)
|
||||
|
||||
func GetRBDDriver() *rbd {
|
||||
|
@ -46,18 +46,6 @@ func init() {
|
||||
hasNBD = checkRbdNbdTools()
|
||||
}
|
||||
|
||||
func getDevFromImageAndPool(pool, image string) (string, bool) {
|
||||
device, found := getRbdDevFromImageAndPool(pool, image)
|
||||
if found {
|
||||
return device, true
|
||||
}
|
||||
device, found = getNbdDevFromImageAndPool(pool, image)
|
||||
if found {
|
||||
return device, true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
// Search /sys/bus for rbd device that matches given pool and image.
|
||||
func getRbdDevFromImageAndPool(pool string, image string) (string, bool) {
|
||||
// /sys/bus/rbd/devices/X/name and /sys/bus/rbd/devices/X/pool
|
||||
|
@ -30,11 +30,7 @@ import (
|
||||
|
||||
const (
|
||||
imageWatcherStr = "watcher="
|
||||
rbdImageFormat1 = "1"
|
||||
rbdImageFormat2 = "2"
|
||||
imageSizeStr = "size "
|
||||
sizeDivStr = " MB in"
|
||||
kubeLockMagic = "kubelet_lock_magic_"
|
||||
// The following three values are used for 30 seconds timeout
|
||||
// while waiting for RBD Watcher to expire.
|
||||
rbdImageWatcherInitDelay = 1 * time.Second
|
||||
|
Reference in New Issue
Block a user