Skip to content

Commit

Permalink
[Observability Onboarding Integration] breaks installed integrations …
Browse files Browse the repository at this point in the history
…page (elastic#174804)

Fixes elastic#174803

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and juliaElastic committed Jan 16, 2024
1 parent 095e65b commit 9c3107e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x-pack/plugins/fleet/server/services/epm/archive/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export function parseAndVerifyArchive(
topLevelDirOverride?: string
): ArchivePackage {
// The top-level directory must match pkgName-pkgVersion, and no other top-level files or directories may be present
const toplevelDir = topLevelDirOverride || paths[0].split('/')[0];
let toplevelDir = topLevelDirOverride || '';
if (paths.length > 0) {
toplevelDir = topLevelDirOverride || paths[0].split('/')[0];
}

paths.forEach((filePath) => {
if (!filePath.startsWith(toplevelDir)) {
throw new PackageInvalidArchiveError(
Expand Down

0 comments on commit 9c3107e

Please sign in to comment.