Skip to content

Commit

Permalink
[datadog_synthetics_test] Check if ci options block is valid (#2252)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzou authored Jan 19, 2024
1 parent 0dfd8b4 commit 0a831f3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2003,12 +2003,11 @@ func buildTestOptions(d *schema.ResourceData) *datadogV1.SyntheticsTestOptions {

if ciRaw, ok := d.GetOk("options_list.0.ci"); ok {
ci := ciRaw.([]interface{})[0]
testCiOptions := ci.(map[string]interface{})

ciOptions := datadogV1.SyntheticsTestCiOptions{}
ciOptions.SetExecutionRule(datadogV1.SyntheticsTestExecutionRule(testCiOptions["execution_rule"].(string)))

options.SetCi(ciOptions)
if testCiOptions, ok := ci.(map[string]interface{}); ok {
ciOptions := datadogV1.SyntheticsTestCiOptions{}
ciOptions.SetExecutionRule(datadogV1.SyntheticsTestExecutionRule(testCiOptions["execution_rule"].(string)))
options.SetCi(ciOptions)
}
}

if ignoreServerCertificateError, ok := d.GetOk("options_list.0.ignore_server_certificate_error"); ok {
Expand Down

0 comments on commit 0a831f3

Please sign in to comment.