mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rbd: allow setting mkfsOptions
in the StorageClass
Add `mkfsOptions` to the StorageClass and pass them to the `mkfs` command while creating the filesystem on the RBD device. Fixes: #374 Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
13cdb08e61
commit
a4678200e5
@ -784,6 +784,15 @@ func (ns *NodeServer) mountVolumeToStagePath(
|
||||
if existingFormat == "" && !staticVol && !readOnly {
|
||||
args := mkfsDefaultArgs[fsType]
|
||||
|
||||
// if the VolumeContext contains "mkfsOptions", use those as args instead
|
||||
volumeCtx := req.GetVolumeContext()
|
||||
if volumeCtx != nil {
|
||||
mkfsOptions := volumeCtx["mkfsOptions"]
|
||||
if mkfsOptions != "" {
|
||||
args = strings.Split(mkfsOptions, " ")
|
||||
}
|
||||
}
|
||||
|
||||
// add extra arguments depending on the filesystem
|
||||
mkfs := "mkfs." + fsType
|
||||
switch fsType {
|
||||
|
Reference in New Issue
Block a user