Skip to content

Commit

Permalink
Deprecate kibana.defaultAppId setting (#67635)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Jun 3, 2020
1 parent 0a23bfb commit f8759d4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Some example translations are shown here:
[horizontal]
**Environment Variable**:: **Kibana Setting**
`SERVER_NAME`:: `server.name`
`KIBANA_DEFAULTAPPID`:: `kibana.defaultAppId`
`SERVER_BASEPATH`:: `server.basePath`
`MONITORING_ENABLED`:: `monitoring.enabled`

In general, any setting listed in <<settings>> can be
Expand Down
4 changes: 3 additions & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ on the {kib} index at startup. {kib} users still need to authenticate with
| Enables use of interpreter in Visualize. *Default: `true`*

| `kibana.defaultAppId:`
| The default application to load. *Default: `"home"`*
| *deprecated* This setting is deprecated and will get removed in Kibana 8.0.
Please use the `defaultRoute` advanced setting instead.
The default application to load. *Default: `"home"`*

| `kibana.index:`
| {kib} uses an index in {es} to store saved searches, visualizations, and
Expand Down
20 changes: 19 additions & 1 deletion src/plugins/kibana_legacy/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
* under the License.
*/

import { CoreSetup, CoreStart, PluginConfigDescriptor } from 'kibana/server';
import {
ConfigDeprecationLogger,
CoreSetup,
CoreStart,
PluginConfigDescriptor,
} from 'kibana/server';
import { get } from 'lodash';

import { configSchema, ConfigSchema } from '../config';

Expand All @@ -29,6 +35,18 @@ export const config: PluginConfigDescriptor<ConfigSchema> = {
deprecations: ({ renameFromRoot }) => [
// TODO: Remove deprecation once defaultAppId is deleted
renameFromRoot('kibana.defaultAppId', 'kibana_legacy.defaultAppId', true),
(completeConfig: Record<string, any>, rootPath: string, log: ConfigDeprecationLogger) => {
if (
get(completeConfig, 'kibana.defaultAppId') === undefined &&
get(completeConfig, 'kibana_legacy.defaultAppId') === undefined
) {
return completeConfig;
}
log(
`kibana.defaultAppId is deprecated and will be removed in 8.0. Please use the \`defaultRoute\` advanced setting instead`
);
return completeConfig;
},
],
};

Expand Down

0 comments on commit f8759d4

Please sign in to comment.