diff --git a/CHANGELOG.md b/CHANGELOG.md index 320c5ae..1f6a1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support of Postgres 17. See the Neon [announcement](https://neon.tech/blog/postgres-17) and the Postgres [announcement](https://www.postgresql.org/about/news/postgresql-17-released-2936/). +### Fixed + +- Fixed validation of the autoscalling limits. You can now set the maximum compute size up to `10`. + ## [v0.6.0] - 2024-09-23 ### Added diff --git a/internal/provider/helper.go b/internal/provider/helper.go index a9e44fc..907d640 100644 --- a/internal/provider/helper.go +++ b/internal/provider/helper.go @@ -58,20 +58,12 @@ func validateAutoscallingLimit(val interface{}, name string) (warns []string, er switch val.(type) { case float64: switch v := val.(float64); v { - case 0.25, - 0.5, - 1., - 2., - 3., - 4., - 5., - 6., - 7.: + case 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.: return } case int: switch v := val.(int); v { - case 1, 2, 3, 4, 5, 6, 7: + case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10: return } } diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index 5b4221e..d3fb179 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -12,7 +12,7 @@ func Test_validateAutoscallingLimit(t *testing.T) { t.Run( "happy path: int input", func(t *testing.T) { - input := []int{1, 2, 3, 4, 5, 6, 7} + input := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} for _, in := range input { _, errs := validateAutoscallingLimit(in, "") if errs != nil { @@ -24,7 +24,7 @@ func Test_validateAutoscallingLimit(t *testing.T) { t.Run( "happy path: float64 input", func(t *testing.T) { - input := []float64{0.25, 0.5, 1, 2, 3, 4, 5, 6, 7} + input := []float64{0.25, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} for _, in := range input { _, errs := validateAutoscallingLimit(in, "") if errs != nil { @@ -36,7 +36,7 @@ func Test_validateAutoscallingLimit(t *testing.T) { t.Run( "unhappy path", func(t *testing.T) { - input := []interface{}{"foo", 0, 0.1, 1.5, 10} + input := []interface{}{"foo", 0, 0.1, 1.5, 11, 12, 20} for _, in := range input { _, errs := validateAutoscallingLimit(in, "") if errs == nil {