mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
(cherry picked from commit 159825a476
)
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
This commit is contained in:
parent
a905d63acf
commit
60a9838d21
2 changed files with 14 additions and 1 deletions
|
@ -1979,6 +1979,10 @@ describe('Package policy service', () => {
|
|||
type: 'text',
|
||||
value: ['/var/log/logfile.log'],
|
||||
},
|
||||
is_value_enabled: {
|
||||
type: 'bool',
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
streams: [],
|
||||
},
|
||||
|
@ -2009,6 +2013,10 @@ describe('Package policy service', () => {
|
|||
name: 'path',
|
||||
type: 'text',
|
||||
},
|
||||
{
|
||||
name: 'is_value_enabled',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -2028,6 +2036,10 @@ describe('Package policy service', () => {
|
|||
type: 'text',
|
||||
value: '/var/log/new-logfile.log',
|
||||
},
|
||||
is_value_enabled: {
|
||||
type: 'bool',
|
||||
value: 'true',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -2041,6 +2053,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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1289,7 +1289,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue