generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 139
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 (#432)
* 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. Updates to latest fbreckle/go-netbox to support the change. * test: Add test for permission resource without constraint --------- Co-authored-by: Fabian Breckle <fabian.breckle@breuninger.de>
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters