Added endpoint for workflows created by Crons to ping, when they start.

This commit is contained in:
Aleksandr Melnikov
2020-04-21 16:58:13 -07:00
parent 4e524318bc
commit 5128135be7
5 changed files with 546 additions and 200 deletions

View File

@@ -94,6 +94,15 @@ func (s *WorkflowServer) AddWorkflowExecutionStatistics(ctx context.Context, req
return &empty.Empty{}, nil
}
func (s *WorkflowServer) CronStartWorkflowExecutionStatistic(ctx context.Context, request *api.CronStartWorkflowExecutionStatisticRequest) (*empty.Empty, error) {
client := ctx.Value("kubeClient").(*v1.Client)
err := client.CronStartWorkflowExecutionStatisticInsert(request.Namespace, request.Uid, request.WorkflowTemplateId)
if err != nil {
return &empty.Empty{}, err
}
return &empty.Empty{}, nil
}
func (s *WorkflowServer) GetWorkflowExecution(ctx context.Context, req *api.GetWorkflowExecutionRequest) (*api.WorkflowExecution, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "argoproj.io", "workflows", req.Name)