-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use StringPointerValue instead of StringValue
As `StringPointerValue` properly handles nil values. For NICs retrieved via API it's possible that the `vm_name` field is null, see https://github.com/ubicloud/ubicloud/blob/2c7862fcbc5010d4efff4aebcb96200fd123cf1e/serializers/nic.rb#L10. In internal/provider/private_subnet_datasource.go we do the following assignment without properly checking for nil values. ``` "vm_name": types.StringValue(*n.VmName), ``` In this PR, we switch from `StringValue` to `StringPointerValue` for this and related fields as it properly handles nil values. Even though these other fields should never be null it's safer to still perform this check, e.g. in case the Ubicloud API goes through changes. Acceptance tests have passed: https://github.com/ubicloud/terraform-provider-ubicloud/actions/runs/12128430149
- Loading branch information
Showing
4 changed files
with
18 additions
and
18 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