-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Prohibit the usage of create index api in namespaces managed by data stream templates #62527
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
Prohibit the usage of create index api in namespaces managed by data stream templates #62527
Conversation
…stream templates. This commit adds validation that prohibits the creation of regular indices in the namespace of templates with data streams enabled. It shouldn't be possible to create ordinary indices when the name of the index matches with a composable index template that enables data streams. Auto creation has logic that creates data streams instead of regular indices. However validation logic for the create index api was missing.
|
Pinging @elastic/es-core-features (:Core/Features/Data streams) |
danhermann
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
dakrone
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, I left one suggestion for the error message
| ComposableIndexTemplate template = currentState.getMetadata().templatesV2().get(templateName); | ||
| if (request.dataStreamName() == null && template.getDataStreamTemplate() != null) { | ||
| throw new IllegalArgumentException("cannot create index with name [" + request.index() + | ||
| "], because it matches with template [" + templateName + "] that creates data streams only"); |
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 think we should try to steer the user in the right direction, can we suggest they try the create data stream API in the error message?
…stream templates Backport of elastic#62527 to 7.x branch. This commit adds validation that prohibits the creation of regular indices in the namespace of templates with data streams enabled. It shouldn't be possible to create ordinary indices when the name of the index matches with a composable index template that enables data streams. Auto creation has logic that creates data streams instead of regular indices. However validation logic for the create index api was missing.
…stream templates Backport of elastic#62527 to 7.9 branch. This commit adds validation that prohibits the creation of regular indices in the namespace of templates with data streams enabled. It shouldn't be possible to create ordinary indices when the name of the index matches with a composable index template that enables data streams. Auto creation has logic that creates data streams instead of regular indices. However validation logic for the create index api was missing.
…stream templates (#62574) Backport of #62527 to 7.x branch. This commit adds validation that prohibits the creation of regular indices in the namespace of templates with data streams enabled. It shouldn't be possible to create ordinary indices when the name of the index matches with a composable index template that enables data streams. Auto creation has logic that creates data streams instead of regular indices. However validation logic for the create index api was missing.
…stream templates (#62575) Backport of #62527 to 7.9 branch. This commit adds validation that prohibits the creation of regular indices in the namespace of templates with data streams enabled. It shouldn't be possible to create ordinary indices when the name of the index matches with a composable index template that enables data streams. Auto creation has logic that creates data streams instead of regular indices. However validation logic for the create index api was missing. * adjust docs test to not index into stack template namespace. (test was disabled on 7.x and master branches)
after elastic#62527 was backported.
after #62527 was backported.
after #62527 was backported.
after elastic#62527 was backported.
after #62527 was backported.
after #62527 was backported.
after #62527 was backported.
after #62527 was backported.
This commit adds validation that prohibits the creation of regular indices
in the namespace of templates with data streams enabled.
It shouldn't be possible to create ordinary indices when the name of the index
matches with a composable index template that enables data streams. Auto creation
has logic that creates data streams instead of regular indices. However validation
logic for the create index api was missing.