Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions x-pack/plugins/fleet/server/services/package_policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,10 @@ describe('Package policy service', () => {
type: 'text',
value: ['/var/log/logfile.log'],
},
is_value_enabled: {
type: 'bool',
value: false,
},
},
streams: [],
},
Expand Down Expand Up @@ -2023,6 +2027,10 @@ describe('Package policy service', () => {
name: 'path',
type: 'text',
},
{
name: 'is_value_enabled',
type: 'bool',
},
],
},
],
Expand All @@ -2042,6 +2050,10 @@ describe('Package policy service', () => {
type: 'text',
value: '/var/log/new-logfile.log',
},
is_value_enabled: {
type: 'bool',
value: 'true',
},
},
},
];
Expand All @@ -2055,6 +2067,7 @@ describe('Package policy service', () => {
false
);
expect(result.inputs[0]?.vars?.path.value).toEqual(['/var/log/logfile.log']);
expect(result.inputs[0]?.vars?.is_value_enabled.value).toEqual(false);
});
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/server/services/package_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ function deepMergeVars(original: any, override: any, keepOriginalValue = false):

// Ensure that any value from the original object is persisted on the newly merged resulting object,
// even if we merge other data about the given variable
if (keepOriginalValue && originalVar?.value) {
if (keepOriginalValue && originalVar?.value !== undefined) {
result.vars[name].value = originalVar.value;
}
}
Expand Down