(ctx context.Context, metric *proto.AutoscalingMetric)
| 125 | } |
| 126 | |
| 127 | func (c *CpApiServer) OnMetricsReceive(ctx context.Context, metric *proto.AutoscalingMetric) (*proto.ActionStatus, error) { |
| 128 | if !c.LeaderElectionServer.IsLeader() { |
| 129 | leader := c.LeaderElectionServer.GetLeader() |
| 130 | |
| 131 | if leader != nil { |
| 132 | logrus.Warn("Received OnMetricsReceive call although not the leader. Forwarding the call...") |
| 133 | return leader.OnMetricsReceive(ctx, metric) |
| 134 | } else { |
| 135 | return &proto.ActionStatus{Success: false}, nil |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | return c.ControlPlane.OnMetricsReceive(ctx, metric) |
| 140 | } |
| 141 | |
| 142 | func (c *CpApiServer) ListServices(ctx context.Context, empty *emptypb.Empty) (*proto.ServiceList, error) { |
| 143 | if !c.LeaderElectionServer.IsLeader() { |
nothing calls this directly
no test coverage detected