mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Include x-pack plugin path when appropriate Unless Kibana is running as oss-only, the x-pack plugins path is configured in the environment for use in plugin discovery.
This commit is contained in:
parent
2da80fae70
commit
5b50782e10
8 changed files with 43 additions and 1 deletions
|
@ -214,6 +214,7 @@ export default function (program) {
|
|||
repl: !!opts.repl,
|
||||
basePath: !!opts.basePath,
|
||||
optimize: !!opts.optimize,
|
||||
oss: !!opts.oss,
|
||||
},
|
||||
features: {
|
||||
isClusterModeSupported: CAN_CLUSTER,
|
||||
|
|
|
@ -37,6 +37,7 @@ export function getEnvOptions(options: DeepPartial<EnvOptions> = {}): EnvOptions
|
|||
repl: false,
|
||||
basePath: false,
|
||||
optimize: false,
|
||||
oss: false,
|
||||
...(options.cliArgs || {}),
|
||||
},
|
||||
isDevClusterMaster:
|
||||
|
|
|
@ -9,6 +9,7 @@ Env {
|
|||
"envName": "development",
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -34,6 +35,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/test/cwd/src/plugins",
|
||||
"/test/cwd/x-pack/plugins",
|
||||
"/test/cwd/plugins",
|
||||
"/test/cwd/../kibana-extra",
|
||||
],
|
||||
|
@ -50,6 +52,7 @@ Env {
|
|||
"envName": "production",
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -75,6 +78,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/test/cwd/src/plugins",
|
||||
"/test/cwd/x-pack/plugins",
|
||||
"/test/cwd/plugins",
|
||||
"/test/cwd/../kibana-extra",
|
||||
],
|
||||
|
@ -90,6 +94,7 @@ Env {
|
|||
"dev": true,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -115,6 +120,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/test/cwd/src/plugins",
|
||||
"/test/cwd/x-pack/plugins",
|
||||
"/test/cwd/plugins",
|
||||
"/test/cwd/../kibana-extra",
|
||||
],
|
||||
|
@ -130,6 +136,7 @@ Env {
|
|||
"dev": false,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -155,6 +162,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/test/cwd/src/plugins",
|
||||
"/test/cwd/x-pack/plugins",
|
||||
"/test/cwd/plugins",
|
||||
"/test/cwd/../kibana-extra",
|
||||
],
|
||||
|
@ -170,6 +178,7 @@ Env {
|
|||
"dev": false,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -195,6 +204,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/test/cwd/src/plugins",
|
||||
"/test/cwd/x-pack/plugins",
|
||||
"/test/cwd/plugins",
|
||||
"/test/cwd/../kibana-extra",
|
||||
],
|
||||
|
@ -210,6 +220,7 @@ Env {
|
|||
"dev": false,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -235,6 +246,7 @@ Env {
|
|||
},
|
||||
"pluginSearchPaths": Array [
|
||||
"/some/home/dir/src/plugins",
|
||||
"/some/home/dir/x-pack/plugins",
|
||||
"/some/home/dir/plugins",
|
||||
"/some/home/dir/../kibana-extra",
|
||||
],
|
||||
|
|
|
@ -130,3 +130,25 @@ test('correctly creates environment with constructor.', () => {
|
|||
|
||||
expect(env).toMatchSnapshot('env properties');
|
||||
});
|
||||
|
||||
test('pluginSearchPaths contains x-pack plugins path if --oss flag is false', () => {
|
||||
const env = new Env(
|
||||
'/some/home/dir',
|
||||
getEnvOptions({
|
||||
cliArgs: { oss: false },
|
||||
})
|
||||
);
|
||||
|
||||
expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/plugins');
|
||||
});
|
||||
|
||||
test('pluginSearchPaths does not contains x-pack plugins path if --oss flag is true', () => {
|
||||
const env = new Env(
|
||||
'/some/home/dir',
|
||||
getEnvOptions({
|
||||
cliArgs: { oss: true },
|
||||
})
|
||||
);
|
||||
|
||||
expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/plugins');
|
||||
});
|
||||
|
|
|
@ -55,6 +55,7 @@ export interface CliArgs {
|
|||
basePath: boolean;
|
||||
optimize: boolean;
|
||||
open: boolean;
|
||||
oss: boolean;
|
||||
}
|
||||
|
||||
export class Env {
|
||||
|
@ -115,9 +116,10 @@ export class Env {
|
|||
|
||||
this.pluginSearchPaths = [
|
||||
resolve(this.homeDir, 'src', 'plugins'),
|
||||
options.cliArgs.oss ? '' : resolve(this.homeDir, 'x-pack', 'plugins'),
|
||||
resolve(this.homeDir, 'plugins'),
|
||||
resolve(this.homeDir, '..', 'kibana-extra'),
|
||||
];
|
||||
].filter(Boolean);
|
||||
|
||||
this.cliArgs = Object.freeze(options.cliArgs);
|
||||
this.configs = Object.freeze(options.configs);
|
||||
|
|
|
@ -6,6 +6,7 @@ Object {
|
|||
"dev": true,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": true,
|
||||
"repl": false,
|
||||
"silent": false,
|
||||
|
@ -29,6 +30,7 @@ Array [
|
|||
"dev": true,
|
||||
"open": false,
|
||||
"optimize": false,
|
||||
"oss": false,
|
||||
"quiet": false,
|
||||
"repl": false,
|
||||
"silent": true,
|
||||
|
|
|
@ -320,6 +320,7 @@ test('`setup` properly invokes `discover` and ignores non-critical errors.', asy
|
|||
initialize: true,
|
||||
pluginSearchPaths: [
|
||||
resolve(process.cwd(), 'src', 'plugins'),
|
||||
resolve(process.cwd(), 'x-pack', 'plugins'),
|
||||
resolve(process.cwd(), 'plugins'),
|
||||
resolve(process.cwd(), '..', 'kibana-extra'),
|
||||
],
|
||||
|
|
|
@ -75,6 +75,7 @@ export function createRootWithSettings(
|
|||
repl: false,
|
||||
basePath: false,
|
||||
optimize: false,
|
||||
oss: false,
|
||||
...cliArgs,
|
||||
},
|
||||
isDevClusterMaster: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue