mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Also fix HCL field name for MuteTimeIntervals (#87079)
* Correct HCL field name for MuteTimeIntervals * Update test
This commit is contained in:
parent
5e060d2d99
commit
93519f70ca
@ -694,12 +694,12 @@ func TestProvisioningApi(t *testing.T) {
|
||||
is_paused = false
|
||||
|
||||
notification_settings {
|
||||
contact_point = "Test-Receiver"
|
||||
group_by = ["alertname", "grafana_folder", "test"]
|
||||
group_wait = "1s"
|
||||
group_interval = "5s"
|
||||
repeat_interval = "5m"
|
||||
mute_time_intervals = ["test-mute"]
|
||||
contact_point = "Test-Receiver"
|
||||
group_by = ["alertname", "grafana_folder", "test"]
|
||||
group_wait = "1s"
|
||||
group_interval = "5s"
|
||||
repeat_interval = "5m"
|
||||
mute_timings = ["test-mute"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ resource "grafana_rule_group" "rule_group_0000" {
|
||||
is_paused = false
|
||||
|
||||
notification_settings {
|
||||
contact_point = "Test-Receiver"
|
||||
group_by = ["alertname", "grafana_folder", "test"]
|
||||
group_wait = "1s"
|
||||
group_interval = "5s"
|
||||
repeat_interval = "5m"
|
||||
mute_time_intervals = ["test-mute"]
|
||||
contact_point = "Test-Receiver"
|
||||
group_by = ["alertname", "grafana_folder", "test"]
|
||||
group_wait = "1s"
|
||||
group_interval = "5s"
|
||||
repeat_interval = "5m"
|
||||
mute_timings = ["test-mute"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -291,13 +291,15 @@ type RelativeTimeRangeExport struct {
|
||||
}
|
||||
|
||||
// AlertRuleNotificationSettingsExport is the provisioned export of models.NotificationSettings.
|
||||
// Field name mismatches with Terraform provider schema are noted where applicable.
|
||||
type AlertRuleNotificationSettingsExport struct {
|
||||
// Terraform provider uses `contact_point`, so export the field with that name in HCL.
|
||||
// TF -> `contact_point`
|
||||
Receiver string `yaml:"receiver,omitempty" json:"receiver,omitempty" hcl:"contact_point"`
|
||||
|
||||
GroupBy []string `yaml:"group_by,omitempty" json:"group_by,omitempty" hcl:"group_by"`
|
||||
GroupWait *string `yaml:"group_wait,omitempty" json:"group_wait,omitempty" hcl:"group_wait,optional"`
|
||||
GroupInterval *string `yaml:"group_interval,omitempty" json:"group_interval,omitempty" hcl:"group_interval,optional"`
|
||||
RepeatInterval *string `yaml:"repeat_interval,omitempty" json:"repeat_interval,omitempty" hcl:"repeat_interval,optional"`
|
||||
MuteTimeIntervals []string `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty" hcl:"mute_time_intervals"`
|
||||
GroupBy []string `yaml:"group_by,omitempty" json:"group_by,omitempty" hcl:"group_by"`
|
||||
GroupWait *string `yaml:"group_wait,omitempty" json:"group_wait,omitempty" hcl:"group_wait,optional"`
|
||||
GroupInterval *string `yaml:"group_interval,omitempty" json:"group_interval,omitempty" hcl:"group_interval,optional"`
|
||||
RepeatInterval *string `yaml:"repeat_interval,omitempty" json:"repeat_interval,omitempty" hcl:"repeat_interval,optional"`
|
||||
// TF -> `mute_timings`
|
||||
MuteTimeIntervals []string `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty" hcl:"mute_timings"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user