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

[Fleet] Add validation to package policy input variables #136945

Closed
Tracked by #123150
juliaElastic opened this issue Jul 22, 2022 · 2 comments
Closed
Tracked by #123150

[Fleet] Add validation to package policy input variables #136945

juliaElastic opened this issue Jul 22, 2022 · 2 comments
Assignees
Labels
enhancement New value added to drive a business result Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@juliaElastic
Copy link
Contributor

juliaElastic commented Jul 22, 2022

We had some occurrences when it was hard to debug what is wrong with the package policy create request.
Input variables have a type, and Fleet could do a validation that the value is valid for that type.
For example, integer type variable should have a valid integer value.

This would help debugging when the package policy creation fails on an invalid value.
E.g. trying to create a package policy with an input var max_agents of type integer would give a meaningful error when trying to use value 12,000

@botelastic botelastic bot added the needs-team Issues missing a team label label Jul 22, 2022
@juliaElastic juliaElastic added the Team:Fleet Team label for Observability Data Collection Fleet team label Jul 22, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jul 22, 2022
@juliaElastic juliaElastic added enhancement New value added to drive a business result needs-team Issues missing a team label labels Jul 22, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jul 22, 2022
@juliaElastic juliaElastic changed the title Add validation to package policy input variables [Fleet] Add validation to package policy input variables Jul 22, 2022
@nchaulet nchaulet self-assigned this Aug 25, 2022
@nchaulet
Copy link
Member

Resolved by #135257

Trying to add an invalid Fleet server policy with max_agent: notanumber result in

{"statusCode":400,"error":"Bad Request","message":"Package policy is invalid: inputs.fleet-server.vars.max_agents: Invalid integer"}%     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

No branches or pull requests

3 participants