Added migration of policy for AV registration config. (#84779)
* Added migration of policy for AV registration config. * Updated migration a bit to be more safe.
This commit is contained in:
parent
b96b965387
commit
7f969136a3
|
@ -10,7 +10,7 @@ import { migratePackagePolicyToV7110 } from './to_v7_11.0';
|
|||
|
||||
describe('7.11.0 Endpoint Package Policy migration', () => {
|
||||
const migration = migratePackagePolicyToV7110;
|
||||
it('adds malware notification checkbox and optional message', () => {
|
||||
it('adds malware notification checkbox and optional message and adds AV registration config', () => {
|
||||
const doc: SavedObjectUnsanitizedDoc<PackagePolicy> = {
|
||||
attributes: {
|
||||
name: 'Some Policy Name',
|
||||
|
@ -77,6 +77,7 @@ describe('7.11.0 Endpoint Package Policy migration', () => {
|
|||
policy: {
|
||||
value: {
|
||||
windows: {
|
||||
antivirus_registration: { enabled: false },
|
||||
popup: {
|
||||
malware: {
|
||||
message: '',
|
||||
|
|
|
@ -23,8 +23,13 @@ export const migratePackagePolicyToV7110: SavedObjectMigrationFn<PackagePolicy,
|
|||
},
|
||||
};
|
||||
if (input && input.config) {
|
||||
input.config.policy.value.windows.popup = popup;
|
||||
input.config.policy.value.mac.popup = popup;
|
||||
const policy = input.config.policy.value;
|
||||
|
||||
policy.windows.antivirus_registration = policy.windows.antivirus_registration || {
|
||||
enabled: false,
|
||||
};
|
||||
policy.windows.popup = popup;
|
||||
policy.mac.popup = popup;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue