From bfe64d4aee5eec0236d3a67e0c8da736c40c1185 Mon Sep 17 00:00:00 2001 From: YingshuoTao Date: Wed, 2 Jun 2021 19:14:58 +0800 Subject: [PATCH] cephfs: pass extra volume attributes to static PV when using pre-provisioned volumes, pass these parameters: - kernelMountOptions - fuseMountOptions - subVolumeGroup in spec.csi.volumeAttributes in PV declaration Signed-off-by: YingshuoTao --- internal/cephfs/volumeoptions.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/cephfs/volumeoptions.go b/internal/cephfs/volumeoptions.go index f0eea2284..846a8d51a 100644 --- a/internal/cephfs/volumeoptions.go +++ b/internal/cephfs/volumeoptions.go @@ -455,6 +455,18 @@ func newVolumeOptionsFromStaticVolume(volID string, options map[string]string) ( return nil, nil, err } + if err = extractOptionalOption(&opts.KernelMountOptions, "kernelMountOptions", options); err != nil { + return nil, nil, err + } + + if err = extractOptionalOption(&opts.FuseMountOptions, "fuseMountOptions", options); err != nil { + return nil, nil, err + } + + if err = extractOptionalOption(&opts.SubvolumeGroup, "subvolumeGroup", options); err != nil { + return nil, nil, err + } + if err = extractMounter(&opts.Mounter, options); err != nil { return nil, nil, err }