Skip to content

Commit

Permalink
[Ops] Fix serverless startup issue around importing @kbn/dev-utils (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
delanni authored Aug 31, 2023
1 parent ad59308 commit 8d7aa0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 8d7aa0b

Please sign in to comment.