(ctx context.Context, serviceInfo *proto.ServiceInfo)
| 215 | } |
| 216 | |
| 217 | func (c *CpApiServer) DeregisterService(ctx context.Context, serviceInfo *proto.ServiceInfo) (*proto.ActionStatus, error) { |
| 218 | if !c.LeaderElectionServer.IsLeader() { |
| 219 | leader := c.LeaderElectionServer.GetLeader() |
| 220 | |
| 221 | if leader != nil { |
| 222 | logrus.Warn("Received DeregisterService call although not the leader. Forwarding the call...") |
| 223 | return leader.DeregisterService(ctx, serviceInfo) |
| 224 | } else { |
| 225 | return &proto.ActionStatus{Success: false}, nil |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | return c.ControlPlane.DeregisterService(ctx, serviceInfo) |
| 230 | } |
| 231 | |
| 232 | func (c *CpApiServer) RegisterDataplane(ctx context.Context, in *proto.DataplaneInfo) (*proto.ActionStatus, error) { |
| 233 | if !c.LeaderElectionServer.IsLeader() { |
nothing calls this directly
no test coverage detected