MCPcopy Create free account
hub / github.com/eth-easl/dirigent / DeregisterNode

Method DeregisterNode

api/control_plane_api_server.go:172–185  ·  view source on GitHub ↗
(ctx context.Context, info *proto.NodeInfo)

Source from the content-addressed store, hash-verified

170}
171
172func (c *CpApiServer) DeregisterNode(ctx context.Context, info *proto.NodeInfo) (*proto.ActionStatus, error) {
173 if !c.LeaderElectionServer.IsLeader() {
174 leader := c.LeaderElectionServer.GetLeader()
175
176 if leader != nil {
177 logrus.Warn("Received DeregisterNode call although not the leader. Forwarding the call...")
178 return leader.DeregisterNode(ctx, info)
179 } else {
180 return &proto.ActionStatus{Success: false}, nil
181 }
182 }
183
184 return c.ControlPlane.DeregisterNode(ctx, info)
185}
186
187func (c *CpApiServer) NodeHeartbeat(ctx context.Context, in *proto.NodeHeartbeatMessage) (*proto.ActionStatus, error) {
188 if !c.LeaderElectionServer.IsLeader() {

Callers

nothing calls this directly

Calls 3

GetLeaderMethod · 0.80
DeregisterNodeMethod · 0.65
IsLeaderMethod · 0.45

Tested by

no test coverage detected