From 965dffc55228c276b58e20b290523eb071ba2144 Mon Sep 17 00:00:00 2001 From: AmitRoushan Date: Wed, 25 Aug 2021 07:22:01 +0530 Subject: [PATCH] bug fix --- src/csi/backend/backend.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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)