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

Make sample data work with share-capable objects #114693

Closed
jportner opened this issue Oct 12, 2021 · 2 comments
Closed

Make sample data work with share-capable objects #114693

jportner opened this issue Oct 12, 2021 · 2 comments
Assignees
Labels
chore impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@jportner
Copy link
Contributor

As described in #100489, in the 8.0 release we are converting lots of saved object types to become "share-capable". One side effect of this is that newly created objects must have globally unique IDs (across all spaces).

It turns out that sample data object IDs are hardcoded, and these are created using bulkCreate. Which means that if you add sample data that contains share-capable objects in one space, then you try to add it in the second space, you'll run into a 409 unresolvable conflict error.

The home plugin needs to use the Import API instead of bulkCreate:

createResults = await client.bulkCreate(
savedObjects.map(({ version, ...savedObject }) => savedObject),
{ overwrite: true }
);

@jportner jportner added chore Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Oct 12, 2021
@jportner jportner self-assigned this Oct 12, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@jportner
Copy link
Contributor Author

Duplicate of #116261

@jportner jportner marked this as a duplicate of #116261 Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

No branches or pull requests

2 participants