forked from TrueCloudLab/frostfs-node
[#603] cmd/node: Parse node attributes when node info is constructed
Remove no longer needed `cfgNodeInfo.attributes` field. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
4859bb2e1c
commit
5a4c3dfddf
2 changed files with 1 additions and 5 deletions
|
@ -167,7 +167,6 @@ type BootstrapType uint32
|
||||||
|
|
||||||
type cfgNodeInfo struct {
|
type cfgNodeInfo struct {
|
||||||
// values from config
|
// values from config
|
||||||
attributes []*netmap.NodeAttribute
|
|
||||||
|
|
||||||
// values at runtime
|
// values at runtime
|
||||||
infoMtx sync.RWMutex
|
infoMtx sync.RWMutex
|
||||||
|
@ -294,9 +293,6 @@ func initCfg(path string) *cfg {
|
||||||
reBootstrapEnabled: !relayOnly,
|
reBootstrapEnabled: !relayOnly,
|
||||||
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
|
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
|
||||||
},
|
},
|
||||||
cfgNodeInfo: cfgNodeInfo{
|
|
||||||
attributes: parseAttributes(appCfg),
|
|
||||||
},
|
|
||||||
cfgGRPC: cfgGRPC{
|
cfgGRPC: cfgGRPC{
|
||||||
maxChunkSize: maxChunkSize,
|
maxChunkSize: maxChunkSize,
|
||||||
maxAddrAmount: maxAddrAmount,
|
maxAddrAmount: maxAddrAmount,
|
||||||
|
|
|
@ -40,7 +40,7 @@ func initNetmapService(c *cfg) {
|
||||||
peerInfo := new(netmapSDK.NodeInfo)
|
peerInfo := new(netmapSDK.NodeInfo)
|
||||||
peerInfo.SetAddress(c.localAddr.String())
|
peerInfo.SetAddress(c.localAddr.String())
|
||||||
peerInfo.SetPublicKey(crypto.MarshalPublicKey(&c.key.PublicKey))
|
peerInfo.SetPublicKey(crypto.MarshalPublicKey(&c.key.PublicKey))
|
||||||
peerInfo.SetAttributes(c.cfgNodeInfo.attributes...)
|
peerInfo.SetAttributes(parseAttributes(c.appCfg)...)
|
||||||
peerInfo.SetState(netmapSDK.NodeStateOffline)
|
peerInfo.SetState(netmapSDK.NodeStateOffline)
|
||||||
|
|
||||||
c.handleLocalNodeInfo(peerInfo)
|
c.handleLocalNodeInfo(peerInfo)
|
||||||
|
|
Loading…
Reference in a new issue