Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory committed May 8, 2020
1 parent 3e30632 commit dd63f6a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions datadog/resource_datadog_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,21 @@ func buildMonitorStruct(d *schema.ResourceData) *datadogV1.Monitor {
}

monitorType := datadogV1.MonitorType(d.Get("type").(string))
m := datadogV1.NewMonitor()
m.SetType(monitorType)
m.SetQuery(d.Get("query").(string))
m.SetName(d.Get("name").(string))
m.SetMessage(d.Get("message").(string))
m.SetOptions(o)

if m.GetType() == datadogV1.MONITORTYPE_LOG_ALERT {
if monitorType == datadogV1.MONITORTYPE_LOG_ALERT {
if attr, ok := d.GetOk("enable_logs_sample"); ok {
o.SetEnableLogsSample(attr.(bool))
} else {
o.SetEnableLogsSample(false)
}
}

m := datadogV1.NewMonitor()
m.SetType(monitorType)
m.SetQuery(d.Get("query").(string))
m.SetName(d.Get("name").(string))
m.SetMessage(d.Get("message").(string))
m.SetOptions(o)

tags := make([]string, 0)
if attr, ok := d.GetOk("tags"); ok {
for _, s := range attr.(*schema.Set).List() {
Expand Down

0 comments on commit dd63f6a

Please sign in to comment.