Skip to content

TPT-4297: terraform: Implement linode_tag Data Source with Reserved IPv4 Support#2330

Merged
mgwoj merged 9 commits into
linode:proj/reserved-ipsfrom
mgwoj:feature/TPT-4297-terraform-update-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4
May 12, 2026
Merged

TPT-4297: terraform: Implement linode_tag Data Source with Reserved IPv4 Support#2330
mgwoj merged 9 commits into
linode:proj/reserved-ipsfrom
mgwoj:feature/TPT-4297-terraform-update-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4

Conversation

@mgwoj
Copy link
Copy Markdown
Contributor

@mgwoj mgwoj commented Apr 14, 2026

📝 Description

The Linode API supports tagging resources via POST /tags. Tags are a lightweight organisational primitive that can be applied to Linodes, Domains, Volumes, NodeBalancers, and — as of a recent API addition — reserved IPv4 addresses.

The Terraform provider does not currently have a Framework-based linode_tag data source. Tag labels and their resource associations are already manageable through the tags field on individual resources (e.g. linode_networking_ip.tags). Adding a dedicated linode_tag resource would create a parallel, ForceNew path to a relationship that can already be managed in-place, so only the data source is implemented in this story.

✔️ How to Test

make test-unit
make test-int PKG_NAME="tag"

@mgwoj mgwoj requested review from a team as code owners April 14, 2026 12:52
@mgwoj mgwoj added the new-feature for new features in the changelog. label Apr 14, 2026
@mgwoj mgwoj requested review from jbilskiAkam and mawilk90 and removed request for a team April 14, 2026 12:52
Copy link
Copy Markdown
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

Implements a Terraform Plugin Framework-based linode_tag data source to fetch a tag’s associated objects, including support for reserved_ipv4_address associations.

Changes:

  • Added linode_tag framework data source (schema, model flattening, and Read implementation).
  • Added unit + integration tests, including a reserved IPv4 tagging scenario.
  • Registered the new data source in the framework provider and added user-facing documentation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
linode/tag/framework_datasource.go Adds the linode_tag framework data source Read implementation.
linode/tag/framework_datasource_model.go Flattens Linode API tagged-object results (incl. reserved IPv4) into TF state.
linode/tag/framework_datasource_schema.go Defines data source schema, including objects nested list.
linode/tag/framework_models_unit_test.go Unit-tests flattening for reserved_ipv4_address and linode.
linode/tag/datasource_test.go Adds acceptance tests for basic tag lookup and reserved IPv4 tagging.
linode/tag/tmpl/* Adds acceptance test HCL template for the data source.
linode/framework_provider.go Registers tag.NewDataSource in the framework provider.
docs/data-sources/tag.md Adds documentation for linode_tag data source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode/tag/datasource_test.go Outdated
Comment thread linode/tag/datasource_test.go
Comment thread linode/tag/tmpl/template.go Outdated
@mgwoj
Copy link
Copy Markdown
Contributor Author

mgwoj commented Apr 14, 2026

@copilot resolve the merge conflicts in this pull request

@mgwoj mgwoj force-pushed the feature/TPT-4297-terraform-update-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4 branch from b4a80a3 to 10be5cd Compare April 15, 2026 09:10
@mgwoj mgwoj changed the title TPT-4297 terraform: Implement linode_tag Data Source with Reserved IPv4 Support TPT-4297: terraform: Implement linode_tag Data Source with Reserved IPv4 Support Apr 15, 2026
@mgwoj mgwoj requested a review from Copilot April 15, 2026 09:35
Copy link
Copy Markdown
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 12 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode/tag/datasource_test.go
Comment thread go.mod Outdated
Comment thread linode/tag/framework_datasource_model.go
Copy link
Copy Markdown
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 12 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode/linodeinterface/framework_models.go
Comment thread linode/tag/framework_datasource_model.go
@mgwoj mgwoj changed the base branch from dev to proj/reserved-ips April 24, 2026 14:29
@mawilk90 mawilk90 removed the request for review from dawiddzhafarov May 4, 2026 11:55
Comment thread docs/data-sources/tag.md
mgwoj added 2 commits May 8, 2026 12:56
…e/TPT-4297-terraform-update-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4
@mgwoj mgwoj requested a review from ezilber-akamai May 8, 2026 11:07
…te-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4
Copy link
Copy Markdown
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my local testing!

@mgwoj mgwoj merged commit 0706eb6 into linode:proj/reserved-ips May 12, 2026
9 checks passed
@mgwoj mgwoj deleted the feature/TPT-4297-terraform-update-linode_tag-resource-and-data-source-for-reserved-ip-for-ipv4 branch May 12, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants