fix(terraform): restore d.Partial(true) on a rejected /key/update (#40527)

The squash of #40512 onto a base that already carried #40514 left the Partial call on the metadata pre-read error path only, so a rejected /key/update again persisted the planned values into state and TestResourceKeyUpdateFailureKeepsPriorState fails on the default branch.

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-09-10 11:09:18 -07:00 committed by GitHub
parent e907e5ee9b
commit 2bf065f97d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -327,6 +327,7 @@ func resourceKeyUpdate(ctx context.Context, d *schema.ResourceData, m interface{
key.Metadata = metadata
if _, err := c.UpdateKey(key); err != nil {
d.Partial(true)
return diag.FromErr(fmt.Errorf("error updating key: %s", err))
}