elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.66k stars 8.23k forks source link

Support specification of route versions in Kibana test client #195414

Open jeramysoucy opened 1 month ago

jeramysoucy commented 1 month ago

Currently the Kibana test client allows passing custom headers when making a low-level request, but does not support specifying route versions when calling sub-client functions (e.g. kbnClient.spaces.list).

When Kibana is running in dev mode, the route handler will not resolve the version for an endpoint if it is not provided in the request header - server.versioned.versionResolution is not set by default. When spaces CRUD APIs became versioned, this caused issues running utility scripts, which use the Kibana test client, against Kibana in dev mode.

The issue does not affect the FTR because we specify the version resolution option based on the build flavor (serverless vs stateful).

Any use cases where the Kibana test client is used outside of the FTR will be subject to this issue if it is being called against dev Kibana, and issuing requests to versioned endpoints.

elasticmachine commented 1 month ago

Pinging @elastic/appex-qa (Team:QA)