Skip to content

Commit

Permalink
notify_on_ok is true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Oct 18, 2024
1 parent 477e85d commit 1eab187
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sql/resource_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func ResourceAlert() common.Resource {
strings.TrimPrefix(f, "condition.0.threshold.0.value.0.")).SetExactlyOneOf(alof)
}
common.CustomizeSchemaPath(m, "owner_user_name").SetSuppressDiff()
common.CustomizeSchemaPath(m, "notify_on_ok").SetSuppressDiff()
common.CustomizeSchemaPath(m, "notify_on_ok").SetDefault(true)
common.CustomizeSchemaPath(m, "id").SetReadOnly()
common.CustomizeSchemaPath(m, "create_time").SetReadOnly()
common.CustomizeSchemaPath(m, "lifecycle_state").SetReadOnly()
Expand Down
4 changes: 4 additions & 0 deletions sql/resource_alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var (
},
},
ParentPath: "/Workspace/Shared/Alerts",
NotifyOnOk: true,
}
createHcl = `query_id = "123456"
display_name = "TF new alert"
Expand All @@ -55,6 +56,7 @@ var (
QueryId: "123456",
DisplayName: "TF new alert",
ParentPath: "/Shared/Alerts",
NotifyOnOk: true,
Condition: &sql.AlertCondition{
Op: "GREATER_THAN",
Operand: &sql.AlertConditionOperand{
Expand Down Expand Up @@ -195,6 +197,7 @@ func TestAlertUpdate(t *testing.T) {
QueryId: "123456",
DisplayName: "TF new alert",
OwnerUserName: "user@domain.com",
NotifyOnOk: false,
Condition: &sql.AlertCondition{
Op: "GREATER_THAN",
Operand: &sql.AlertConditionOperand{
Expand Down Expand Up @@ -224,6 +227,7 @@ func TestAlertUpdate(t *testing.T) {
HCL: `query_id = "123456"
display_name = "TF new alert"
owner_user_name = "user@domain.com"
notify_on_ok = false
condition {
op = "GREATER_THAN"
operand {
Expand Down

0 comments on commit 1eab187

Please sign in to comment.