Skip to content

Commit

Permalink
only before encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Jul 14, 2020
1 parent 49f5998 commit e5b5019
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/telemetry_collection_manager/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ export class TelemetryCollectionManagerPlugin
return usageData;
}

return encryptTelemetry(usageData, { useProdKey: this.isDistributable });
return encryptTelemetry(usageData.filter(isClusterOptedIn), {
useProdKey: this.isDistributable,
});
}
} catch (err) {
this.logger.debug(
Expand Down Expand Up @@ -240,15 +242,13 @@ export class TelemetryCollectionManagerPlugin
collection.licenseGetter(clustersDetails, statsCollectionConfig, context),
]);

const clustersUsage = stats.map((stat) => {
return stats.map((stat) => {
const license = licenses[stat.cluster_uuid];
return {
...(license ? { license } : {}),
...stat,
collectionSource: collection.title,
};
});

return clustersUsage.filter(isClusterOptedIn);
}
}

0 comments on commit e5b5019

Please sign in to comment.