mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
fix(terraform): call Partial(true) on rejected /key/update so state keeps prior values
PR #40512 added d.Partial(true) only to the plannedKeyMetadata error branch of resourceKeyUpdate, but not to the c.UpdateKey error branch. When the proxy rejects an update (e.g. budget_duration='bad' returns 400), the SDK still persisted the planned values into state, dropping the update silently on the next plan. This adds d.Partial(true) to that branch, matching what TestResourceKeyUpdateFailureKeepsPriorState expects. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
87e2026f0a
commit
925601810a
1 changed files with 1 additions and 0 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue