Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate the agent action result if there is no matching action handlers #26152

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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