From c75a828adf67f908750e663b7164b647183818f7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 15 Jan 2021 16:06:02 +0300 Subject: [PATCH] [#311] control: Fix loss of parent attribute keys in netmap converter Signed-off-by: Leonard Lyubich --- pkg/services/control/server/netmap_snapshot.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/services/control/server/netmap_snapshot.go b/pkg/services/control/server/netmap_snapshot.go index 25f2a8cc..c790f820 100644 --- a/pkg/services/control/server/netmap_snapshot.go +++ b/pkg/services/control/server/netmap_snapshot.go @@ -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) }