fix(utils): return updated ctx in SetAndLogStateFields func (#1100)
This commit is contained in:
parent
6c39e50b04
commit
459122c88e
21 changed files with 29 additions and 28 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue