util: add GetCephFSRadosNamespace method

This commit adds `GetCephFSRadosNamespace` util method that returns
the `RadosNamespace` specified in ceph-csi-config ConfigMap under
cephFS.radosNamespace.

If not specified, the method returns the default RadosNamespace
i.e, csi.

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2024-06-05 11:04:58 +05:30
committed by mergify[bot]
parent 178b642b01
commit c7f41cf84b
5 changed files with 33 additions and 8 deletions

View File

@ -74,7 +74,7 @@ func (cvg *commonVolumeGroup) initCommonVolumeGroup(
return fmt.Errorf("failed to get MONs for cluster id %q: %w", csiID.ClusterID, err)
}
namespace, err := util.GetRadosNamespace(util.CsiConfigFile, csiID.ClusterID)
namespace, err := util.GetRBDRadosNamespace(util.CsiConfigFile, csiID.ClusterID)
if err != nil {
return fmt.Errorf("failed to get RADOS namespace for cluster id %q: %w", csiID.ClusterID, err)
}