Skip to content

Commit

Permalink
fix(synthetics): Adjust timeframes loop to include child objects (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
elx-bob authored Oct 25, 2024
1 parent a3eea92 commit c04a852
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/synthetics/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
datadog = {
source = "datadog/datadog"
version = "3.31.0"
version = ">=3.43.1"
}
}
}
2 changes: 1 addition & 1 deletion modules/synthetics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ resource "datadog_synthetics_test" "default" {
# Required
timezone = scheduling.value.timezone
dynamic "timeframes" {
for_each = [for v in [lookup(scheduling.value, "timeframes", null)] : v if v != null]
for_each = lookup(scheduling.value, "timeframes", [])

content {
day = timeframes.value.day
Expand Down
5 changes: 3 additions & 2 deletions modules/synthetics/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ terraform {

required_providers {
datadog = {
source = "datadog/datadog"
version = ">= 3.31.0"
source = "datadog/datadog"
# Must have >= 3.43.1 to have fix for https://github.com/DataDog/terraform-provider-datadog/issues/2531
version = ">= 3.43.1"
}
}
}
2 changes: 1 addition & 1 deletion test/src/examples_complete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestExamplesComplete(t *testing.T) {
}

// anomaly-recovery-test should have no tags
assert.Nil(t, output["anomaly-recovery-test"].(map[string]interface{})["tags"], "Monitor 'anomaly-recovery-test' should have no tags")
assert.Empty(t, output["anomaly-recovery-test"].(map[string]interface{})["tags"], "Monitor 'anomaly-recovery-test' should have no tags")

// schedule-legacy-test has no tags defined, should have default tags
tags, err = extractMonitorTags(output["schedule-legacy-test"])
Expand Down

0 comments on commit c04a852

Please sign in to comment.