Add DiffSuppressFunc to the linode_lke_cluster resource tier field #2130
Closed
lgarber-akamai wants to merge 2 commits intolinode:devfrom
Closed
Add DiffSuppressFunc to the linode_lke_cluster resource tier field #2130lgarber-akamai wants to merge 2 commits intolinode:devfrom
lgarber-akamai wants to merge 2 commits intolinode:devfrom
Conversation
Contributor
There was a problem hiding this comment.
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
tierfield 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.
Contributor
Author
|
Switching this to draft while I get confirmation about the approach for this issue. |
Contributor
Author
|
Rejecting in favor of a validation-based approach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This pull request adds a DiffSuppressFunc to the
tierfield of thelinode_lke_clusterresource.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
Manual Testing