-
Notifications
You must be signed in to change notification settings - Fork 61
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
Some boolean params can't be reset and the provider does not understand the value #253
Comments
Hi! |
Can't this be somehow mitigated? This behavior is predictable by checking the resource parameters' table on the ROS docs/wiki (instead of yes/no, there is an empty "()" datatype). If we were to somehow implement a secondary boolean type to handle these kind of parameters, or just somehow make a toggle and annotate the affected resources in the provider code base, to handle the API differently? I am just speculating here, though. I don't know the intricacies of Go and what flexibility does the Terraform provider SDK allow... |
Let's just say that if a fix needs to be released quickly, only a forced recreation of the resource is the way to go. If there is no hurry, we can try (with no guarantee that everything will work quickly and well) to annotate the fields requiring unset. But! this will require serious changes in the main code, which is responsible for converting TF and MT parameters. |
🎉 This issue has been resolved in version 1.20.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Describe the bug
On some boolean fields of some resources the value can't be set to false and the provider does not understand the current value. This issue originates from the fact, that in the RouterOS API not all booleans are treated the same way and some need to be "unset" instead of "set" to "false". One instance is the
passive
parameter on therouteros_routing_ospf_interface_template
resource.The problem resides in the handling of boolean values in the data serialization code, which does not differentiate between classic boolean states and these set/unset params. This behaviour can clearly be seen in the behaviour in the ROS console or API:
In case of the REST API, it's just a matter of prefixing the PATCH's data map key with "!" to unset the value. The set/unset status is reflected in the existence of the parameter in the response json, not on its value.
The text was updated successfully, but these errors were encountered: