[CI tools] Use ES 8.x (#213056)

## Summary

After upgrading the ES client to 9.0
(https://github.com/elastic/kibana/pull/208776), we noticed that the CI
fails to upload the results of the tests to the CI cluster:

```
ERROR ResponseError: media_type_header_exception
      	Caused by:
      		status_exception: Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9
      	Root causes:
      		media_type_header_exception: Invalid media-type value on headers [Content-Type, Accept]
```

This PR makes sure that the CI client is still using v8.x until we
upgrade that cluster.
This commit is contained in:
Alejandro Fernández Haro 2025-03-05 20:26:57 +01:00 committed by GitHub
parent 80f4aab305
commit c240b035d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 83 additions and 28 deletions

View file

@ -7,9 +7,12 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { Client, HttpConnection } from '@elastic/elasticsearch';
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import { SearchRequest, MsearchRequestItem } from '@elastic/elasticsearch/lib/api/types';
import { Client, HttpConnection } from 'elasticsearch-8.x'; // Switch to `@elastic/elasticsearch` when the CI cluster is upgraded.
import {
QueryDslQueryContainer,
SearchRequest,
MsearchRequestItem,
} from 'elasticsearch-8.x/lib/api/types'; // Switch to `@elastic/elasticsearch` when the CI cluster is upgraded.
import { ToolingLog } from '@kbn/tooling-log';
interface ClientOptions {