terraform-provider-linode
terraform-provider-linode copied to clipboard
fix: Check for errors before setting log fields in `linode_object_storage_key`
📝 Description
This change resolves an issue that would result in a panic when attempting to provision a linode_object_storage_key
resource with invalid options. This is because a helper.SetLogFieldBulk(...)
call was accidentally inserted before the OBJ key creation error check.
Resolves #1334
✔️ How to Test
The following test steps assume you have pulled down this PR locally.
Integration Testing
make PKG_NAME=linode/objkey int-test
Manual Testing
- In a Terraform provider sandbox environment (e.g. dx-devenv), apply the following configuration:
# ...
resource "linode_object_storage_key" "test" {
label = "extremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabel"
}
- Ensure the provider does not panic and instead a human-readable error is raised.