Skip to content

[Ingest Manager] Index pattern installation use requested package version#80079

Merged
jonathan-buttner merged 4 commits intoelastic:masterfrom
jonathan-buttner:fix-index-pattern-latest-package
Oct 12, 2020
Merged

[Ingest Manager] Index pattern installation use requested package version#80079
jonathan-buttner merged 4 commits intoelastic:masterfrom
jonathan-buttner:fix-index-pattern-latest-package

Conversation

@jonathan-buttner
Copy link
Copy Markdown
Contributor

@jonathan-buttner jonathan-buttner commented Oct 8, 2020

Summary

This PR addresses this issue: #80022

The index pattern installation process previously requested the latest package version to retrieve the fields for installing the logs-* and metrics-* kibana index patterns. It ignored the requested package version passed into the function. This PR fixes it to use the passed in version if it was specified.

Testing

  1. Start a fresh kibana and elasticsearch
  2. Force install the endpoint package version 0.13.1
curl --location --request POST 'http://elastic:changeme@localhost:5601/api/fleet/epm/packages/endpoint-0.13.1' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'kbn-xsrf: xxx' \
--data-raw '{
    "force": true
}'
  1. Navigate to the index patterns in stack management and search for a term that should not exist in that version of the endpoint package (e.g. caseless fields were added in 0.16.0)

image

@jonathan-buttner jonathan-buttner added release_note:fix v8.0.0 Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 labels Oct 8, 2020
@jonathan-buttner jonathan-buttner requested a review from a team October 8, 2020 20:38
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ingest-management (Feature:EPM)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

// TODO: handle update case when versions are different
if (!foundPkg) {
installedPackages.push({ pkgName, pkgVersion });
const packageToInstall = packageVersionsToFetch.findIndex((pkg) => pkg.pkgName === pkgName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: any reason of not using find here? and mutate packageToInstall. pkgVersion after?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll update 👍

Copy link
Copy Markdown
Contributor

@skh skh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the testing instructions! This works as described. 👍

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jonathan-buttner jonathan-buttner merged commit a89a4b1 into elastic:master Oct 12, 2020
@jonathan-buttner jonathan-buttner deleted the fix-index-pattern-latest-package branch October 12, 2020 15:18
jonathan-buttner added a commit to jonathan-buttner/kibana that referenced this pull request Oct 12, 2020
…sion (elastic#80079)

* Install the requested package version

* Add test for correct package fields

* Addressing feedback
jonathan-buttner added a commit to jonathan-buttner/kibana that referenced this pull request Oct 12, 2020
…sion (elastic#80079)

* Install the requested package version

* Add test for correct package fields

* Addressing feedback
jonathan-buttner added a commit that referenced this pull request Oct 12, 2020
…sion (#80079) (#80179)

* Install the requested package version

* Add test for correct package fields

* Addressing feedback
jonathan-buttner added a commit that referenced this pull request Oct 12, 2020
…sion (#80079) (#80178)

* Install the requested package version

* Add test for correct package fields

* Addressing feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v7.11.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants