From b74b89e2c54c1264dc1c6befccd1751c83e5bf07 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Wed, 5 Jul 2023 18:06:48 +0200 Subject: [PATCH] [services/es] don't override user for serverless --- .../services/es.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/kbn-ftr-common-functional-services/services/es.ts b/packages/kbn-ftr-common-functional-services/services/es.ts index fe9aafbf10736..4e9586baa4a7c 100644 --- a/packages/kbn-ftr-common-functional-services/services/es.ts +++ b/packages/kbn-ftr-common-functional-services/services/es.ts @@ -13,9 +13,17 @@ import { FtrProviderContext } from './ftr_provider_context'; export function EsProvider({ getService }: FtrProviderContext): Client { const config = getService('config'); + const isServerless = + config.get('kbnTestServer.serverArgs').filter((arg: string) => arg.startsWith('--serverless')) + .length > 0; - return createEsClientForFtrConfig(config, { - // Use system indices user so tests can write to system indices - authOverride: systemIndicesSuperuser, - }); + return createEsClientForFtrConfig( + config, + isServerless + ? {} + : { + // Use system indices user so tests can write to system indices + authOverride: systemIndicesSuperuser, + } + ); }