From 2658eeaf6e8d776372be6866f0e8703b1c07c5ed Mon Sep 17 00:00:00 2001 From: SK2iP Date: Thu, 10 Sep 2026 19:24:40 +0330 Subject: [PATCH] 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 --- terraform/provider/litellm/resource_key.go | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/provider/litellm/resource_key.go b/terraform/provider/litellm/resource_key.go index ffdc448f5fe..018d01f75a8 100644 --- a/terraform/provider/litellm/resource_key.go +++ b/terraform/provider/litellm/resource_key.go @@ -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)) }