Allow users to set Argus metrics storage retention policy (#393)
* implement crud commands * resource testing * acceptance tests * move function to utils, cleanup tests * fix linting * use conversion pkg for int conversion, extend testing * address PR comments * address PR comments
This commit is contained in:
parent
a86f2250ad
commit
f941e53b15
5 changed files with 553 additions and 116 deletions
|
|
@ -233,7 +233,7 @@ func (d *instanceDataSource) Read(ctx context.Context, req datasource.ReadReques
|
|||
return
|
||||
}
|
||||
|
||||
aclList, err := d.client.ListACL(ctx, instanceId, projectId).Execute()
|
||||
aclListResp, err := d.client.ListACL(ctx, instanceId, projectId).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading instance", fmt.Sprintf("Calling API to list ACL data: %v", err))
|
||||
return
|
||||
|
|
@ -245,11 +245,12 @@ func (d *instanceDataSource) Read(ctx context.Context, req datasource.ReadReques
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading instance", fmt.Sprintf("Processing API payload: %v", err))
|
||||
return
|
||||
}
|
||||
err = mapACLField(aclList, &model)
|
||||
err = mapACLField(aclListResp, &model)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", fmt.Sprintf("Processing API response for the ACL: %v", err))
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading instance", fmt.Sprintf("Processing API response for the ACL: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
diags = resp.State.Set(ctx, model)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue