Skip to content

Commit 97a885f

Browse files
committed
moving check inside getCloudMetadata
1 parent eafc72b commit 97a885f

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

x-pack/plugins/infra/server/routes/inventory_metadata/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ export const initInventoryMetaRoute = (libs: InfraBackendLibs) => {
3939
fold(throwErrors(Boom.badRequest), identity)
4040
);
4141

42-
const model = findInventoryModel(nodeType);
43-
44-
// Only run this for AWS modules, eventually we might have more.
45-
if (model.requiredModule !== 'aws') {
46-
return response.ok({
47-
body: {
48-
accounts: [],
49-
projects: [],
50-
regions: [],
51-
},
52-
});
53-
}
54-
5542
const { configuration } = await libs.sources.getSourceConfiguration(
5643
requestContext.core.savedObjects.client,
5744
sourceId

x-pack/plugins/infra/server/routes/inventory_metadata/lib/get_cloud_metadata.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ export const getCloudMetadata = async (
2929
currentTime: number
3030
): Promise<CloudMetaData> => {
3131
const model = findInventoryModel(nodeType);
32+
// Only run this for AWS modules, eventually we might have more.
33+
if (model.requiredModule !== 'aws') {
34+
return {
35+
accounts: [],
36+
projects: [],
37+
regions: [],
38+
};
39+
}
3240

3341
const metricQuery = {
3442
allowNoIndices: true,

0 commit comments

Comments
 (0)