-
Notifications
You must be signed in to change notification settings - Fork 105
impl framework data_source.fleet_enrollment_tokens #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
daemitus
commented
Sep 18, 2024
- Migrated the fleet enrollment_tokens data_source to the plugin framework.
- removed resource.isReady from several places, added the same check to ConvertProviderData. The error will propagate up when resource.Configure is called, no need to keep it in the CRUD methods.
- converted the enrollment_token fleet APIs to return fwdiags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for converting this! Are you able to add an entry to CHANGELOG.md for this?
|
||
// SliceToListType converts a tfsdk naive []T1 into an types.List of []T2. | ||
// This handles both structs and simple types to attr.Values. | ||
func SliceToListType[T1 any, T2 any](ctx context.Context, value []T1, elemType attr.Type, path path.Path, diags diag.Diagnostics, iteratee func(item T1) T2) types.List { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your hot take on helpers like this? While its not much of a problem in this data_source, I've had a ton of issues with naive slices as compared to types.List members. In the more complicated nested structs, these let you just inline a lot of boilerplate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think there's likely a lot of room for more helpers like this in this codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 love it. Thanks again for this!
* origin/main: (39 commits) chore(deps): update golang:1.23.1 docker digest to 4f063a2 (#804) fix(deps): update module github.com./go-resty/resty/v2 to v2.15.3 (#781) fix for http/tcp monitor produces inconsistent result after apply (#801) chore(deps): update docker.elastic.co/elasticsearch/elasticsearch docker tag to v8.15.2 (#798) chore(deps): update docker.elastic.co/kibana/kibana docker tag to v8.15.2 (#799) Bump github.com./oapi-codegen/oapi-codegen/v2 in /tools (#808) Bump github.com./oapi-codegen/oapi-codegen/v2 from 2.4.0 to 2.4.1 (#806) Bump actions/checkout from 4.1.7 to 4.2.0 (#807) more fleet framework migrations (#785) Apply the sys_monitoring attribute during creation (#792) fix(deps): update module github.com./oapi-codegen/oapi-codegen/v2 to v2.4.0 (#788) fix(docs): indices datesource example field (#786) fix(deps): update module github.com./hashicorp/terraform-plugin-framework to v1.12.0 (#782) chore(deps): pin golang docker tag to 2fe82a3 (#783) Remove GO_VERSION indirection Fix release pipeline Prepare release v0.11.7 fix(deps): update module github.com./goreleaser/goreleaser/v2 to v2.3.2 (#776) impl framework data_source.fleet_enrollment_tokens (#778) Add support for the `alerts_filter` param in the Create Rule API (#774) ...