-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject recording rules with incompatible fields (#2000)
* Reject recording rules with incompatible fields * Hack validation in place around SDK limitations * Update docs * Fix diff for empty values
- Loading branch information
Showing
4 changed files
with
134 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,29 +118,29 @@ func TestAccMuteTiming_RemoveInUse(t *testing.T) { | |
locals { | ||
use_mute = %t | ||
} | ||
resource "grafana_organization" "my_org" { | ||
name = "mute-timing-test" | ||
} | ||
resource "grafana_contact_point" "default_policy" { | ||
org_id = grafana_organization.my_org.id | ||
name = "default-policy" | ||
email { | ||
addresses = ["[email protected]"] | ||
} | ||
} | ||
resource "grafana_notification_policy" "org_policy" { | ||
org_id = grafana_organization.my_org.id | ||
group_by = ["..."] | ||
group_wait = "45s" | ||
group_interval = "6m" | ||
repeat_interval = "3h" | ||
contact_point = grafana_contact_point.default_policy.name | ||
policy { | ||
mute_timings = local.use_mute ? [grafana_mute_timing.test[0].name] : [] | ||
mute_timings = local.use_mute ? [grafana_mute_timing.test[0].name] : [] | ||
contact_point = grafana_contact_point.default_policy.name | ||
} | ||
} | ||
|
@@ -167,7 +167,7 @@ func TestAccMuteTiming_RemoveInUse(t *testing.T) { | |
} | ||
|
||
func TestAccMuteTiming_RemoveInUseInAlertRule(t *testing.T) { | ||
testutils.CheckCloudInstanceTestsEnabled(t) // TODO: Switch to OSS when this is released: https://github.com/grafana/grafana/pull/90500 | ||
testutils.CheckOSSTestsEnabled(t, ">=11.2.0") | ||
|
||
randomStr := acctest.RandString(6) | ||
|
||
|
@@ -176,11 +176,11 @@ func TestAccMuteTiming_RemoveInUseInAlertRule(t *testing.T) { | |
locals { | ||
use_mute = %[2]t | ||
} | ||
resource "grafana_folder" "rule_folder" { | ||
title = "%[1]s" | ||
} | ||
resource "grafana_contact_point" "default_policy" { | ||
name = "%[1]s" | ||
email { | ||
|
@@ -219,7 +219,7 @@ func TestAccMuteTiming_RemoveInUseInAlertRule(t *testing.T) { | |
} | ||
} | ||
resource "grafana_mute_timing" "test" { | ||
count = local.use_mute ? 1 : 0 | ||
name = "%[1]s" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters