Skip to content

Commit 6da6fbf

Browse files
committed
Populate the agent action result if there is no matching action handlers
1 parent dc57628 commit 6da6fbf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers/handler_action_application.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ func (h *AppAction) Handle(ctx context.Context, a fleetapi.Action, acker store.F
4141

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

4751
params, err := action.MarshalMap()

0 commit comments

Comments
 (0)