gateway api: return if run is stopping

This commit is contained in:
Simone Gotti 2019-05-15 14:49:46 +02:00
parent bda7a3eb8b
commit e2bee03a06
1 changed files with 10 additions and 7 deletions

View File

@ -54,6 +54,7 @@ type RunResponse struct {
Phase rstypes.RunPhase `json:"phase"`
Result rstypes.RunResult `json:"result"`
SetupErrors []string `json:"setup_errors"`
Stopping bool `json:"stopping"`
Tasks map[string]*RunResponseTask `json:"tasks"`
TasksWaitingApproval []string `json:"tasks_waiting_approval"`
@ -116,13 +117,15 @@ type RunTaskResponseStep struct {
func createRunResponse(r *rstypes.Run, rc *rstypes.RunConfig) *RunResponse {
run := &RunResponse{
ID: r.ID,
Counter: r.Counter,
Name: r.Name,
Annotations: r.Annotations,
Phase: r.Phase,
Result: r.Result,
SetupErrors: rc.SetupErrors,
ID: r.ID,
Counter: r.Counter,
Name: r.Name,
Annotations: r.Annotations,
Phase: r.Phase,
Result: r.Result,
Stopping: r.Stop,
SetupErrors: rc.SetupErrors,
Tasks: make(map[string]*RunResponseTask),
TasksWaitingApproval: r.TasksWaitingApproval(),