mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[8.16][Fleet] fix schema validation when updating package policy (#214770)
Backport https://github.com/elastic/kibana/pull/214571 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
52d1c98c9f
commit
6272be63eb
2 changed files with 15 additions and 9 deletions
|
@ -3191,11 +3191,13 @@ describe('Package policy service', () => {
|
|||
beforeEach(() => {
|
||||
context = xpackMocks.createRequestHandlerContext();
|
||||
request = httpServerMock.createKibanaRequest();
|
||||
appContextService.start(createAppContextStartContractMock());
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
callbackCallingOrder.length = 0;
|
||||
appContextService.stop();
|
||||
});
|
||||
|
||||
it('should call external callbacks in expected order', async () => {
|
||||
|
|
|
@ -261,15 +261,19 @@ export const PackagePolicySchema = schema.object({
|
|||
updated_by: schema.string(),
|
||||
created_at: schema.string(),
|
||||
created_by: schema.string(),
|
||||
elasticsearch: schema.maybe(
|
||||
schema.object({
|
||||
privileges: schema.maybe(
|
||||
schema.object({
|
||||
cluster: schema.maybe(schema.arrayOf(schema.string())),
|
||||
})
|
||||
),
|
||||
})
|
||||
),
|
||||
elasticsearch: schema
|
||||
.maybe(
|
||||
schema.object({
|
||||
privileges: schema.maybe(
|
||||
schema.object({
|
||||
cluster: schema.maybe(schema.arrayOf(schema.string())),
|
||||
})
|
||||
),
|
||||
})
|
||||
)
|
||||
.extendsDeep({
|
||||
unknowns: 'allow',
|
||||
}),
|
||||
inputs: schema.arrayOf(
|
||||
schema.object({
|
||||
...PackagePolicyInputsSchema,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue