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

mysql config: Use GetOkExists for bools. #1063

Merged
merged 2 commits into from
Nov 1, 2023
Merged

Conversation

andrewsomething
Copy link
Member

Using GetOk excludes false as it is the default value. To support setting a value to false we need GetOkExists instead.

Updated test fails before the code change:

=== RUN   TestAccDigitalOceanDatabaseMySQLConfig_Basic
=== PAUSE TestAccDigitalOceanDatabaseMySQLConfig_Basic
=== CONT  TestAccDigitalOceanDatabaseMySQLConfig_Basic
    resource_database_mysql_config_test.go:15: Step 1/2 error: Check failed: Check 3/3 error: digitalocean_database_mysql_config.foobar: Attribute 'sql_require_primary_key' expected "false", got "true"
--- FAIL: TestAccDigitalOceanDatabaseMySQLConfig_Basic (295.98s)
FAIL
FAIL    github.com/digitalocean/terraform-provider-digitalocean/digitalocean/database   296.065s

And passes after:

=== RUN   TestAccDigitalOceanDatabaseMySQLConfig_Basic
=== PAUSE TestAccDigitalOceanDatabaseMySQLConfig_Basic
=== CONT  TestAccDigitalOceanDatabaseMySQLConfig_Basic
--- PASS: TestAccDigitalOceanDatabaseMySQLConfig_Basic (228.76s)
PASS
ok      github.com/digitalocean/terraform-provider-digitalocean/digitalocean/database   228.956s

Fixes: #1062

@andrewsomething andrewsomething requested a review from a team October 31, 2023 21:41
@andrewsomething andrewsomething merged commit 4e52d1b into main Nov 1, 2023
2 checks passed
@andrewsomething andrewsomething deleted the asb/issues/1062 branch November 1, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql_require_primary_key is not working
2 participants