fix(terraform): mark state partial on a rejected key update

#40512 added d.Partial(true) to resourceKeyUpdate, but it landed on the
plannedKeyMetadata error path rather than the c.UpdateKey one. The test it
shipped with drives a 400 from /key/update, which returns through the
UpdateKey branch, so TestResourceKeyUpdateFailureKeepsPriorState has been
failing on litellm_internal_staging since it merged

Set the flag on the UpdateKey branch too. Without it the SDK hands back the
diff-applied state, so a rejected update persists the planned values and the
next plan reports no changes, silently dropping the update
This commit is contained in:
SK2iP 2026-09-10 19:24:40 +03:30
parent 600544837e
commit 2658eeaf6e

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))
}