Skip to content

Commit de4187a

Browse files
Merge branch 'main' into IPE-1293-OOTB-policy-PCI-DSS-for-AWS
2 parents ddfb35e + 1c0d224 commit de4187a

File tree

2 files changed

+32
-27
lines changed
  • content
    • hcp-docs/content/docs/vault-radar/cli
    • terraform-plugin-framework/v1.16.x/docs/plugin/framework/list-resources

2 files changed

+32
-27
lines changed

content/hcp-docs/content/docs/vault-radar/cli/changelog.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ description: |-
88
# Changelog
99

1010
Keep track of changes to the Vault Radar CLI
11+
### 0.37.0
12+
- added support for `scan tfe-variables` uploading results to a users HCP Vault Radar project
13+
- Minor bug fixes and performance improvements
14+
15+
### 0.36.0
16+
- added support for `scan aws-parameter-store` uploading results to a users HCP Vault Radar project
17+
- Minor bug fixes and performance improvements
18+
19+
### 0.35.0
20+
- added support for `scan file` uploading results to a users HCP Vault Radar project
21+
- Minor bug fixes and performance improvements
1122

1223
### 0.34.0
1324
- `scan folder` and `scan s3` support uploading results to a users HCP Vault Radar project
14-
- Minor bug fixes and performance improvementsg
25+
- Minor bug fixes and performance improvements
1526

1627
### 0.33.0
1728
- Minor bug fixes and performance improvements

content/terraform-plugin-framework/v1.16.x/docs/plugin/framework/list-resources/list.mdx

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ func (r *ThingListResource) List(ctx context.Context, req list.ListRequest, stre
4545
var data ThingListResourceModel
4646

4747
// Read list config data into the model
48-
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
49-
if resp.Diagnostics.HasError() {
48+
diags := req.Config.Get(ctx, &data)...
49+
if diags.HasError() {
50+
stream.Results = list.ListResultsStreamDiagnostics(diags)
5051
return
5152
}
5253

@@ -57,30 +58,23 @@ func (r *ThingListResource) List(ctx context.Context, req list.ListRequest, stre
5758
// Define the function that will push results into the stream
5859
stream.Results = func(push func(list.ListResult) bool) {
5960
for _, thing := range things {
60-
// Initialize a new result object for each thing
61-
result := req.NewListResult(ctx)
62-
63-
// Set the user-friendly name of this thing
64-
result.DisplayName = thing.Name
65-
66-
// Set resource identity data on the result
67-
resp.Diagnostics.Append(result.Identity.Set(ctx, thing.ID))
68-
if resp.Diagnostics.HasError() {
69-
return
70-
}
71-
72-
// Set the resource information on the result
73-
resp.Diagnostics.Append(result.Resource.Set(ctx, thing.Resource))
74-
if resp.Diagnostics.HasError() {
75-
return
76-
}
77-
78-
// Send the result to the stream.
79-
if !push(result) {
80-
return
81-
}
82-
}
83-
}
61+
// Initialize a new result object for each thing
62+
result := req.NewListResult(ctx)
63+
64+
// Set the user-friendly name of this thing
65+
result.DisplayName = thing.Name
66+
67+
// Set resource identity data on the result
68+
result.Diagnostics.Append(result.Identity.Set(ctx, thing.ID))
69+
70+
// Set the resource information on the result
71+
result.Diagnostics.Append(result.Resource.Set(ctx, thing.Resource))
72+
73+
// Send the result to the stream.
74+
if !push(result) {
75+
return
76+
}
77+
}
8478
}
8579
```
8680

0 commit comments

Comments
 (0)