kibana/packages/core/rendering
Pierre Gayvallet 53173f1033
Introducing the concept of ES capabilities (#164850)
## Summary

We recently got problems because some index creation settings are
rejected by stateless ES, causing the whole system to fail and Kibana to
terminate.

We can't really use feature flags for this, given:
1. it doesn't really make sense to use manual flags for something that
strictly depend on one of our dependency's capabilities
2. we're mixing the concept of "serverless" offering and "serverless"
build. Atm we sometimes run "serverless" Kibana against traditional ES,
meaning that the "serverless" info **cannot** be used to determine if
we're connected against a default or serverless version of ES.

This was something that was agreed a few weeks back, but never acted
upon.

## Introducing ES capabilities

This PR introduces the concept of elasticsearch "capabilities".

Those capabilities are built exclusively from info coming from the ES
cluster (and not by some config flag).

This first implementation simply exposes a `serverless` flag, that is
populated depending on the `build_flavor` field of the `info` API (`/`
endpoint).

The end goal would be to expose a real capabilities (e.g "what is
supported") list instead. But ideally this would be provided by some ES
API and not by us guessing what is supported depending on the build
flavor, so for now, just exposing whether we're connected to a default
of serverless ES will suffice.

### Using it to adapt some API calls during SO migration

This PR also adapts the `createIndex` and `cloneIndex` migration action
to use this information and change their request against ES accordingly
(removing some index creation parameters that are not supported).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-28 10:20:27 +02:00
..
core-rendering-browser-internal [context] Unify Contexts, deprecate others (#161914) 2023-07-28 09:30:08 -07:00
core-rendering-browser-mocks Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
core-rendering-server-internal Introducing the concept of ES capabilities (#164850) 2023-08-28 10:20:27 +02:00
core-rendering-server-mocks Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00