[#311] control: Fix loss of parent attribute keys in netmap converter

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2021-01-15 16:06:02 +03:00 committed by Alex Vanin
parent 6c9dab481c
commit c75a828adf
1 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,15 @@ func attributesFromAPI(apiAttrs []*netmapAPI.NodeAttribute) []*control.NodeInfo_
a.SetKey(apiAttr.Key())
a.SetValue(apiAttr.Value())
apiParents := apiAttr.ParentKeys()
parents := make([]string, 0, len(apiParents))
for i := range apiParents {
parents = append(parents, apiParents[i])
}
a.SetParents(parents)
attrs = append(attrs, a)
}