Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: netbox_permission plan constraint diff
Every run of the `netbox_permission` resource when there was no constraint set would output the following diff: ``` netbox_permission.ipaddress_rw_permission will be updated in-place ~ resource "netbox_permission" "ipaddress_rw_permission" { - constraints = "null" -> null id = "3" name = "ipaddress_rw_permissions" ``` There are inherently two issues that cause the problem. We cannot null the field, because of the issue fixed here: fbreckle/go-netbox#30 Second, want the constraint field to be set to an empty string when a read of constraint is empty. So we check if nil, and if so we set constraint to "", and then return the function. Otherwise, we Marshal it to JSON to fill the tf state.
- Loading branch information