Skip to content

Commit

Permalink
not using os details in id, changes on os updates
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Jul 30, 2020
1 parent 537aa12 commit 5577ce4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const MockOSName = 'somePlatformName';
export const MockOSVersion = '1';
/** Mock OS Full Name for endpoint telemetry */
export const MockOSFullName = 'somePlatformFullName';
/** Mock OS Full Name for endpoint telemetry */
export const MockOSKernel = 'popcorn';

/**
*
Expand Down Expand Up @@ -68,7 +66,6 @@ export const mockFleetObjectsResponse = (
version: MockOSVersion,
name: MockOSName,
full: MockOSFullName,
kernel: MockOSKernel,
},
},
packages: [FLEET_ENDPOINT_PACKAGE_CONSTANT, 'system'],
Expand Down Expand Up @@ -106,7 +103,6 @@ export const mockFleetObjectsResponse = (
version: MockOSVersion,
name: MockOSName,
full: MockOSFullName,
kernel: hasDuplicates ? MockOSKernel : 'unpopped-popocorn',
},
},
packages: [FLEET_ENDPOINT_PACKAGE_CONSTANT, 'system'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export interface AgentLocalMetadata extends AgentMetadata {
os: {
name: string;
platform: string;
kernel: string;
version: string;
full: string;
};
Expand Down Expand Up @@ -229,9 +228,9 @@ export const getEndpointTelemetryFromFleet = async (
const { host, os, elastic } = localMetadata as AgentLocalMetadata;

// Although not perfect, the goal is to dedupe hosts to get the most recent data for a host
// An agent re-installed on the same host will have all the same id, name, and kernel details
// A cloned VM will have the same id, but "may" have the same name and kernel, but it's really up to the user.
const compoundUniqueId = `${host?.id}-${host?.hostname}-${os?.kernel}`;
// An agent re-installed on the same host will have the same id and hostname
// A cloned VM will have the same id, but "may" have the same hostname, but it's really up to the user.
const compoundUniqueId = `${host?.id}-${host?.hostname}`;
if (!uniqueHosts.has(compoundUniqueId)) {
uniqueHosts.add(compoundUniqueId);
const agentId = elastic?.agent?.id;
Expand Down

0 comments on commit 5577ce4

Please sign in to comment.