Skip to content

Commit

Permalink
[datadog_synthetics_test] Do not send value if empty (#2580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 authored Sep 12, 2024
1 parent 00a795f commit b03b25f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 39 deletions.
5 changes: 3 additions & 2 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,6 @@ func buildDatadogExtractedValues(stepExtractedValues []interface{}) []datadogV1.

value.SetName(extractedValueMap["name"].(string))
value.SetType(datadogV1.SyntheticsLocalVariableParsingOptionsType(extractedValueMap["type"].(string)))

if extractedValueMap["field"] != "" {
value.SetField(extractedValueMap["field"].(string))
}
Expand All @@ -2950,7 +2949,9 @@ func buildDatadogExtractedValues(stepExtractedValues []interface{}) []datadogV1.

parser := datadogV1.SyntheticsVariableParser{}
parser.SetType(datadogV1.SyntheticsGlobalVariableParserType(valueParser["type"].(string)))
parser.SetValue(valueParser["value"].(string))
if valueParser["value"] != "" {
parser.SetValue(valueParser["value"].(string))
}

value.SetParser(parser)

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-09-03T18:07:48.653153+02:00
2024-09-12T18:47:44.314895+02:00
Loading

0 comments on commit b03b25f

Please sign in to comment.