add rbd-nbd mounter in storage class

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen
2018-09-18 14:09:12 +00:00
parent 6f3625b11e
commit 30a5d9a6e7
3 changed files with 15 additions and 4 deletions

View File

@ -42,6 +42,7 @@ const (
rbdImageWatcherInitDelay = 1 * time.Second
rbdImageWatcherFactor = 1.4
rbdImageWatcherSteps = 10
rbdDefaultMounter = "rbd"
)
type rbdVolume struct {
@ -54,6 +55,7 @@ type rbdVolume struct {
VolSize int64 `json:"volSize"`
AdminId string `json:"adminId"`
UserId string `json:"userId"`
Mounter string `json:"mounter"`
}
type rbdSnapshot struct {
@ -226,6 +228,10 @@ func getRBDVolumeOptions(volOptions map[string]string) (*rbdVolume, error) {
if !ok {
rbdVol.UserId = rbdDefaultUserId
}
rbdVol.Mounter, ok = volOptions["mounter"]
if !ok {
rbdVol.Mounter = rbdDefaultMounter
}
return rbdVol, nil
}