mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Disable management plugins using contextRef (#160671)
This commit is contained in:
parent
37521304af
commit
75f68da623
10 changed files with 131 additions and 8 deletions
|
@ -9,7 +9,14 @@ import { schema, TypeOf } from '@kbn/config-schema';
|
|||
import { PluginConfigDescriptor } from '@kbn/core-plugins-server';
|
||||
|
||||
const configSchema = schema.object({
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// cloud_data_migration is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
});
|
||||
|
||||
export type CloudDataMigrationConfig = TypeOf<typeof configSchema>;
|
||||
|
|
|
@ -26,7 +26,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// CCR is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -28,7 +28,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// ILM is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -26,7 +26,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// License Management is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -26,7 +26,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// Remote Clusters is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -26,7 +26,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// Rollups is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -29,7 +29,14 @@ const schemaLatest = schema.object(
|
|||
* Disables the plugin.
|
||||
* Added back in 8.8.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// Snapshot & Restore is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
},
|
||||
{ defaultValue: undefined }
|
||||
);
|
||||
|
|
|
@ -15,7 +15,14 @@ const configSchema = schema.object({
|
|||
/**
|
||||
* Disables the plugin.
|
||||
*/
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
enabled: schema.conditional(
|
||||
schema.contextRef('serverless'),
|
||||
true,
|
||||
// Upgrade Assistant is disabled in serverless; refer to the serverless.yml file as the source of truth
|
||||
// We take this approach in order to have a central place (serverless.yml) to view disabled plugins across Kibana
|
||||
schema.boolean({ defaultValue: true }),
|
||||
schema.never()
|
||||
),
|
||||
|
||||
featureSet: schema.object({
|
||||
/**
|
||||
|
|
|
@ -10,5 +10,6 @@ import { FtrProviderContext } from '../../ftr_provider_context';
|
|||
export default function ({ loadTestFile }: FtrProviderContext) {
|
||||
describe('serverless common UI', function () {
|
||||
loadTestFile(require.resolve('./home_page'));
|
||||
loadTestFile(require.resolve('./management'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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 { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function ({ getPageObject, getService }: FtrProviderContext) {
|
||||
const commonPage = getPageObject('common');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
||||
describe('Management', function () {
|
||||
describe('Disabled UIs', () => {
|
||||
const DISABLED_PLUGINS = [
|
||||
{
|
||||
appName: 'Upgrade Assistant',
|
||||
url: 'stack/upgrade_assistant',
|
||||
},
|
||||
{
|
||||
appName: 'Advanced Settings',
|
||||
url: 'kibana/settings',
|
||||
},
|
||||
{
|
||||
appName: 'Migrate',
|
||||
url: 'data/migrate_data',
|
||||
},
|
||||
{
|
||||
appName: 'Remote Clusters',
|
||||
url: 'data/remote_clusters',
|
||||
},
|
||||
{
|
||||
appName: 'Cross-Cluster Replication',
|
||||
url: 'data/cross_cluster_replication',
|
||||
},
|
||||
{
|
||||
appName: 'Snapshot and Restore',
|
||||
url: 'data/snapshot_restore',
|
||||
},
|
||||
{
|
||||
appName: 'Index Lifecycle Management',
|
||||
url: 'data/index_lifecycle_management',
|
||||
},
|
||||
{
|
||||
appName: 'Rollup Jobs',
|
||||
url: 'data/rollup_jobs',
|
||||
},
|
||||
{
|
||||
appName: 'License Management',
|
||||
url: 'stack/license_management',
|
||||
},
|
||||
];
|
||||
|
||||
DISABLED_PLUGINS.forEach(({ appName, url }) => {
|
||||
it(`${appName} is not accessible`, async () => {
|
||||
await commonPage.navigateToUrl('management', url, {
|
||||
shouldUseHashForSubUrl: false,
|
||||
});
|
||||
// If the route doesn't exist, the user will be redirected back to the Management landing page
|
||||
await testSubjects.exists('managementHome');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue