volumes: simplify append-to-slice code
This commit is contained in:
@@ -557,10 +557,7 @@ func (asw *actualStateOfWorld) GetAttachedVolumesPerNode() map[types.NodeName][]
|
|||||||
attachedVolumesPerNode := make(map[types.NodeName][]operationexecutor.AttachedVolume)
|
attachedVolumesPerNode := make(map[types.NodeName][]operationexecutor.AttachedVolume)
|
||||||
for _, volumeObj := range asw.attachedVolumes {
|
for _, volumeObj := range asw.attachedVolumes {
|
||||||
for nodeName, nodeObj := range volumeObj.nodesAttachedTo {
|
for nodeName, nodeObj := range volumeObj.nodesAttachedTo {
|
||||||
volumes, exists := attachedVolumesPerNode[nodeName]
|
volumes := attachedVolumesPerNode[nodeName]
|
||||||
if !exists {
|
|
||||||
volumes = []operationexecutor.AttachedVolume{}
|
|
||||||
}
|
|
||||||
volumes = append(volumes, getAttachedVolume(&volumeObj, &nodeObj).AttachedVolume)
|
volumes = append(volumes, getAttachedVolume(&volumeObj, &nodeObj).AttachedVolume)
|
||||||
attachedVolumesPerNode[nodeName] = volumes
|
attachedVolumesPerNode[nodeName] = volumes
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user