Skip to content

Commit

Permalink
Mark etag as required in AgentConfiguration type
Browse files Browse the repository at this point in the history
  • Loading branch information
gbamparop committed May 16, 2022
1 parent 74bd08c commit 57a3627
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export type AgentConfigurationIntake = t.TypeOf<
export type AgentConfiguration = {
'@timestamp': number;
applied_by_agent?: boolean;
etag?: string;
etag: string;
agent_name?: string;
} & AgentConfigurationIntake;
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export async function findExactConfiguration({
...convertConfigSettingsToString(hit)._source,
applied_by_agent:
hit._source.applied_by_agent ||
(hit._source.etag !== undefined &&
configsAppliedToAgentsThroughFleet.hasOwnProperty(hit._source.etag)),
configsAppliedToAgentsThroughFleet.hasOwnProperty(hit._source.etag),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export async function listConfigurations({ setup }: { setup: Setup }) {
...hit._source,
applied_by_agent:
hit._source.applied_by_agent ||
(hit._source.etag !== undefined &&
configsAppliedToAgentsThroughFleet.hasOwnProperty(hit._source.etag)),
configsAppliedToAgentsThroughFleet.hasOwnProperty(hit._source.etag),
};
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default function agentConfigurationTests({ getService }: FtrProviderConte
service: { name: 'myservice', environment: 'production' },
settings: { transaction_sample_rate: '0.9' },
};
let etag: string | undefined;
let etag: string;

before(async () => {
log.debug('creating agent configuration');
Expand Down

0 comments on commit 57a3627

Please sign in to comment.