From 5a4c3dfddf655dc82d4ee45a1204895f448d72af Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 11 Jun 2021 11:43:05 +0300 Subject: [PATCH] [#603] cmd/node: Parse node attributes when node info is constructed Remove no longer needed `cfgNodeInfo.attributes` field. Signed-off-by: Leonard Lyubich --- cmd/neofs-node/config.go | 4 ---- cmd/neofs-node/netmap.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index c53c9b16..b1053545 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -167,7 +167,6 @@ type BootstrapType uint32 type cfgNodeInfo struct { // values from config - attributes []*netmap.NodeAttribute // values at runtime infoMtx sync.RWMutex @@ -294,9 +293,6 @@ func initCfg(path string) *cfg { reBootstrapEnabled: !relayOnly, reBoostrapTurnedOff: atomic.NewBool(relayOnly), }, - cfgNodeInfo: cfgNodeInfo{ - attributes: parseAttributes(appCfg), - }, cfgGRPC: cfgGRPC{ maxChunkSize: maxChunkSize, maxAddrAmount: maxAddrAmount, diff --git a/cmd/neofs-node/netmap.go b/cmd/neofs-node/netmap.go index 249e6f18..35da5487 100644 --- a/cmd/neofs-node/netmap.go +++ b/cmd/neofs-node/netmap.go @@ -40,7 +40,7 @@ func initNetmapService(c *cfg) { peerInfo := new(netmapSDK.NodeInfo) peerInfo.SetAddress(c.localAddr.String()) peerInfo.SetPublicKey(crypto.MarshalPublicKey(&c.key.PublicKey)) - peerInfo.SetAttributes(c.cfgNodeInfo.attributes...) + peerInfo.SetAttributes(parseAttributes(c.appCfg)...) peerInfo.SetState(netmapSDK.NodeStateOffline) c.handleLocalNodeInfo(peerInfo)