Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore the change of no_data_timeframe if notify_no_data is false #384

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions datadog/resource_datadog_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ func resourceDatadogMonitor() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Default: 10,
DiffSuppressFunc: func(k, oldVal, newVal string, d *schema.ResourceData) bool {
if !d.Get("notify_no_data").(bool) {
if newVal != oldVal {
log.Printf("[DEBUG] Ignore the no_data_timeframe change of monitor '%s' because notify_no_data is false.", d.Get("name"))
}
return true
}
return newVal == oldVal
},
},
"renotify_interval": {
Type: schema.TypeInt,
Expand Down