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

Handle 0 in monitor new_host_delay #726

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Conversation

therve
Copy link
Contributor

@therve therve commented Oct 28, 2020

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.

@therve therve requested review from a team as code owners October 28, 2020 09:52
@therve
Copy link
Contributor Author

therve commented Oct 28, 2020

/azp run

@azure-pipelines
Copy link

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.
@therve therve force-pushed the therve/monitor-zero-host-delay branch from 527819b to a9c5f15 Compare October 28, 2020 09:55
@therve
Copy link
Contributor Author

therve commented Oct 28, 2020

/azp run

@azure-pipelines
Copy link

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)))
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@therve therve merged commit b33d917 into master Oct 28, 2020
@therve therve deleted the therve/monitor-zero-host-delay branch October 28, 2020 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants