Skip to content

Commit

Permalink
Add a default value for httpVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 committed Jun 25, 2024
1 parent 091d7ed commit 2e5af8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ func syntheticsFollowRedirectsOption() *schema.Schema {
func syntheticsHttpVersionOption() *schema.Schema {
return &schema.Schema{
Description: "HTTP version to use for an HTTP request in an API test or step.",
Default: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_ANY,
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: validators.ValidateEnumValue(datadogV1.NewSyntheticsTestOptionsHTTPVersionFromValue),
Expand Down Expand Up @@ -3345,6 +3346,12 @@ func updateSyntheticsAPITestLocalState(d *schema.ResourceData, syntheticsTest *d
localRequest := buildLocalRequest(stepRequest)
localRequest["allow_insecure"] = stepRequest.GetAllowInsecure()
localRequest["follow_redirects"] = stepRequest.GetFollowRedirects()
if step.GetSubtype() == "grpc" {
// the schema defines a default value of `http_version` for any kind of step,
// but it's not supported for `grpc` - so we save `any` in the local state to avoid diffs
localRequest["http_version"] = datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_ANY
}

localStep["request_definition"] = []map[string]interface{}{localRequest}
localStep["request_headers"] = stepRequest.GetHeaders()
localStep["request_query"] = stepRequest.GetQuery()
Expand Down

0 comments on commit 2e5af8e

Please sign in to comment.