Skip to content

Commit

Permalink
Fix drift for empty time_restriction (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjacquet authored Nov 17, 2023
1 parent d9700b2 commit 2fcd3dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions opsgenie/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ func expandOpsGenieTimeRestriction(d []interface{}) *og.TimeRestriction {

func flattenOpsgenieTimeRestriction(input *og.TimeRestriction) []map[string]interface{} {
output := make([]map[string]interface{}, 0, 1)
if input == nil || input.Type == "" {
// If type is not set, time restriction should be empty.
return output
}

element := make(map[string]interface{})

if len(input.RestrictionList) > 0 {
Expand Down

0 comments on commit 2fcd3dd

Please sign in to comment.