(ctx context.Context, serviceInfo *proto.ServiceInfo)
| 200 | } |
| 201 | |
| 202 | func (c *CpApiServer) RegisterService(ctx context.Context, serviceInfo *proto.ServiceInfo) (*proto.ActionStatus, error) { |
| 203 | if !c.LeaderElectionServer.IsLeader() { |
| 204 | leader := c.LeaderElectionServer.GetLeader() |
| 205 | |
| 206 | if leader != nil { |
| 207 | logrus.Warn("Received RegisterService call although not the leader. Forwarding the call...") |
| 208 | return leader.RegisterService(ctx, serviceInfo) |
| 209 | } else { |
| 210 | return &proto.ActionStatus{Success: false}, nil |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | return c.ControlPlane.RegisterService(ctx, serviceInfo) |
| 215 | } |
| 216 | |
| 217 | func (c *CpApiServer) DeregisterService(ctx context.Context, serviceInfo *proto.ServiceInfo) (*proto.ActionStatus, error) { |
| 218 | if !c.LeaderElectionServer.IsLeader() { |
nothing calls this directly
no test coverage detected