-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Rename namespaces to initialNamespaces for create operations
#79682
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
Rename namespaces to initialNamespaces for create operations
#79682
Conversation
| ) | ||
| ), | ||
| namespaces: schema.maybe(schema.arrayOf(schema.string(), { minSize: 1 })), | ||
| initialNamespaces: schema.maybe(schema.arrayOf(schema.string(), { minSize: 1 })), |
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.
If beats is sending namespaces in it's payload, won't it fail validation here?
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.
It would fail using the external create API route, but not using the legacy import API (which does not validate object fields)
legrego
left a comment
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 on green CI
|
Test failure looks unrelated, probably CI madness due to all the merges today, I'm going to merge upstream / retest to see if that fixes it |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
In #76132 we added the ability to create multi-namespace saved objects in an initial set of consumer-defined namespaces (via "create" and "bulkCreate" APIs). However, retrieving objects via "get", "bulkGet", or "find" will also return each object's current namespace(s) in a
namespacesfield. If a consumer is attempting to create a new object based on that result, they will unintentionally attempt to set the new object's initial namespaces.To avoid this behavior, we'll rename these fields to
initialNamespacesfor create operations so they cannot be accidentally conflated with the results of read operations.