-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] fix endpoint list agent status logic #115286
Conversation
Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🐑
@joeypoon you can get rid of most of the non null assertions if you implement some predicate type guards (https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) If you are sure these objects will contain the information you need, you can for instance filter out the array with a predicate and then remove the null assertion. |
@@ -522,10 +523,11 @@ async function queryUnitedIndex( | |||
const agentPolicy = agentPoliciesMap[agent.policy_id!]; | |||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | |||
const endpointPolicy = endpointPoliciesMap[agent.policy_id!]; | |||
const fleetAgentStatus = getAgentStatus(agent as Agent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not part of this change, but if you add a type guard to doc
and to agent
you can remove all these null assertion.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Summary
Update endpoint list host status logic when hitting new united index.
For maintainers