terraform-provider-linode icon indicating copy to clipboard operation
terraform-provider-linode copied to clipboard

fix: Check for errors before setting log fields in `linode_object_storage_key`

Open lgarber-akamai opened this issue 11 months ago • 0 comments

📝 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

  1. In a Terraform provider sandbox environment (e.g. dx-devenv), apply the following configuration:
# ...

resource "linode_object_storage_key" "test" {
  label = "extremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabelextremelylonglabel"
}
  1. Ensure the provider does not panic and instead a human-readable error is raised.

lgarber-akamai avatar Mar 06 '24 20:03 lgarber-akamai