Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ignore options diff in synthetics resource #707

Merged
merged 5 commits into from
Oct 19, 2020
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
5 changes: 0 additions & 5 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,6 @@ func syntheticsTestOptions() *schema.Schema {
ConflictsWith: []string{"options_list"},
Deprecated: "This parameter is deprecated, please use `options_list`",
DiffSuppressFunc: func(key, old, new string, d *schema.ResourceData) bool {
// DiffSuppressFunc is useless if options_list exists
if _, isOptionsV2 := d.GetOk("options_list"); isOptionsV2 {
return isOptionsV2
}

if key == "options.follow_redirects" || key == "options.accept_self_signed" || key == "options.allow_insecure" {
// TF nested schemas is limited to string values only
// follow_redirects, accept_self_signed and allow_insecure being booleans in Datadog json api
Expand Down
6 changes: 6 additions & 0 deletions datadog/resource_datadog_synthetics_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ func createSyntheticsAPITestStep(accProvider *schema.Provider, clock clockwork.F
"datadog_synthetics_test.foo", "options.min_location_failed", "1"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "options.retry_count", "1"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "options_list.#", "0"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "name", testName),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -668,6 +670,8 @@ func updateSyntheticsAPITestStep(accProvider *schema.Provider, clock clockwork.F
"datadog_synthetics_test.foo", "options_list.0.retry.0.interval", "500"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "options_list.0.monitor_options.0.renotify_interval", "100"),
// Make sure the legacy attribute isn't set anymore
resource.TestCheckNoResourceAttr("datadog_synthetics_test.foo", "options.tick_every"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "name", testName),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -1030,6 +1034,8 @@ func createSyntheticsTCPTestStep(accProvider *schema.Provider, clock clockwork.F
"datadog_synthetics_test.tcp", "locations.0", "aws:eu-central-1"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.tcp", "options_list.0.tick_every", "60"),
// Make sure the legacy attribute isn't set anymore
resource.TestCheckNoResourceAttr("datadog_synthetics_test.tcp", "options.tick_every"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.tcp", "name", testName),
resource.TestCheckResourceAttr(
Expand Down