(ctx context.Context, empty *emptypb.Empty)
| 140 | } |
| 141 | |
| 142 | func (c *CpApiServer) ListServices(ctx context.Context, empty *emptypb.Empty) (*proto.ServiceList, error) { |
| 143 | if !c.LeaderElectionServer.IsLeader() { |
| 144 | logrus.Warn("Received ListServices call although not the leader. Forwarding the call...") |
| 145 | leader := c.LeaderElectionServer.GetLeader() |
| 146 | |
| 147 | if leader != nil { |
| 148 | return leader.ListServices(ctx, empty) |
| 149 | } else { |
| 150 | return &proto.ServiceList{}, nil |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return c.ControlPlane.ListServices(ctx, empty) |
| 155 | } |
| 156 | |
| 157 | func (c *CpApiServer) RegisterNode(ctx context.Context, info *proto.NodeInfo) (*proto.ActionStatus, error) { |
| 158 | if !c.LeaderElectionServer.IsLeader() { |
nothing calls this directly
no test coverage detected