Skip to content

Conversation

@lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Nov 5, 2025

📝 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

make test-int

@lgarber-akamai lgarber-akamai added the improvement for improvements in existing functionality in the changelog. label Nov 5, 2025
Copy link
Contributor

Copilot AI left a 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.ListNestedBlock to schema.ListNestedAttribute
  • Added Computed: true flag to all migrated list nested attributes
  • Moved nested structures from the Blocks map to the Attributes map 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.

Copy link
Contributor

Copilot AI left a 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.

@lgarber-akamai lgarber-akamai force-pushed the ref/migrate-lke-ds-to-nested-attributes branch from f8a4f10 to a8b1b57 Compare November 5, 2025 17:34
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@lgarber-akamai lgarber-akamai marked this pull request as ready for review November 6, 2025 22:03
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner November 6, 2025 22:03
@lgarber-akamai lgarber-akamai requested review from ezilber-akamai and yec-akamai and removed request for a team November 6, 2025 22:03
Copy link
Contributor

@ezilber-akamai ezilber-akamai left a 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.

@lgarber-akamai lgarber-akamai merged commit 9a681aa into linode:dev Nov 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants