-
Notifications
You must be signed in to change notification settings - Fork 114
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
resource/random_password+random_string: Prevent override_special differences upgrading from 3.3.2 #312
Merged
Commits on Sep 2, 2022
-
resource/random_password: Fix bcrypt_hash generation
Reference: #307 This change fixes the source of the `bcrypt_hash` generation to being the result of the random password generation. The issue was introduced in v3.4.0. Previously: ``` --- FAIL: TestAccResourcePassword_BcryptHash (0.63s) /Users/bflad/src/github.com/hashicorp/terraform-provider-random/internal/provider/resource_password_test.go:107: Step 1/1 error: Check failed: Check 3/3 error: crypto/bcrypt: hashedPassword is not the hash of the given password ``` Suggested CHANGELOG: ``` NOTES: * resource/random_password: If the resource was created between versions 3.4.0 and 3.4.2, the `bcrypt_hash` value will not correctly verify against the `result` value. Use `terraform taint` or `terraform apply -replace` to trigger resource recreation with this version. BUG FIXES: * resource/random_password: Fixed incorrect `bcrypt_hash` generation since version 3.4.0 ```
Configuration menu - View commit details
-
Copy full SHA for a07c5b8 - Browse repository at this point
Copy the full SHA a07c5b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f7f815 - Browse repository at this point
Copy the full SHA 3f7f815View commit details -
Configuration menu - View commit details
-
Copy full SHA for 87c2826 - Browse repository at this point
Copy the full SHA 87c2826View commit details
Commits on Sep 5, 2022
-
resource/random_password+random_string: Prevent differences upgrading…
… from 3.3.2 Reference: #306 This fixes the `override_special` attribute issues by removing `Computed: true` and the empty string default value plan modifier (this attribute's value should always come from the practitioner) and resolves the underlying issue of always reading `plan.OverrideSpecial.Value` into the state, which will never be correct for null configurations. For any environment that happened to upgrade to 3.4.2 and save the empty string into state, the replacement plan modifier will allow in-place modification from empty string (`""`) to `null`. Previously after removing `Computed: true` and default value plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` Previously before adjusting requires replace plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got :i$(*K3_Vinv and FSw{$8sB#Uc3 === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got VrNYb]{#Z2Xu and XZD#_<BjDhkH ```
Configuration menu - View commit details
-
Copy full SHA for 115d254 - Browse repository at this point
Copy the full SHA 115d254View commit details
Commits on Sep 6, 2022
-
Apply suggestions from code review
Co-authored-by: Benjamin Bennett <ben.bennett@hashicorp.com>
Configuration menu - View commit details
-
Copy full SHA for 0c11bcb - Browse repository at this point
Copy the full SHA 0c11bcbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed063cd - Browse repository at this point
Copy the full SHA ed063cdView commit details -
resource/random_password+random_string: Set keepers and override_spec…
…ial explicitly to null during import Previously: ``` === RUN TestAccResourcePassword resource_password_test.go:67: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected. (map[string]string) (len=1) { (string) (len=16) "override_special": (string) "" } (map[string]string) { } --- FAIL: TestAccResourcePassword (0.79s) ```
Configuration menu - View commit details
-
Copy full SHA for f83d5f0 - Browse repository at this point
Copy the full SHA f83d5f0View commit details
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.