-
Notifications
You must be signed in to change notification settings - Fork 390
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
Handle 0 in monitor new_host_delay #726
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Terraform doesn't return 0 values on fields, but it's appropropriate for new_host_delay on the monitor resource. Let's make sure we send it in this case.
527819b
to
a9c5f15
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
o.SetNewHostDelay(int64(attr.(int))) | ||
} | ||
// Don't check with GetOk, doesn't work with 0 | ||
o.SetNewHostDelay(int64(d.Get("new_host_delay").(int))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if new_host_delay isn't actually set ? This will error out no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a default so it should always be set I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, do we have a test case for it to make sure ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah tests like TestAccDatadogMonitor_SilencedRemove ought to trigger this.
Terraform doesn't return 0 values on fields, but it's appropropriate for
new_host_delay on the monitor resource. Let's make sure we send it in
this case.