Skip to content

Add lke_node_pool data source#2256

Open
dawiddzhafarov wants to merge 3 commits intolinode:devfrom
dawiddzhafarov:feature/TPT-3638-terraform-support-node-pool-data-source
Open

Add lke_node_pool data source#2256
dawiddzhafarov wants to merge 3 commits intolinode:devfrom
dawiddzhafarov:feature/TPT-3638-terraform-support-node-pool-data-source

Conversation

@dawiddzhafarov
Copy link
Contributor

📝 Description

This PR adds a new, lke_node_pool data source.
It requires providing two attributes:

  • id - The Node Pool's ID.
  • cluster_id - The Cluster's ID.

Returns details about the specific Node Pool.

✔️ How to Test

To run integrations tests:

make PKG_NAME="lkenodepool" TEST_CASE="TestAccDataSourceLKENodePool_basic" test-int

I would like to add another test for enterprise cluster, but I need to have access to the admin panel. But I think it's not required for this PR to be merged if I won't gain the access.

@dawiddzhafarov dawiddzhafarov added the new-feature for new features in the changelog. label Feb 10, 2026
@dawiddzhafarov dawiddzhafarov marked this pull request as ready for review February 10, 2026 10:11
@dawiddzhafarov dawiddzhafarov requested a review from a team as a code owner February 10, 2026 10:11
@dawiddzhafarov dawiddzhafarov requested review from ezilber-akamai and vshanthe and removed request for a team February 10, 2026 10:11
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

Adds a new Terraform data source linode_lke_node_pool to fetch details for a specific LKE node pool by id and cluster_id, along with integration tests and documentation.

Changes:

  • Introduces a new framework data source implementation + schema for linode_lke_node_pool.
  • Adds integration coverage for basic read + not-found scenarios using new acceptance templates.
  • Adds public documentation for the new data source.

Reviewed changes

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

Show a summary per file
File Description
linode/lkenodepool/tmpl/template.go Exposes template helpers for data source acceptance test configs.
linode/lkenodepool/tmpl/data_basic.gotf Adds acceptance config for a successful data source read.
linode/lkenodepool/tmpl/data_cluster_not_found.gotf Adds acceptance config for invalid cluster lookup.
linode/lkenodepool/tmpl/data_nodepool_not_found.gotf Adds acceptance config for invalid node pool lookup.
linode/lkenodepool/framework_models.go Adds data source state model + parser from API types.
linode/lkenodepool/framework_datasource.go Implements the data source Read logic.
linode/lkenodepool/framework_datasource_schema.go Defines the Terraform schema for the data source.
linode/lkenodepool/framework_datasource_test.go Adds integration tests for the new data source.
linode/framework_provider.go Registers the new data source in the provider.
docs/data-sources/lke_node_pool.md Adds documentation for the new data source.
docs/data-sources/lke_cluster.md Fixes a markdown header formatting issue.

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

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.

Looks good overall! I did get the following error when running the test locally:

=== CONT  TestAccDataSourceLKENodePool_basic
    test_retry.go:82: FATAL: Step 1/3 error: Check failed: Check 4/25 error: data.linode_lke_node_pool.test: Attribute 'disk_encryption' expected "disabled", got "enabled"
    test_retry.go:37: Retrying TestAccDataSourceLKENodePool_basic due to failure. (Attempt 1)
    test_retry.go:82: FATAL: Step 1/3 error: Check failed: Check 4/25 error: data.linode_lke_node_pool.test: Attribute 'disk_encryption' expected "disabled", got "enabled"
    test_retry.go:37: Retrying TestAccDataSourceLKENodePool_basic due to failure. (Attempt 2)
    test_retry.go:40: Test failed after 2 attempts
--- FAIL: TestAccDataSourceLKENodePool_basic (377.63s)

Copy link

@vshanthe vshanthe left a comment

Choose a reason for hiding this comment

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

Passing locally LGTM

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.

3 participants