Closed sjwl closed 5 years ago
Give that a shot - I'm not sure it'll fix your issue, but it won't hurt either.
Hi, so this is not actually having the effect that you think it is and is causing some buggy behaviour downstream.
When you serialise a Go struct into a JSON object with omitempty
it will omit the field entirely if it is a zero value. In Go a boolean's zero value is false, and as the default for configure_for_dns in Infoblox is true, this makes it impossible to set that value to false.
The actual root cause you're seeing is that "configure_for_dns"
needs to be added as a return field in the Infoblox options when instantiating with infobloxClient.GetRecordHost(ref, opts)
. Whether this should be done in go-infoblox
or the terraform provider I'm not sure, but I'm going to add to the provider anyway.
I'll also open a PR reversing this shortly.
Cheers!
Thanks for following up. I see that Infoblox has created an official Go library, so I'll recommend any new changes go on their repository.
for some reason configure_for_dns is not returned when getting Host Record by reference
And therefore, since
configure_for_dns
is omitted,ConfigureForDNS
member ofRecordHostObject
will always be interpreted tofalse
, even if it's actuallytrue
in InfoBlox. A simple fix could be to fix this lineto
The use case exposing this issue: https://github.com/prudhvitella/terraform-provider-infoblox/issues/46
The following commit caused this issue: 7aa0907ee451547e97867213c63661a567f4f6f2