forked from TrueCloudLab/frostfs-node
[#114] Add remove-node IR control command
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
ea10abb42a
commit
90799497d3
10 changed files with 676 additions and 54 deletions
|
@ -41,3 +41,19 @@ func (c *Client) AddPeer(p AddPeerPrm) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ForceRemovePeer marks the given peer as offline via a notary control transaction.
|
||||
func (c *Client) ForceRemovePeer(nodeInfo netmap.NodeInfo) error {
|
||||
if !c.client.WithNotary() {
|
||||
return fmt.Errorf("peer can be forcefully removed only in notary environment")
|
||||
}
|
||||
|
||||
prm := UpdatePeerPrm{}
|
||||
prm.SetKey(nodeInfo.PublicKey())
|
||||
prm.SetControlTX(true)
|
||||
|
||||
if err := c.UpdatePeerState(prm); err != nil {
|
||||
return fmt.Errorf("updating peer state: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue