mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
deploy: support for read affinity options per cluster
Implemented the capability to include read affinity options for individual clusters within the ceph-csi-config ConfigMap. This allows users to configure the crush location for each cluster separately. The read affinity options specified in the ConfigMap will supersede those provided via command line arguments. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -295,7 +295,7 @@ func parseMapOptions(mapOptions string) (string, string, error) {
|
||||
|
||||
// getMapOptions is a wrapper func, calls parse map/unmap funcs and feeds the
|
||||
// rbdVolume object.
|
||||
func getMapOptions(req *csi.NodeStageVolumeRequest, rv *rbdVolume) error {
|
||||
func (ns *NodeServer) getMapOptions(req *csi.NodeStageVolumeRequest, rv *rbdVolume) error {
|
||||
krbdMapOptions, nbdMapOptions, err := parseMapOptions(req.GetVolumeContext()["mapOptions"])
|
||||
if err != nil {
|
||||
return err
|
||||
@ -312,6 +312,14 @@ func getMapOptions(req *csi.NodeStageVolumeRequest, rv *rbdVolume) error {
|
||||
rv.UnmapOptions = nbdUnmapOptions
|
||||
}
|
||||
|
||||
readAffinityMapOptions, err := util.GetReadAffinityMapOptions(
|
||||
rv.ClusterID, ns.CLIReadAffinityMapOptions, ns.NodeLabels,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rv.appendReadAffinityMapOptions(readAffinityMapOptions)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user