Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jul 6, 2020
1 parent 18a72f3 commit b4e522f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { HttpFetchQuery } from 'src/core/public';

export interface ListWithKuery {
page?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ export async function getLimitedPackages(options: {
(pkg) => (pkg.status = InstallationStatus.installed)
);
const installedPackagesInfo = await Promise.all(
installedPackages.map(async (pkgInstall) => {
installedPackages.map((pkgInstall) => {
return getPackageInfo({
savedObjectsClient,
pkgName: pkgInstall.name,
pkgVersion: pkgInstall.version,
});
})
);
return installedPackagesInfo
.filter((pkgInfo) => isPackageLimited(pkgInfo))
.map((pkgInfo) => pkgInfo.name);
return installedPackagesInfo.filter((pkgInfo) => isPackageLimited).map((pkgInfo) => pkgInfo.name);
}

export async function getPackageSavedObjects(savedObjectsClient: SavedObjectsClientContract) {
Expand Down
22 changes: 12 additions & 10 deletions x-pack/plugins/ingest_manager/server/services/package_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ class PackageConfigService {
): Promise<PackageConfig> {
// Make sure the associated package is installed
if (packageConfig.package?.name) {
await ensureInstalledPackage({
savedObjectsClient: soClient,
pkgName: packageConfig.package.name,
callCluster,
});
const pkgInfo = await getPackageInfo({
savedObjectsClient: soClient,
pkgName: packageConfig.package.name,
pkgVersion: packageConfig.package.version,
});
const [, pkgInfo] = await Promise.all([
ensureInstalledPackage({
savedObjectsClient: soClient,
pkgName: packageConfig.package.name,
callCluster,
}),
getPackageInfo({
savedObjectsClient: soClient,
pkgName: packageConfig.package.name,
pkgVersion: packageConfig.package.version,
}),
]);

// Check if it is a limited package, and if so, check that the corresponding agent config does not
// already contain a package config for this package
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/ingest_manager_api_integration/apis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ({ loadTestFile }) {

// EPM
loadTestFile(require.resolve('./epm/list'));
loadTestFile(require.resolve('./epm/list'));
loadTestFile(require.resolve('./epm/file'));
//loadTestFile(require.resolve('./epm/template'));
loadTestFile(require.resolve('./epm/ilm'));

Expand Down

0 comments on commit b4e522f

Please sign in to comment.