Skip to content

Conversation

@lgarber-akamai
Copy link
Contributor

📝 Description

This pull request adds a DiffSuppressFunc to the tier field of the linode_lke_cluster resource.

This prevents the recreation of clusters when managing a cluster without access to LKE tiers (e.g. using v4, cluster created before LKE-E, etc.).

NOTE: I'm not particularly happy with this solution so please let me know if you can think of any good alternative approaches.

Resolves #1945

✔️ How to Test

The following test steps assume you have pulled down this PR locally.

Integration Testing

make test-int PKG_NAME=lke TEST_ARGS="-run TestAccResourceLKECluster_tierNoAccess"

Manual Testing

  1. In a terraform-provider-linode sandbox environment (e.g. dx-devenv), apply the following:
resource "linode_lke_cluster" "test" {
  label       = "tf-test-manual"
  region      = "us-mia"
  k8s_version = "1.33"
  tier = "standard"

  pool {
    type  = "g6-standard-1"
    count = 1
  }
}
  1. Ensure the apply completes successfully.
  2. Plan the configuration and ensure no changes are proposed.

@lgarber-akamai lgarber-akamai requested a review from a team as a code owner October 14, 2025 20:23
@lgarber-akamai lgarber-akamai added the bugfix for any bug fixes in the changelog. label Oct 14, 2025
@lgarber-akamai lgarber-akamai requested review from Copilot, ezilber-akamai and vshanthe and removed request for a team October 14, 2025 20:23
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 adds a DiffSuppressFunc to the tier field of the linode_lke_cluster resource to prevent unnecessary cluster recreation when managing clusters without access to LKE tier information (e.g., using v4 API or clusters created before LKE-E was available).

Key changes:

  • Added diff suppression logic for the tier field when old value is empty and new value is "standard"
  • Created test template and test case to validate the tier suppression behavior
  • Extended template data structure to support tier field in tests

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
linode/lke/schema_resource.go Added DiffSuppressFunc to suppress diffs when tier is empty and new value is "standard"
linode/lke/tmpl/tier_no_access.gotf New test template for testing tier suppression with v4 API
linode/lke/tmpl/template.go Added Tier field to TemplateData and TierNoAccess function
linode/lke/framework_resource_test.go Added comprehensive test case for tier suppression functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lgarber-akamai lgarber-akamai changed the title Add Add DiffSuppressFunc to the linode_lke_cluster resource tier field Oct 14, 2025
@lgarber-akamai lgarber-akamai marked this pull request as draft October 15, 2025 14:36
@lgarber-akamai
Copy link
Contributor Author

Switching this to draft while I get confirmation about the approach for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix for any bug fixes in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Adding tier on LKE forces replacement

1 participant