fix(utils): return updated ctx in SetAndLogStateFields func (#1100)

This commit is contained in:
Ruben Hönle 2025-12-18 15:37:56 +01:00 committed by GitHub
parent 6c39e50b04
commit 459122c88e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 29 additions and 28 deletions

View file

@ -176,9 +176,10 @@ func CheckListRemoval(ctx context.Context, configModelList, planModelList types.
}
// SetAndLogStateFields writes the given map of key-value pairs to the state
func SetAndLogStateFields(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, values map[string]any) {
func SetAndLogStateFields(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, values map[string]any) context.Context {
for key, val := range values {
ctx = tflog.SetField(ctx, key, val)
diags.Append(state.SetAttribute(ctx, path.Root(key), val)...)
}
return ctx
}