-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panic on
random_string
and random_password
when character…
… set is empty (#551) * resource/random_password+random_string: Prevent panic when special, upper, lower, numeric/number are set to false (#549) Previously, a panic would be generated if the following configuration was used: ``` resource "random_string" "random" { length = 16 special = false upper = false lower = false numeric = false } ``` ``` ╷ │ Error: Plugin did not respond │ │ with random_string.random, │ on resource.tf line 1, in resource "random_string" "random": │ 1: resource "random_string" "random" { │ │ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details. ╵ Stack trace from the terraform-provider-random plugin: panic: crypto/rand: argument to Int is <= 0 ``` This change will cause validation to fail if special, upper, lower, and numeric/number are all set to false Output from acceptance testing: ```console TF_ACC=1 go test -count=1 -run='TestAccResourceString_NumericFalse' -timeout=10m -v ./internal/provider === RUN TestAccResourceString_NumericFalse === PAUSE TestAccResourceString_NumericFalse === CONT TestAccResourceString_NumericFalse --- PASS: TestAccResourceString_NumericFalse (0.15s) ``` * Adding changelog entries and copyright header (#549) * Linting * Updating description for number and numeric attributes on resource_password and resource_string
- Loading branch information
1 parent
9eccb5c
commit 9192f92
Showing
10 changed files
with
340 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: BUG FIXES | ||
body: 'provider/random_password: Fix bug which causes panic when special, upper, lower | ||
and number/numeric are all false' | ||
time: 2024-04-10T17:54:23.219223+01:00 | ||
custom: | ||
Issue: "551" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: BUG FIXES | ||
body: 'provider/random_string: Fix bug which causes panic when special, upper, lower | ||
and number/numeric are all false' | ||
time: 2024-04-10T17:55:36.979987+01:00 | ||
custom: | ||
Issue: "551" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.