mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
util: exclude empty label values for crushlocation map
This commit resolves a bug where node labels with empty values are processed for the crush_location mount option, leading to invalid mount options and subsequent mount failures. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -48,6 +48,10 @@ func getCrushLocationMap(crushLocationLabels string, nodeLabels map[string]strin
|
||||
// Determine values for requested labels from node labels
|
||||
crushLocationMap := make(map[string]string, len(labelsIn))
|
||||
for key, value := range nodeLabels {
|
||||
// label with empty value is not considered.
|
||||
if value == "" {
|
||||
continue
|
||||
}
|
||||
if _, ok := labelsIn[key]; !ok {
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user