Skip to content

Commit

Permalink
Fix 1429 Fix empty retriggering seconds on alerts resource
Browse files Browse the repository at this point in the history
  • Loading branch information
kavya498 committed Aug 20, 2024
1 parent 32fec88 commit 63d722e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibm/service/logs/resource_ibm_logs_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,11 +1269,13 @@ func ResourceIbmLogsAlert() *schema.Resource {
"retriggering_period_seconds": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Retriggering period of the alert in seconds.",
},
"notify_on": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Notify on setting.",
},
"integration_id": &schema.Schema{
Expand Down Expand Up @@ -2484,7 +2486,8 @@ func ResourceIbmLogsAlertMapToAlertsV2AlertNotificationGroups(modelMap map[strin

func ResourceIbmLogsAlertMapToAlertsV2AlertNotification(modelMap map[string]interface{}) (logsv0.AlertsV2AlertNotificationIntf, error) {
model := &logsv0.AlertsV2AlertNotification{}
if modelMap["retriggering_period_seconds"] != nil {

if modelMap["retriggering_period_seconds"] != nil && modelMap["retriggering_period_seconds"] != 0 {
model.RetriggeringPeriodSeconds = core.Int64Ptr(int64(modelMap["retriggering_period_seconds"].(int)))
}
if modelMap["notify_on"] != nil && modelMap["notify_on"].(string) != "" {
Expand Down

0 comments on commit 63d722e

Please sign in to comment.