Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Fix concurent package policies create #178993

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/server/services/epm/packages/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ description: Elasticsearch description`,
name: 'elasticsearch',
version: '0.0.1',
install_source: 'upload',
install_status: 'installed',
package_assets: [],
data_utf8: `
name: elasticsearch
Expand Down Expand Up @@ -360,6 +361,7 @@ test: invalid manifest`,
name: 'invalidpackage',
version: '0.0.1',
install_source: 'upload',
install_status: 'installed',
package_assets: [],
data_utf8: `
name: invalidpackage
Expand Down Expand Up @@ -414,6 +416,7 @@ test: invalid manifest
version: '0.0.1',
install_source: 'upload',
install_version: '0.0.1',
install_status: 'installed',
},
score: 0,
type: PACKAGES_SAVED_OBJECT_TYPE,
Expand Down Expand Up @@ -442,6 +445,7 @@ description: Elasticsearch description`,
attributes: {
name: 'elasticsearch',
version: '0.0.1',
install_status: 'installed',
install_source: 'upload',
package_assets: [],
data_utf8: `
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/fleet/server/services/epm/packages/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ export async function getPackageFromSource(options: {
let res: GetPackageResponse;

// If the package is installed
if (installedPkg && installedPkg.version === pkgVersion) {
if (
installedPkg &&
installedPkg.install_status === 'installed' &&
installedPkg.version === pkgVersion
) {
const { install_source: pkgInstallSource } = installedPkg;
if (!res && installedPkg.package_assets) {
res = await getEsPackage(
Expand Down
Loading