-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[On-Week] Hot update of APM/EBT labels (#157093)
- Loading branch information
Showing
37 changed files
with
683 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/core/apps/core-apps-server-internal/src/core_app_config.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { config, CoreAppConfig } from './core_app_config'; | ||
|
||
describe('CoreApp Config', () => { | ||
test('set correct defaults', () => { | ||
const configValue = new CoreAppConfig(config.schema.validate({})); | ||
expect(configValue).toMatchInlineSnapshot(` | ||
CoreAppConfig { | ||
"allowDynamicConfigOverrides": false, | ||
} | ||
`); | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
packages/core/apps/core-apps-server-internal/src/core_app_config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { schema, type TypeOf } from '@kbn/config-schema'; | ||
import type { ServiceConfigDescriptor } from '@kbn/core-base-server-internal'; | ||
|
||
/** | ||
* Validation schema for Core App config. | ||
* @public | ||
*/ | ||
export const configSchema = schema.object({ | ||
allowDynamicConfigOverrides: schema.boolean({ defaultValue: false }), | ||
}); | ||
|
||
export type CoreAppConfigType = TypeOf<typeof configSchema>; | ||
|
||
export const CoreAppPath = 'coreApp'; | ||
|
||
export const config: ServiceConfigDescriptor<CoreAppConfigType> = { | ||
path: CoreAppPath, | ||
schema: configSchema, | ||
}; | ||
|
||
/** | ||
* Wrapper of config schema. | ||
* @internal | ||
*/ | ||
export class CoreAppConfig implements CoreAppConfigType { | ||
/** | ||
* @internal | ||
* When true, the HTTP API to dynamically extend the configuration is registered. | ||
* | ||
* @remarks | ||
* You should enable this at your own risk: Settings opted-in to being dynamically | ||
* configurable can be changed at any given point, potentially leading to unexpected behaviours. | ||
* This feature is mostly intended for testing purposes. | ||
*/ | ||
public readonly allowDynamicConfigOverrides: boolean; | ||
|
||
constructor(rawConfig: CoreAppConfig) { | ||
this.allowDynamicConfigOverrides = rawConfig.allowDynamicConfigOverrides; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.