-
Notifications
You must be signed in to change notification settings - Fork 109
Migrate Data Source ListNestedBlocks to ListNestedAttributes #2160
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
Migrate Data Source ListNestedBlocks to ListNestedAttributes #2160
Conversation
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.
Pull Request Overview
This PR refactors data source schemas across multiple files to migrate from ListNestedBlock to ListNestedAttribute, aligning with Terraform framework best practices. The change moves list-type nested structures from the Blocks section to the Attributes section of the schema definition.
Key Changes:
- Migrated list-type nested structures from
schema.ListNestedBlocktoschema.ListNestedAttribute - Added
Computed: trueflag to all migrated list nested attributes - Moved nested structures from the
Blocksmap to theAttributesmap in schema definitions
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| linode/volumetypes/framework_datasource_schema.go | Migrated "types" from ListNestedBlock to ListNestedAttribute; removed unused volumeTypeSchema variable |
| linode/users/framework_datasource_schema.go | Migrated "users" list from Blocks to Attributes |
| linode/sshkeys/framework_datasource_schema.go | Migrated "sshkeys" list from Blocks to Attributes |
| linode/regions/framework_datasource_schema.go | Migrated "regions" list from Blocks to Attributes; removed reference to region.DataSourceSchema.Blocks |
| linode/region/framework_datasource_schema.go | Migrated "resolvers" list from Blocks to Attributes |
| linode/objquotas/framework_datasource_schema.go | Migrated "quotas" list from Blocks to Attributes |
| linode/objendpoints/framework_datasource_schema.go | Migrated "endpoints" list from Blocks to Attributes |
| linode/networktransferprices/framework_datasource_schema.go | Migrated "types" list from Blocks to Attributes; removed networkTransferPriceSchema variable |
| linode/nbtypes/framework_datasource_schema.go | Migrated "types" list from Blocks to Attributes; removed nodebalancerTypeSchema variable |
| linode/nb/framework_datasource_schema.go | Migrated nested firewall structures including "firewalls", "inbound", "outbound" from Blocks to Attributes |
| linode/maintenancepolicies/framework_datasource_schema.go | Migrated "maintenance_policies" list from Blocks to Attributes; renamed maintenancePolicyObject to maintenancePolicyAttributes |
| linode/lkeversions/framework_datasource_schema.go | Migrated "versions" list from Blocks to Attributes; removed lkeVersionSchema variable |
| linode/lketypes/framework_datasource_schema.go | Migrated "types" list from Blocks to Attributes; modified lkeTypeSchema to empty object |
| linode/lkeclusters/framework_datasource_schema.go | Migrated "lke_clusters" and "control_plane" from Blocks to Attributes |
| linode/lke/framework_datasource_schema.go | Migrated multiple nested structures including "control_plane", "acl", "addresses", "pools", "nodes", "autoscaler", and "disks" from Blocks to Attributes |
| linode/kernels/framework_datasource_schema.go | Migrated "kernels" list from Blocks to Attributes |
| linode/ipv6ranges/framework_datasource_schema.go | Migrated "ranges" list from Blocks to Attributes |
| linode/instancetypes/framework_datasource_schema.go | Migrated "types" list from Blocks to Attributes; removed instanceTypeSchema variable |
| linode/databases/framework_datasource_schema.go | Migrated "databases" list from Blocks to Attributes |
| linode/databaseengines/framework_datasource_schema.go | Migrated "engines" list from Blocks to Attributes; renamed engineSchema to engineAttributes |
| linode/databasebackups/framework_datasource_schema.go | Migrated "backups" list from Blocks to Attributes; renamed backupSchema to backupAttributes |
| linode/childaccounts/framework_datasource_schema.go | Migrated "child_accounts" list from Blocks to Attributes |
| linode/accountlogins/framework_datasource_schema.go | Migrated "logins" list from Blocks to Attributes; removed accountLoginSchema variable |
| linode/accountavailabilities/framework_datasource_schema.go | Migrated "availabilities" list from Blocks to Attributes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f8a4f10 to
a8b1b57
Compare
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.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ezilber-akamai
left a comment
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.
Nice work! It will be so nice to have this consistency across the board.
📝 Description
This PR refactors migrates any computed-only blocks in data sources to their attribute equivalents.
This change resolves various block-related issues, including blocks not being refreshed in time for references to properly reflect their states.
CI E2E test run: https://github.com/linode/terraform-provider-linode/actions/runs/19151178867
Partial workaround for #1952 (allows data source usage during apply)
✔️ How to Test
The following test steps assume you have pulled down this PR locally.
Integration Testing