You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
err=fmt.Errorf("Cannot walk attribute path in plan: %w", err)
184
+
diags.AddAttributeError(
185
+
path,
186
+
"Plan Write Error",
187
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
188
+
)
189
+
returnnil, diags
190
+
}
191
+
192
+
iflen(remaining.Steps()) ==0 {
193
+
// Overwrite existing value
194
+
returnfunc(p*tftypes.AttributePath, v tftypes.Value) (tftypes.Value, error) {
err=fmt.Errorf("error getting parent attribute type in schema: %w", err)
208
+
diags.AddAttributeError(
209
+
parentPath,
210
+
"Plan Write Error",
211
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
"An unexpected error was encountered trying to read an attribute from the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
249
+
fmt.Sprintf("Cannot add attribute into parent type: %s", parentValue.Type()),
250
+
)
251
+
returnnil, diags
252
+
}
253
+
254
+
varparentAttrsmap[string]tftypes.Value
255
+
err=parentValue.Copy().As(&parentAttrs)
256
+
257
+
iferr!=nil {
258
+
diags.AddAttributeError(
259
+
parentPath,
260
+
"Plan Write Error",
261
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
262
+
fmt.Sprintf("Unable to extract object elements from parent value: %s", err),
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
276
+
fmt.Sprintf("Cannot add list element into parent type: %s", parentValue.Type()),
277
+
)
278
+
returnnil, diags
279
+
}
280
+
281
+
varparentElems []tftypes.Value
282
+
err=parentValue.Copy().As(&parentElems)
283
+
284
+
iferr!=nil {
285
+
diags.AddAttributeError(
286
+
parentPath,
287
+
"Plan Write Error",
288
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
289
+
fmt.Sprintf("Unable to extract list elements from parent value: %s", err),
290
+
)
291
+
returnnil, diags
292
+
}
293
+
294
+
ifint(step) >len(parentElems) {
295
+
diags.AddAttributeError(
296
+
parentPath,
297
+
"Plan Write Error",
298
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
299
+
fmt.Sprintf("Cannot add list element %d as list currently has %d length. To prevent ambiguity, SetAttribute can only add the next element to a list. Add empty elements into the list prior to this call, if appropriate.", int(step)+1, len(parentElems)),
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
313
+
fmt.Sprintf("Cannot add map value into parent type: %s", parentValue.Type()),
314
+
)
315
+
returnnil, diags
316
+
}
317
+
318
+
varparentElemsmap[string]tftypes.Value
319
+
err=parentValue.Copy().As(&parentElems)
320
+
321
+
iferr!=nil {
322
+
diags.AddAttributeError(
323
+
parentPath,
324
+
"Plan Write Error",
325
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
326
+
fmt.Sprintf("Unable to extract map elements from parent value: %s", err),
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
340
+
fmt.Sprintf("Cannot add set element into parent type: %s", parentValue.Type()),
341
+
)
342
+
returnnil, diags
343
+
}
344
+
345
+
varparentElems []tftypes.Value
346
+
err=parentValue.Copy().As(&parentElems)
347
+
348
+
iferr!=nil {
349
+
diags.AddAttributeError(
350
+
parentPath,
351
+
"Plan Write Error",
352
+
"An unexpected error was encountered trying to write an attribute to the plan. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
353
+
fmt.Sprintf("Unable to extract set elements from parent value: %s", err),
0 commit comments