Skip to content

Commit

Permalink
[Fleet] Fix package archive bug + reenable Endpoint tests (elastic#14…
Browse files Browse the repository at this point in the history
…3120)

* Reenable endpoint tests to debug in CI

* Revert removal of skip in trusted apps

* Try enabling Fleet debug logs

* Fix missing archive path in bundled packages

* Remove Fleet debug logs in endpoint tests

* Reenable endpoint suites

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit d9d10f2)
  • Loading branch information
kpollich committed Oct 14, 2022
1 parent 42bc2eb commit 14f1067
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion x-pack/plugins/fleet/server/services/epm/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export async function getInfo(name: string, version: string) {
// input type packages must get their pkg info from the archive
if (packageInfo.type === 'integration') setPackageInfo({ name, version, packageInfo });
}

return packageInfo as RegistryPackage;
});
}
Expand Down Expand Up @@ -325,9 +326,17 @@ export async function fetchArchiveBuffer({
verificationResult?: PackageVerificationResult;
}> {
const logger = appContextService.getLogger();
const { download: archivePath } = await getInfo(pkgName, pkgVersion);
let { download: archivePath } = await getInfo(pkgName, pkgVersion);

// Bundled packages don't have a download path when they're installed, as they're
// ArchivePackage objects - so we fake the download path here instead
if (!archivePath) {
archivePath = `/epr/${pkgName}/${pkgName}-${pkgVersion}.zip`;
}

const archiveUrl = `${getRegistryUrl()}${archivePath}`;
const archiveBuffer = await getResponseStream(archiveUrl).then(streamToBuffer);

if (shouldVerify) {
const verificationResult = await verifyPackageArchiveSignature({
pkgName,
Expand Down

0 comments on commit 14f1067

Please sign in to comment.