Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ops] Fix serverless startup issue around importing @kbn/dev-utils #165311

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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