[Fleet] Fix frozen key definition (#99232)
* [Fleet] Fix frozen key definition * Add integration test for frozen vars
This commit is contained in:
parent
ed8dc62f77
commit
a72b0393f3
|
@ -24,6 +24,7 @@ const ConfigRecordSchema = schema.recordOf(
|
|||
schema.object({
|
||||
type: schema.maybe(schema.string()),
|
||||
value: schema.maybe(schema.any()),
|
||||
frozen: schema.maybe(schema.boolean()),
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -174,5 +174,42 @@ export default function (providerContext: FtrProviderContext) {
|
|||
})
|
||||
.expect(500);
|
||||
});
|
||||
|
||||
it('should work with frozen input vars', async function () {
|
||||
await supertest
|
||||
.put(`/api/fleet/package_policies/${packagePolicyId}`)
|
||||
.set('kbn-xsrf', 'xxxx')
|
||||
.send({
|
||||
name: 'filetest-1',
|
||||
description: '',
|
||||
namespace: 'updated_namespace',
|
||||
policy_id: agentPolicyId,
|
||||
enabled: true,
|
||||
output_id: '',
|
||||
inputs: [
|
||||
{
|
||||
enabled: true,
|
||||
type: 'test-input',
|
||||
streams: [],
|
||||
vars: {
|
||||
frozen_var: {
|
||||
type: 'text',
|
||||
value: 'abc',
|
||||
frozen: true,
|
||||
},
|
||||
unfrozen_var: {
|
||||
type: 'text',
|
||||
value: 'def',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
package: {
|
||||
name: 'filetest',
|
||||
title: 'For File Tests',
|
||||
version: '0.1.0',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue