(ctx context.Context, info *proto.NodeInfo)
| 170 | } |
| 171 | |
| 172 | func (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 | |
| 187 | func (c *CpApiServer) NodeHeartbeat(ctx context.Context, in *proto.NodeHeartbeatMessage) (*proto.ActionStatus, error) { |
| 188 | if !c.LeaderElectionServer.IsLeader() { |
nothing calls this directly
no test coverage detected