From 2525c8c352e893cdab73d78e35715369eab24b4b Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Thu, 31 Aug 2023 13:00:03 +0200 Subject: [PATCH] fix(kibana-serverless): inline dev service account token - in the serverless images the @kbn/dev-utils package is not linked --- src/cli/serve/serve.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index 192ea6e14955e..60a768066dd1d 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -15,10 +15,12 @@ import { isKibanaDistributable } from '@kbn/repo-info'; import { readKeystore } from '../keystore/read_keystore'; import { compileConfigStack } from './compile_config_stack'; import { getConfigFromFiles } from '@kbn/config'; -import { kibanaDevServiceAccount } from '@kbn/dev-utils'; const DEV_MODE_PATH = '@kbn/cli-dev-mode'; const DEV_MODE_SUPPORTED = canRequire(DEV_MODE_PATH); +const KIBANA_DEV_SERVICE_ACCOUNT_TOKEN = + process.env.TEST_KIBANA_SERVICE_ACCOUNT_TOKEN || + 'AAEAAWVsYXN0aWMva2liYW5hL2tpYmFuYS1kZXY6VVVVVVVVTEstKiBaNA'; function canRequire(path) { try { @@ -70,7 +72,7 @@ export function applyConfigOverrides(rawConfig, opts, extraCliOptions) { if (opts.dev) { if (opts.serverless) { - set('elasticsearch.serviceAccountToken', kibanaDevServiceAccount.token); + set('elasticsearch.serviceAccountToken', KIBANA_DEV_SERVICE_ACCOUNT_TOKEN); } if (!has('elasticsearch.serviceAccountToken') && opts.devCredentials !== false) { @@ -103,7 +105,6 @@ export function applyConfigOverrides(rawConfig, opts, extraCliOptions) { ensureNotDefined('server.ssl.truststore.path'); ensureNotDefined('server.ssl.certificateAuthorities'); ensureNotDefined('elasticsearch.ssl.certificateAuthorities'); - const elasticsearchHosts = ( (customElasticsearchHosts.length > 0 && customElasticsearchHosts) || [ 'https://localhost:9200',