Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for tier in lkeversion and lkeversions datasources #1776

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Feb 21, 2025

📝 Description

Added the lkeversion datasource. Also added support for the tier field in the lkeversions datasource.

The lkeversion datasource can be used to call both GET /v4beta/lke/versions/<versionID> and GET /v4beta/lke/versions/<tier>/<versionID> endpoints.

The lkeversions datasource can be used to call both GET /v4beta/lke/versions/<tier> and GET /v4beta/lke/versions endpoints.

✔️ How to Test

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

Unit Tests

make test-unit

Integration Tests

make test-int PKG_NAME="lkeversion" TEST_CASE="TestAccDataSourceLinodeLkeVersion"
make test-int PKG_NAME="lkeversions" TEST_CASE="TestAccDataSourceLinodeLkeVersions"

Manual Tests

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

  1. Using a terraform-provider-linode sandbox environment (e.g. dx-devenv), apply the following configuration (make sure to use v4beta):
data "linode_lke_versions" "versions_no_tier" {}

output "lke_versions_no_tier" {
  value = data.linode_lke_versions.versions_no_tier
}

data "linode_lke_versions" "versions_tier" {
    tier = "enterprise"
}

output "lke_versions_tier" {
  value = data.linode_lke_versions.versions_tier
}

data "linode_lke_version" "version_no_tier" {
    id = "1.31"
}

output "lke_version_no_tier" {
  value = data.linode_lke_version.version_no_tier
}

data "linode_lke_version" "version_tier" {
    id = "v1.31.1+lke1"
    tier = "enterprise"
}

output "lke_version_tier" {
  value = data.linode_lke_version.version_tier
}
  1. Ensure the output is accurate.

@ezilber-akamai ezilber-akamai force-pushed the TPT-3373-lke-tier-versions branch 3 times, most recently from d4330a6 to 077f131 Compare February 24, 2025 16:29
@ezilber-akamai ezilber-akamai added the do-not-merge PRs that should not be merged until the commented issue is resolved label Feb 24, 2025
@ezilber-akamai ezilber-akamai marked this pull request as ready for review February 24, 2025 16:44
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner February 24, 2025 16:44
@ezilber-akamai ezilber-akamai requested review from zliang-akamai and ykim-akamai and removed request for a team February 24, 2025 16:44
@ezilber-akamai
Copy link
Contributor Author

I was not able to find a way to entirely omit the tier fields from the state when the user does not provide it. Instead, it shows up in the state with a value of null. Any ideas on how to improve this?

@ezilber-akamai ezilber-akamai added the new-feature for new features in the changelog. label Feb 24, 2025
@ezilber-akamai ezilber-akamai force-pushed the TPT-3373-lke-tier-versions branch from 077f131 to fb723cf Compare February 24, 2025 19:16
@zliang-akamai
Copy link
Member

Can we use statecheck for newly implemented tests?
https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests/state-checks/resource

@ezilber-akamai ezilber-akamai removed the do-not-merge PRs that should not be merged until the commented issue is resolved label Mar 3, 2025
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.

2 participants