-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Preserve originId when overwriting existing objects #135358
Preserve originId when overwriting existing objects #135358
Conversation
If an existing object is being overwritten (via create/bulkCreate), Kibana now preserves its originId field if it has one. This behavior can be overridden by specifying `originId: undefined`. I also added validation to ensure that originId is only set for multi-namespace object types (it would basically have no effect for single-namespace object types, but we shouldn't allow it).
b991228
to
ba4ca89
Compare
Pinging @elastic/kibana-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why FTR configs are failing but changes LGTM as a partial fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for jumping on this so quickly ❤️
This PR adds validation to prevent consumers from setting the The importSavedObjects module gives consumers the option to create new copies of objects with random IDs, and that blindly sets |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
(cherry picked from commit ff57626)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
(cherry picked from commit ff57626) Co-authored-by: Joe Portner <[email protected]>
@geekpete I think this is relevant to the work your doing. |
Related to #135346 (partially resolves this issue).
Overview
If an existing object is being overwritten (via create/bulkCreate), Kibana now preserves its originId field if it has one. This behavior can be overridden by specifying
originId: undefined
.I also added validation to ensure that originId is only set for multi-namespace object types (it would basically have no effect for single-namespace object types, but we shouldn't allow it).
Testing
originId
fieldAdditional info
This does not attempt to "repair" any saved objects that have had their
originId
field cleared out, it can be done in a separate PR, see the linked issue for more details.