Skip to content

Commit

Permalink
Add proper decoding and encoding for critical severity for team notif…
Browse files Browse the repository at this point in the history
…ication policy (#560)
  • Loading branch information
bjachowicz authored Jan 17, 2025
1 parent f46c062 commit c59a5c3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions internal/definition/team/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ func decodeTerraform(rd *schema.ResourceData) (*team.Team, error) {
t.Members = append(t.Members, m.(string))
}
for name, field := range map[string]*[]*notification.Notification{
"notifications_default": &t.NotificationLists.Default,
"notifications_info": &t.NotificationLists.Info,
"notifications_minor": &t.NotificationLists.Minor,
"notifications_warning": &t.NotificationLists.Warning,
"notifications_major": &t.NotificationLists.Major,
"notifications_default": &t.NotificationLists.Default,
"notifications_info": &t.NotificationLists.Info,
"notifications_minor": &t.NotificationLists.Minor,
"notifications_warning": &t.NotificationLists.Warning,
"notifications_major": &t.NotificationLists.Major,
"notifications_critical": &t.NotificationLists.Critical,
} {
if val, ok := rd.Get(name).([]any); ok && len(val) > 0 {
var err error
Expand Down Expand Up @@ -140,11 +141,12 @@ func encodeTerraform(tm *team.Team, rd *schema.ResourceData) error {
}

for name, values := range map[string][]*notification.Notification{
"notifications_default": tm.NotificationLists.Default,
"notifications_info": tm.NotificationLists.Info,
"notifications_minor": tm.NotificationLists.Minor,
"notifications_warning": tm.NotificationLists.Warning,
"notifications_major": tm.NotificationLists.Major,
"notifications_default": tm.NotificationLists.Default,
"notifications_info": tm.NotificationLists.Info,
"notifications_minor": tm.NotificationLists.Minor,
"notifications_warning": tm.NotificationLists.Warning,
"notifications_major": tm.NotificationLists.Major,
"notifications_critical": tm.NotificationLists.Critical,
} {
if len(values) == 0 {
continue
Expand Down

0 comments on commit c59a5c3

Please sign in to comment.