[8.16][Fleet] fix schema validation to allow undefined/null (#202732) (#202879)

Backport https://github.com/elastic/kibana/pull/202732 to 8.16

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Julia Bardi 2024-12-09 10:48:32 +01:00 committed by GitHub
parent 1a310f0acf
commit f3f31f43f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ export interface NewAgentPolicy {
global_data_tags?: GlobalDataTag[];
monitoring_pprof_enabled?: boolean;
monitoring_http?: {
enabled: boolean;
enabled?: boolean;
host?: string;
port?: number;
};

View file

@ -105,7 +105,7 @@ export const AgentPolicyBaseSchema = {
monitoring_pprof_enabled: schema.maybe(schema.boolean()),
monitoring_http: schema.maybe(
schema.object({
enabled: schema.boolean(),
enabled: schema.maybe(schema.boolean()),
host: schema.maybe(schema.string({ defaultValue: 'localhost' })),
port: schema.maybe(schema.number({ min: 0, max: 65353, defaultValue: 6791 })),
buffer: schema.maybe(schema.object({ enabled: schema.boolean({ defaultValue: false }) })),