mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: provide a way to disable the auto fallback to nbd mounter
This change allows the user to choose not to fallback to NBD mounter when some ImageFeatures are absent with krbd driver, rather just fail the NodeStage call. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
bfc24f6f12
commit
9a3170bf77
@ -68,8 +68,9 @@ const (
|
||||
xfsReflinkNoSupport
|
||||
xfsReflinkSupport
|
||||
|
||||
staticVol = "staticVolume"
|
||||
volHealerCtx = "volumeHealerContext"
|
||||
staticVol = "staticVolume"
|
||||
volHealerCtx = "volumeHealerContext"
|
||||
tryOtherMounters = "tryOtherMounters"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -218,6 +219,11 @@ func populateRbdVol(
|
||||
krbdSupported := false
|
||||
if req.GetVolumeContext()["mounter"] != rbdNbdMounter {
|
||||
krbdSupported = isKrbdFeatureSupported(ctx, req.GetVolumeContext()["imageFeatures"])
|
||||
if !krbdSupported && !parseBoolOption(ctx, req.GetVolumeContext(), tryOtherMounters, false) {
|
||||
log.ErrorLog(ctx, "unsupported krbd Feature, set `tryOtherMounters:true` or fix krbd driver")
|
||||
|
||||
return nil, status.Errorf(codes.Internal, "unsupported krbd Feature")
|
||||
}
|
||||
}
|
||||
if krbdSupported {
|
||||
rv.MapOptions = req.GetVolumeContext()["mapOptions"]
|
||||
|
Reference in New Issue
Block a user