diff --git a/src/csi/backend/backend.go b/src/csi/backend/backend.go index a870ea30..9fa36b1f 100644 --- a/src/csi/backend/backend.go +++ b/src/csi/backend/backend.go @@ -123,12 +123,20 @@ func newBackend(backendName string, config map[string]interface{}) (*Backend, er } supportedTopologies := make([]map[string]string, 0) - if _, exist = config[SupportedTopologies]; exist { - topologies, ok := config[SupportedTopologies].([]map[string]string) + if topologies, exist := config[SupportedTopologies]; exist { + topologyArray , ok := topologies.([]map[string]interface{}) if !ok { return nil, errors.New("invalid supported topologies configuration") } - supportedTopologies = topologies + for _, topologyMap := range topologyArray { + tempMap := make(map[string]string, 0) + for topologyKey, value := range topologyMap { + if topologyValue, ok := value.(string); ok { + tempMap[topologyKey] = topologyValue + } + } + supportedTopologies = append(supportedTopologies, tempMap) + } } plugin := plugin.GetPlugin(storage)