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

[datadog_synthetics_test] Handle both example and secure missing from variables #1959

Merged
merged 1 commit into from
Jun 12, 2023
Merged
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
8 changes: 4 additions & 4 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2798,12 +2798,12 @@ func updateSyntheticsBrowserTestLocalState(d *schema.ResourceData, syntheticsTes
}
if v, ok := variable.GetExampleOk(); ok {
localVariable["example"] = *v
} else if localVariable["secure"].(bool) {
} else if v, ok := localVariable["secure"].(bool); ok && v {
localVariable["example"] = d.Get(fmt.Sprintf("browser_variable.%d.example", i))
}
if v, ok := variable.GetPatternOk(); ok {
localVariable["pattern"] = *v
} else if localVariable["secure"].(bool) {
} else if v, ok := localVariable["secure"].(bool); ok && v {
localVariable["pattern"] = d.Get(fmt.Sprintf("browser_variable.%d.pattern", i))
}
localBrowserVariables[i] = localVariable
Expand Down Expand Up @@ -3004,12 +3004,12 @@ func updateSyntheticsAPITestLocalState(d *schema.ResourceData, syntheticsTest *d
if configVariable.GetType() != "global" {
if v, ok := configVariable.GetExampleOk(); ok {
localVariable["example"] = *v
} else if localVariable["secure"].(bool) {
} else if v, ok := localVariable["secure"].(bool); ok && v {
localVariable["example"] = d.Get(fmt.Sprintf("config_variable.%d.example", i))
}
if v, ok := configVariable.GetPatternOk(); ok {
localVariable["pattern"] = *v
} else if localVariable["secure"].(bool) {
} else if v, ok := localVariable["secure"].(bool); ok && v {
localVariable["pattern"] = d.Get(fmt.Sprintf("config_variable.%d.pattern", i))
}
}
Expand Down