Skip to content

Commit

Permalink
Revert all stack management changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeelmers committed Oct 15, 2021
1 parent 35569da commit a7912a1
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 13 deletions.
18 changes: 7 additions & 11 deletions src/plugins/console/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { MAJOR_VERSION } from '../common/constants';
const kibanaVersion = new SemVer(MAJOR_VERSION);

const baseSettings = {
enabled: schema.boolean({ defaultValue: true }),
ssl: schema.object({ verify: schema.boolean({ defaultValue: false }) }, {}),
};

// Settings only available in 7.x
const deprecatedSettings = {
enabled: schema.boolean({ defaultValue: true }),
proxyFilter: schema.arrayOf(schema.string(), { defaultValue: ['.*'] }),
proxyConfig: schema.arrayOf(
schema.object({
Expand Down Expand Up @@ -64,16 +64,12 @@ const configSchema7x = schema.object(
export type ConfigType = TypeOf<typeof configSchema>;
export type ConfigType7x = TypeOf<typeof configSchema7x>;

const deprecations: PluginConfigDescriptor['deprecations'] = ({ unused }) => [unused('ssl')];

const deprecations7x: PluginConfigDescriptor['deprecations'] = ({ deprecate, unused }) => [
deprecate('enabled', '8.0.0'),
deprecate('proxyFilter', '8.0.0'),
deprecate('proxyConfig', '8.0.0'),
unused('ssl'),
];

export const config: PluginConfigDescriptor<ConfigType | ConfigType7x> = {
schema: kibanaVersion.major < 8 ? configSchema7x : configSchema,
deprecations: kibanaVersion.major < 8 ? deprecations7x : deprecations,
deprecations: ({ deprecate, unused }) => [
deprecate('enabled', '8.0.0'),
deprecate('proxyFilter', '8.0.0'),
deprecate('proxyConfig', '8.0.0'),
unused('ssl'),
],
};
1 change: 1 addition & 0 deletions x-pack/plugins/cross_cluster_replication/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/cross_cluster_replication/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor<CrossClusterReplicationConfig> = {
exposeToBrowser: {
ui: true,
},
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
};
1 change: 1 addition & 0 deletions x-pack/plugins/index_lifecycle_management/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/index_lifecycle_management/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor<IndexLifecycleManagementConfig> = {
exposeToBrowser: {
ui: true,
},
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
};
14 changes: 14 additions & 0 deletions x-pack/plugins/index_management/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
});

export type IndexManagementConfig = TypeOf<typeof configSchema>;
9 changes: 8 additions & 1 deletion x-pack/plugins/index_management/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
* 2.0.
*/

import { PluginInitializerContext } from 'src/core/server';
import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server';

import { IndexMgmtServerPlugin } from './plugin';
import { configSchema } from './config';

export const plugin = (context: PluginInitializerContext) => new IndexMgmtServerPlugin(context);

export const config: PluginConfigDescriptor = {
schema: configSchema,
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
};

/** @public */
export { Dependencies } from './types';
export { IndexManagementPluginSetup } from './plugin';
export { Index, LegacyTemplateSerialized } from '../common';
export { IndexManagementConfig } from './config';
1 change: 1 addition & 0 deletions x-pack/plugins/license_management/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/license_management/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor<LicenseManagementConfig> = {
exposeToBrowser: {
ui: true,
},
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
};
2 changes: 2 additions & 0 deletions x-pack/plugins/remote_clusters/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from 'kibana/server';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
Expand All @@ -17,6 +18,7 @@ export const configSchema = schema.object({
export type ConfigType = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<ConfigType> = {
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
schema: configSchema,
exposeToBrowser: {
ui: true,
Expand Down
14 changes: 14 additions & 0 deletions x-pack/plugins/rollup/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
});

export type RollupConfig = TypeOf<typeof configSchema>;
8 changes: 7 additions & 1 deletion x-pack/plugins/rollup/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
* 2.0.
*/

import { PluginInitializerContext } from 'src/core/server';
import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server';
import { RollupPlugin } from './plugin';
import { configSchema, RollupConfig } from './config';

export const plugin = (pluginInitializerContext: PluginInitializerContext) =>
new RollupPlugin(pluginInitializerContext);

export const config: PluginConfigDescriptor<RollupConfig> = {
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
schema: configSchema,
};
1 change: 1 addition & 0 deletions x-pack/plugins/snapshot_restore/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
slm_ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/snapshot_restore/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { configSchema, SnapshotRestoreConfig } from './config';
export const plugin = (ctx: PluginInitializerContext) => new SnapshotRestoreServerPlugin(ctx);

export const config: PluginConfigDescriptor<SnapshotRestoreConfig> = {
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
schema: configSchema,
exposeToBrowser: {
slm_ui: true,
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/snapshot_restore/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export class SnapshotRestoreServerPlugin implements Plugin<void, void, any, any>
): void {
const pluginConfig = this.context.config.get<SnapshotRestoreConfig>();

if (!pluginConfig.enabled) {
return;
}

const router = http.createRouter();

this.license.setup(
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/upgrade_assistant/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
/*
* This will default to true up until the last minor before the next major.
* In readonly mode, the user will not be able to perform any actions in the UI
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/upgrade_assistant/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const plugin = (ctx: PluginInitializerContext) => {
};

export const config: PluginConfigDescriptor<Config> = {
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
schema: configSchema,
exposeToBrowser: {
readonly: true,
Expand Down

0 comments on commit a7912a1

Please sign in to comment.