You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed new testcase for setting palette_flip = true
[Failed testcase after attempting to fix issue by using a map[string]interface instead of a map[string]interface{}(https://gist.github.com/dustinlindquist/f93cea9d87e74b3f763dcd43575cdbf6)
Expected Behavior
If include a style.palette_flip of true or false in a call to update a datadog timeboard:
style {
palette_flip = true
}
I would expect the call to datadog to include this field and change it respectively.
Actual Behavior
The palette_flip field is not modified and remains defaulted to false.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
add the graph.style.palette_flip = true to "config2" in the resource_datadog_timeboard_test.go
add a valid expectation to the step2.Checks
run the tests and observe the failure.
One can also reproduce this by attempting to set the palette_flip field to true on any hostmap for any timeboard they're trying to update.
Important Factoids
The cause of this appears to be that the graph.style field is a map[string]string{}, forcing the need for the boolean field to be passed as a string. Upon changing it to a map[string]interface{}{} the issue then appears to be related to the 'WeaklyTypeInput' config option from mitchellh/mapstrucutre
Terraform Version
Terraform v0.10.7
Affected Resource(s)
Debug Output
Failed new testcase for setting palette_flip = true
[Failed testcase after attempting to fix issue by using a map[string]interface instead of a map[string]interface{}(https://gist.github.com/dustinlindquist/f93cea9d87e74b3f763dcd43575cdbf6)
Expected Behavior
If include a style.palette_flip of true or false in a call to update a datadog timeboard:
I would expect the call to datadog to include this field and change it respectively.
Actual Behavior
The palette_flip field is not modified and remains defaulted to false.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
add the graph.style.palette_flip = true to "config2" in the resource_datadog_timeboard_test.go
add a valid expectation to the step2.Checks
run the tests and observe the failure.
One can also reproduce this by attempting to set the palette_flip field to true on any hostmap for any timeboard they're trying to update.
Important Factoids
The cause of this appears to be that the graph.style field is a map[string]string{}, forcing the need for the boolean field to be passed as a string. Upon changing it to a map[string]interface{}{} the issue then appears to be related to the 'WeaklyTypeInput' config option from mitchellh/mapstrucutre
that field defaults to false when the decoder is initialized
locally if I set that decoder config to:
then my fix of the graph.style being a map of interfaces instead of a map of strings works.
I've thrown up a branch with my work: https://github.com/dustinlindquist/terraform-provider-datadog/tree/issue29-palette_flip-as-bool
cc @mitchellh
The text was updated successfully, but these errors were encountered: