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

Implement linode_database_mysql_v2 data source #1717

Merged
merged 9 commits into from
Jan 23, 2025

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Jan 14, 2025

📝 Description

This pull request introduces a new linode_database_mysql_v2 data source with schema matching the schema of the linode_database_mysql_v2 resource.

Depends on #1701

✔️ How to Test

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

Integration Testing

make PKG_NAME=linode/databasemysqlv2 int-test

Manual Testing

  1. Using a terraform-provider-linode sandbox environment (e.g. dx-devenv), apply the following configuration:
output "datasource_result" {
  value = data.linode_database_mysql_v2.foobar
  sensitive = true
}

data "linode_database_mysql_v2" "foobar" {
  id = linode_database_mysql_v2.foobar.id
}

resource "linode_database_mysql_v2" "foobar" {
  label = "mydatabase"
  engine_id = "mysql/8"
  region = "us-mia"
  type = "g6-nanode-1"

  allow_list = ["10.0.0.3/32"]
  cluster_size = 3

  updates = {
    duration = 4
    frequency = "weekly"
    hour_of_day = 22
    day_of_week = 2
  }
}
  1. Ensure the output accurate reflects the database's information.

@lgarber-akamai lgarber-akamai added new-feature for new features in the changelog. do-not-merge PRs that should not be merged until the commented issue is resolved labels Jan 14, 2025
@lgarber-akamai lgarber-akamai marked this pull request as ready for review January 14, 2025 17:47
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner January 14, 2025 17:47
@lgarber-akamai lgarber-akamai requested review from ykim-akamai and yec-akamai and removed request for a team January 14, 2025 17:47
@lgarber-akamai lgarber-akamai changed the title Implement linode_database_mysql_v2 data source Implement linode_database_mysql_v2 data source Jan 14, 2025
@lgarber-akamai lgarber-akamai removed the do-not-merge PRs that should not be merged until the commented issue is resolved label Jan 21, 2025
@ezilber-akamai
Copy link
Contributor

ezilber-akamai commented Jan 22, 2025

Got a test failure locally:

=== NAME  TestAccDataSource_basic
    datasource_test.go:20: Step 1/1 error: Check failed: Check 20/29 error: data.linode_database_mysql_v2.foobar: Attribute 'type' expected "g6-standard-1", got "g6-nanode-1"

Looks like you just need to update the test case here.

Copy link
Contributor

@ykim-akamai ykim-akamai left a comment

Choose a reason for hiding this comment

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

LGTM, just a small update required in the assertions. Great job!

@ezilber-akamai
Copy link
Contributor

Looks like another test case needs to be tweaked:

=== NAME  TestAccDataSource_basic
    datasource_test.go:20: Step 1/1 error: Check failed: Check 24/29 error: data.linode_database_mysql_v2.foobar: Attribute 'allow_list.0' expected "10.0.0.4/32", got "10.0.0.3/32"

@lgarber-akamai lgarber-akamai requested review from ezilber-akamai, ykim-akamai and yec-akamai and removed request for ykim-akamai January 22, 2025 18:07
@lgarber-akamai
Copy link
Contributor Author

Not sure how I mismatched all of those test assertions, but regardless they should all be fixed now haha

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.

Everything is passing now. Nice work!

@lgarber-akamai lgarber-akamai merged commit 5369643 into linode:dev Jan 23, 2025
8 checks passed
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.

4 participants