Skip to content

[8.6] [Fleet] Add check for legacy managed_by field in datastream mappings (#149504)#149583

Merged
criamico merged 1 commit intoelastic:8.6from
criamico:backport/8.6/pr-149504
Jan 26, 2023
Merged

[8.6] [Fleet] Add check for legacy managed_by field in datastream mappings (#149504)#149583
criamico merged 1 commit intoelastic:8.6from
criamico:backport/8.6/pr-149504

Conversation

@criamico
Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 8.6:

Questions ?

Please refer to the Backport tool documentation

…lastic#149504)

## Summary

Closes elastic#147605

### Description
Clusters that exist since pre-8.0 might have data streams that have
`managed_by: ingest_manager` in their` _meta` properties, instead of the
current value `managed_by: fleet`.
However, with the merge of
elastic#143300, the data streams view
filters out any data streams that don't have `managed_by: fleet`
metadata, so when updating from 7.x to 8.6.x no data streams are
returned.

### Solution
It was decided to simply add an additional check in the data stream
handler to allow for "legacy" metadata, and to avoid doing migrations
that can be dangerous for the users data.

### Testing
I'm looking for a way to reliably test this locally - I've only managed
to reproduce it on cloud

(cherry picked from commit 49ff27e)

# Conflicts:
#	x-pack/plugins/fleet/server/routes/data_streams/handlers.ts
@criamico criamico added the backport This PR is a backport of another PR label Jan 26, 2023
@criamico criamico enabled auto-merge (squash) January 26, 2023 11:29
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 108 113 +5
securitySolution 441 447 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 69 75 +6
osquery 109 115 +6
securitySolution 518 524 +6
total +20

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

@criamico criamico merged commit e4c7353 into elastic:8.6 Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants