mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Synthetics] prevent origin from being included on legacy Synthetics integration policies (#137919) (#137962)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Shahzad <shahzad.muhammad@elastic.co>
(cherry picked from commit eea8f5e1f9
)
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
parent
277b87c8b7
commit
cea98120d2
2 changed files with 6 additions and 2 deletions
|
@ -18,7 +18,8 @@ export const formatSyntheticsPolicy = (
|
|||
'monitor.project.name': string;
|
||||
'monitor.project.id': string;
|
||||
}
|
||||
>
|
||||
>,
|
||||
isLegacy?: boolean
|
||||
) => {
|
||||
const configKeys = Object.keys(config) as ConfigKey[];
|
||||
|
||||
|
@ -45,6 +46,8 @@ export const formatSyntheticsPolicy = (
|
|||
if (configItem) {
|
||||
if (formatters[key]) {
|
||||
configItem.value = formatters[key]?.(config);
|
||||
} else if (key === ConfigKey.MONITOR_SOURCE_TYPE && isLegacy) {
|
||||
configItem.value = undefined;
|
||||
} else {
|
||||
configItem.value = config[key] === undefined || config[key] === null ? null : config[key];
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@ export const useUpdatePolicy = ({
|
|||
const { formattedPolicy, dataStream, currentInput } = formatSyntheticsPolicy(
|
||||
newPolicy,
|
||||
monitorType,
|
||||
config
|
||||
config,
|
||||
true
|
||||
);
|
||||
|
||||
// prevent an infinite loop of updating the policy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue