cephfs: add netNamespaceFilePath for CephFS

as same host directory is not shared between
the cephfs and the rbd plugin pod. we need
to keep the netNamespaceFilePath separately
for both cephfs and rbd. CephFS plugin will
use this path to execute mount -t commands.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-04-18 12:02:31 +05:30
committed by mergify[bot]
parent eb4bfb7326
commit d2bc9743f7
5 changed files with 100 additions and 1 deletions

View File

@ -46,6 +46,8 @@ type ClusterInfo struct {
Monitors []string `json:"monitors"`
// CephFS contains CephFS specific options
CephFS struct {
// symlink filepath for the network namespace where we need to execute commands.
NetNamespaceFilePath string `json:"netNamespaceFilePath"`
// SubvolumeGroup contains the name of the SubvolumeGroup for CSI volumes
SubvolumeGroup string `json:"subvolumeGroup"`
} `json:"cephFS"`
@ -182,3 +184,13 @@ func GetRBDNetNamespaceFilePath(pathToConfig, clusterID string) (string, error)
return cluster.RBD.NetNamespaceFilePath, nil
}
// GetCephFSNetNamespaceFilePath returns the netNamespaceFilePath for CephFS volumes.
func GetCephFSNetNamespaceFilePath(pathToConfig, clusterID string) (string, error) {
cluster, err := readClusterInfo(pathToConfig, clusterID)
if err != nil {
return "", err
}
return cluster.CephFS.NetNamespaceFilePath, nil
}