Fix vsphere util method - disksAreAttached

This commit is contained in:
Chethan Venkatesh 2020-07-04 19:09:30 -07:00
parent 9e70d6f805
commit 5849f1681c

View File

@ -690,7 +690,7 @@ func registerNodeVM(nodeName, workingDir, vmxFilePath string, rpool *object.Reso
} }
// disksAreAttached takes map of node and it's volumes and returns map of node, its volumes and attachment state // disksAreAttached takes map of node and it's volumes and returns map of node, its volumes and attachment state
func disksAreAttached(nodeVolumes map[string][]string) (nodeVolumesAttachMap map[string]map[string]bool, err error) { func disksAreAttached(nodeVolumes map[string][]string) (map[string]map[string]bool, error) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
@ -713,7 +713,7 @@ func disksAreAttached(nodeVolumes map[string][]string) (nodeVolumesAttachMap map
} }
volumeAttachedMap[volume] = attached volumeAttachedMap[volume] = attached
} }
nodeVolumesAttachMap[vm] = volumeAttachedMap disksAttached[vm] = volumeAttachedMap
} }
return disksAttached, nil return disksAttached, nil
} }