Skip to content

Commit

Permalink
[Security Solution] fix endpoint list agent status logic (#115286)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeypoon authored Oct 19, 2021
1 parent 57ff4a7 commit 730df88
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
} from './support/query_strategies';
import { NotFoundError } from '../../errors';
import { EndpointHostUnEnrolledError } from '../../services/metadata';
import { getAgentStatus } from '../../../../../fleet/common/services/agent_status';

export interface MetadataRequestContext {
esClient?: IScopedClusterClient;
Expand Down Expand Up @@ -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);

return {
metadata,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
host_status: fleetAgentStatusToEndpointHostStatus(agent.last_checkin_status!),
host_status: fleetAgentStatusToEndpointHostStatus(fleetAgentStatus),
policy_info: {
agent: {
applied: {
Expand Down

0 comments on commit 730df88

Please sign in to comment.