mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
nfs: add support for secTypes
parameter in StorageClass
CephNFS can enable different security flavours for exported volumes. This can be configured in the optional `secTypes` parameter in the StorageClass. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3d6cdce353
commit
8265abc2c9
@ -131,6 +131,7 @@ func (nv *NFSVolume) CreateExport(backend *csi.Volume) error {
|
||||
fs := backend.VolumeContext["fsName"]
|
||||
nfsCluster := backend.VolumeContext["nfsCluster"]
|
||||
path := backend.VolumeContext["subvolumePath"]
|
||||
secTypes := backend.VolumeContext["secTypes"]
|
||||
|
||||
err := nv.setNFSCluster(nfsCluster)
|
||||
if err != nil {
|
||||
@ -142,12 +143,21 @@ func (nv *NFSVolume) CreateExport(backend *csi.Volume) error {
|
||||
return fmt.Errorf("failed to get NFSAdmin: %w", err)
|
||||
}
|
||||
|
||||
_, err = nfsa.CreateCephFSExport(nfs.CephFSExportSpec{
|
||||
export := nfs.CephFSExportSpec{
|
||||
FileSystemName: fs,
|
||||
ClusterID: nfsCluster,
|
||||
PseudoPath: nv.GetExportPath(),
|
||||
Path: path,
|
||||
})
|
||||
}
|
||||
|
||||
if secTypes != "" {
|
||||
export.SecType = []nfs.SecType{}
|
||||
for _, secType := range strings.Split(secTypes, ",") {
|
||||
export.SecType = append(export.SecType, nfs.SecType(secType))
|
||||
}
|
||||
}
|
||||
|
||||
_, err = nfsa.CreateCephFSExport(export)
|
||||
switch {
|
||||
case err == nil:
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user