Extend DSA Reads to compute plan name and version from plan ID (#20)
* Extend Read to compute plan name and version from plan ID * Lint * Fix error handling; Pass client to loadPlanNameAndVersion * Change error to warning * Replicate to other DSA * Update acc tests to test import of plan name and version
This commit is contained in:
parent
7f35b5a1dc
commit
386ccac6b4
18 changed files with 240 additions and 42 deletions
|
|
@ -191,6 +191,13 @@ func (r *instanceDataSource) Read(ctx context.Context, req datasource.ReadReques
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Mapping fields", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Compute and store values not present in the API response
|
||||
loadPlanNameAndVersion(ctx, r.client, &resp.Diagnostics, &state)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
// Set refreshed state
|
||||
diags = resp.State.Set(ctx, &state)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue