Skip to content

Commit

Permalink
[datadog_synthetics_test] Fix renotify_interval drift when saving f…
Browse files Browse the repository at this point in the history
…rom UI (#2457)

* [SYNTH-14611] Fix `renotify_interval` drift when saving from UI

* Update tests
  • Loading branch information
Drarig29 authored Jul 5, 2024
1 parent ba28000 commit 68574b2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 49 deletions.
14 changes: 10 additions & 4 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2936,11 +2936,17 @@ func buildLocalOptions(actualOptions datadogV1.SyntheticsTestOptions) []map[stri
}
if actualOptions.HasMonitorOptions() {
actualMonitorOptions := actualOptions.GetMonitorOptions()
renotifyInterval := actualMonitorOptions.GetRenotifyInterval()

optionsListMonitorOptions := make(map[string]int64)
optionsListMonitorOptions["renotify_interval"] = renotifyInterval
localOptionsList["monitor_options"] = []map[string]int64{optionsListMonitorOptions}
shouldUpdate := false

if actualMonitorOptions.HasRenotifyInterval() {
optionsListMonitorOptions["renotify_interval"] = actualMonitorOptions.GetRenotifyInterval()
shouldUpdate = true
}

if shouldUpdate {
localOptionsList["monitor_options"] = []map[string]int64{optionsListMonitorOptions}
}
}
if actualOptions.HasNoScreenshot() {
localOptionsList["no_screenshot"] = actualOptions.GetNoScreenshot()
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-07-03T16:50:08.196552-04:00
2024-07-05T09:54:18.008667-04:00
Loading

0 comments on commit 68574b2

Please sign in to comment.