Skip to content

Commit

Permalink
feat: rename retry strategy max_attempts to max_retries (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
clample authored Sep 1, 2023
1 parent 5ca8c0d commit 6538d08
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions checkly/resource_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@ func resourceCheck() *schema.Resource {
Default: 60,
Description: "The number of seconds to wait before the first retry attempt.",
},
"max_attempts": {
"max_retries": {
Type: schema.TypeInt,
Optional: true,
Default: 2,
Description: "The maximum number of attempts to retry the check. Value must be between 1 and 10.",
Description: "The maximum number of times to retry the check. Value must be between 1 and 10.",
},
"max_duration_seconds": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -719,7 +719,7 @@ func setFromRetryStrategy(rs *checkly.RetryStrategy) []tfMap {
{
"type": rs.Type,
"base_backoff_seconds": rs.BaseBackoffSeconds,
"max_attempts": rs.MaxAttempts,
"max_retries": rs.MaxRetries,
"max_duration_seconds": rs.MaxDurationSeconds,
"same_region": rs.SameRegion,
},
Expand Down Expand Up @@ -857,7 +857,7 @@ func retryStrategyFromSet(s *schema.Set) *checkly.RetryStrategy {
return &checkly.RetryStrategy{
Type: res["type"].(string),
BaseBackoffSeconds: res["base_backoff_seconds"].(int),
MaxAttempts: res["max_attempts"].(int),
MaxRetries: res["max_retries"].(int),
MaxDurationSeconds: res["max_duration_seconds"].(int),
SameRegion: res["same_region"].(bool),
}
Expand Down
4 changes: 2 additions & 2 deletions checkly/resource_check_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ func resourceCheckGroup() *schema.Resource {
Default: 60,
Description: "The number of seconds to wait before the first retry attempt.",
},
"max_attempts": {
"max_retries": {
Type: schema.TypeInt,
Optional: true,
Default: 2,
Description: "The maximum number of attempts to retry the check. Value must be between 1 and 10.",
Description: "The maximum number of times to retry the check. Value must be between 1 and 10.",
},
"max_duration_seconds": {
Type: schema.TypeInt,
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "checkly_check" "example_check_2" {
type = "FIXED"
base_backoff_seconds = 60
max_duration_seconds = 600
max_attempts = 3
max_retries = 3
same_region = false
}
Expand Down Expand Up @@ -352,8 +352,8 @@ Required:
Optional:

- `base_backoff_seconds` (Number) The number of seconds to wait before the first retry attempt.
- `max_attempts` (Number) The maximum number of attempts to retry the check. Value must be between 1 and 10.
- `max_duration_seconds` (Number) The total amount of time to continue retrying the check (maximum 600 seconds).
- `max_retries` (Number) The maximum number of times to retry the check. Value must be between 1 and 10.
- `same_region` (Boolean) Whether retries should be run in the same region as the initial check run.


2 changes: 1 addition & 1 deletion docs/resources/check_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ Required:
Optional:

- `base_backoff_seconds` (Number) The number of seconds to wait before the first retry attempt.
- `max_attempts` (Number) The maximum number of attempts to retry the check. Value must be between 1 and 10.
- `max_duration_seconds` (Number) The total amount of time to continue retrying the check (maximum 600 seconds).
- `max_retries` (Number) The maximum number of times to retry the check. Value must be between 1 and 10.
- `same_region` (Boolean) Whether retries should be run in the same region as the initial check run.


2 changes: 1 addition & 1 deletion examples/resources/checkly_check/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "checkly_check" "example_check_2" {
type = "FIXED"
base_backoff_seconds = 60
max_duration_seconds = 600
max_attempts = 3
max_retries = 3
same_region = false
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/checkly/checkly-go-sdk v1.6.8
github.com/checkly/checkly-go-sdk v1.6.9
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.9
github.com/gruntwork-io/terratest v0.41.16
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ github.com/checkly/checkly-go-sdk v1.6.7 h1:OhTsFwFKZYV9LsYyV1SuoU0Ql113Zk1D+JBT
github.com/checkly/checkly-go-sdk v1.6.7/go.mod h1:Pd6tBOggAe41NnCU5KwqA8JvD6J20/IctszT2E0AvHo=
github.com/checkly/checkly-go-sdk v1.6.8 h1:7rQ+zrwlLYYOc0u5jxDT1+atLFnwWmaqJluDLJtrjW0=
github.com/checkly/checkly-go-sdk v1.6.8/go.mod h1:Pd6tBOggAe41NnCU5KwqA8JvD6J20/IctszT2E0AvHo=
github.com/checkly/checkly-go-sdk v1.6.9 h1:2Cfr2I0VnHmB4oL7BOw25WYuyz5Lm04N50k1HUsX2Lk=
github.com/checkly/checkly-go-sdk v1.6.9/go.mod h1:Pd6tBOggAe41NnCU5KwqA8JvD6J20/IctszT2E0AvHo=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
Expand Down

0 comments on commit 6538d08

Please sign in to comment.