mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
rbd: fix mapOptions passing with rbd-nbd mounter
This was a regression introduced by: https://github.com/ceph/ceph-csi/pull/2556 Fixes: #2610 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
parent
cee6da5313
commit
e6fa392df1
@ -216,23 +216,20 @@ func populateRbdVol(
|
|||||||
rv.RbdImageName = imageAttributes.ImageName
|
rv.RbdImageName = imageAttributes.ImageName
|
||||||
}
|
}
|
||||||
|
|
||||||
krbdSupported := false
|
if req.GetVolumeContext()["mounter"] == rbdDefaultMounter &&
|
||||||
if req.GetVolumeContext()["mounter"] != rbdNbdMounter {
|
!isKrbdFeatureSupported(ctx, req.GetVolumeContext()["imageFeatures"]) {
|
||||||
krbdSupported = isKrbdFeatureSupported(ctx, req.GetVolumeContext()["imageFeatures"])
|
if !parseBoolOption(ctx, req.GetVolumeContext(), tryOtherMounters, false) {
|
||||||
if !krbdSupported && !parseBoolOption(ctx, req.GetVolumeContext(), tryOtherMounters, false) {
|
|
||||||
log.ErrorLog(ctx, "unsupported krbd Feature, set `tryOtherMounters:true` or fix krbd driver")
|
log.ErrorLog(ctx, "unsupported krbd Feature, set `tryOtherMounters:true` or fix krbd driver")
|
||||||
|
|
||||||
return nil, status.Errorf(codes.Internal, "unsupported krbd Feature")
|
return nil, status.Errorf(codes.Internal, "unsupported krbd Feature")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if krbdSupported {
|
|
||||||
rv.MapOptions = req.GetVolumeContext()["mapOptions"]
|
|
||||||
rv.UnmapOptions = req.GetVolumeContext()["unmapOptions"]
|
|
||||||
rv.Mounter = req.GetVolumeContext()["mounter"]
|
|
||||||
} else {
|
|
||||||
// fallback to rbd-nbd,
|
// fallback to rbd-nbd,
|
||||||
// ignore the mapOptions and unmapOptions as they are meant for krbd use.
|
// ignore the mapOptions and unmapOptions as they are meant for krbd use.
|
||||||
rv.Mounter = rbdNbdMounter
|
rv.Mounter = rbdNbdMounter
|
||||||
|
} else {
|
||||||
|
rv.Mounter = req.GetVolumeContext()["mounter"]
|
||||||
|
rv.MapOptions = req.GetVolumeContext()["mapOptions"]
|
||||||
|
rv.UnmapOptions = req.GetVolumeContext()["unmapOptions"]
|
||||||
}
|
}
|
||||||
|
|
||||||
rv.VolID = volID
|
rv.VolID = volID
|
||||||
|
Loading…
Reference in New Issue
Block a user