Skip to content

Commit

Permalink
Populate the agent action result if there is no matching action handl…
Browse files Browse the repository at this point in the history
…ers (#26152)
  • Loading branch information
aleksmaus committed Jun 10, 2021
1 parent 7edb457 commit 472e3a7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ func (h *AppAction) Handle(ctx context.Context, a fleetapi.Action, acker store.F

appState, ok := h.srv.FindByInputType(action.InputType)
if !ok {
return fmt.Errorf("matching app is not found for action input: %s", action.InputType)
// If the matching action is not found ack the action with the error for action result document
action.StartedAt = time.Now().UTC().Format(time.RFC3339Nano)
action.CompletedAt = action.StartedAt
action.Error = fmt.Sprintf("matching app is not found for action input: %s", action.InputType)
return acker.Ack(ctx, action)
}

params, err := action.MarshalMap()
Expand Down

0 comments on commit 472e3a7

Please sign in to comment.