Skip to content

Commit 79732b0

Browse files
Bump github.com/hashicorp/terraform-plugin-framework from 0.15.0 to 0.16.0 (#77)
* Bump github.com/hashicorp/terraform-plugin-framework Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-plugin-framework@v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Replacing unknown fields * Adding changelog entry Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Benjamin Bennett <[email protected]>
1 parent b6de2e8 commit 79732b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+996
-983
lines changed

.changelog/77.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
all: This Go module has been updated to make it compatible with the breaking changes in terraform-plugin-framework version 0.16.0
3+
```

float64validator/at_least_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
87
"github.com/hashicorp/terraform-plugin-framework/attr"
98
"github.com/hashicorp/terraform-plugin-framework/path"
109
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1110
"github.com/hashicorp/terraform-plugin-framework/types"
11+
12+
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
1213
)
1314

1415
func TestAtLeastValidator(t *testing.T) {
@@ -21,31 +22,31 @@ func TestAtLeastValidator(t *testing.T) {
2122
}
2223
tests := map[string]testCase{
2324
"not a Float64": {
24-
val: types.Bool{Value: true},
25+
val: types.BoolValue(true),
2526
expectError: true,
2627
},
2728
"unknown Float64": {
28-
val: types.Float64{Unknown: true},
29+
val: types.Float64Unknown(),
2930
min: 0.90,
3031
},
3132
"null Float64": {
32-
val: types.Float64{Null: true},
33+
val: types.Float64Null(),
3334
min: 0.90,
3435
},
3536
"valid integer as Float64": {
36-
val: types.Float64{Value: 2},
37+
val: types.Float64Value(2),
3738
min: 0.90,
3839
},
3940
"valid float as Float64": {
40-
val: types.Float64{Value: 2.2},
41+
val: types.Float64Value(2.2),
4142
min: 0.90,
4243
},
4344
"valid float as Float64 min": {
44-
val: types.Float64{Value: 0.9},
45+
val: types.Float64Value(0.9),
4546
min: 0.90,
4647
},
4748
"too small float as Float64": {
48-
val: types.Float64{Value: -1.1111},
49+
val: types.Float64Value(-1.1111),
4950
min: 0.90,
5051
expectError: true,
5152
},

float64validator/at_most_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
87
"github.com/hashicorp/terraform-plugin-framework/attr"
98
"github.com/hashicorp/terraform-plugin-framework/path"
109
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1110
"github.com/hashicorp/terraform-plugin-framework/types"
11+
12+
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
1213
)
1314

1415
func TestAtMostValidator(t *testing.T) {
@@ -21,31 +22,31 @@ func TestAtMostValidator(t *testing.T) {
2122
}
2223
tests := map[string]testCase{
2324
"not a Float64": {
24-
val: types.Bool{Value: true},
25+
val: types.BoolValue(true),
2526
expectError: true,
2627
},
2728
"unknown Float64": {
28-
val: types.Float64{Unknown: true},
29+
val: types.Float64Unknown(),
2930
max: 2.00,
3031
},
3132
"null Float64": {
32-
val: types.Float64{Null: true},
33+
val: types.Float64Null(),
3334
max: 2.00,
3435
},
3536
"valid integer as Float64": {
36-
val: types.Float64{Value: 1},
37+
val: types.Float64Value(1),
3738
max: 2.00,
3839
},
3940
"valid float as Float64": {
40-
val: types.Float64{Value: 1.1},
41+
val: types.Float64Value(1.1),
4142
max: 2.00,
4243
},
4344
"valid float as Float64 max": {
44-
val: types.Float64{Value: 2.0},
45+
val: types.Float64Value(2.0),
4546
max: 2.00,
4647
},
4748
"too large float as Float64": {
48-
val: types.Float64{Value: 3.0},
49+
val: types.Float64Value(3.0),
4950
max: 2.00,
5051
expectError: true,
5152
},

float64validator/between_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
87
"github.com/hashicorp/terraform-plugin-framework/attr"
98
"github.com/hashicorp/terraform-plugin-framework/path"
109
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1110
"github.com/hashicorp/terraform-plugin-framework/types"
11+
12+
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
1213
)
1314

1415
func TestBetweenValidator(t *testing.T) {
@@ -22,47 +23,47 @@ func TestBetweenValidator(t *testing.T) {
2223
}
2324
tests := map[string]testCase{
2425
"not a Float64": {
25-
val: types.Bool{Value: true},
26+
val: types.BoolValue(true),
2627
expectError: true,
2728
},
2829
"unknown Float64": {
29-
val: types.Float64{Unknown: true},
30+
val: types.Float64Unknown(),
3031
min: 0.90,
3132
max: 3.10,
3233
},
3334
"null Float64": {
34-
val: types.Float64{Null: true},
35+
val: types.Float64Null(),
3536
min: 0.90,
3637
max: 3.10,
3738
},
3839
"valid integer as Float64": {
39-
val: types.Float64{Value: 2},
40+
val: types.Float64Value(2),
4041
min: 0.90,
4142
max: 3.10,
4243
},
4344
"valid float as Float64": {
44-
val: types.Float64{Value: 2.2},
45+
val: types.Float64Value(2.2),
4546
min: 0.90,
4647
max: 3.10,
4748
},
4849
"valid float as Float64 min": {
49-
val: types.Float64{Value: 0.9},
50+
val: types.Float64Value(0.9),
5051
min: 0.90,
5152
max: 3.10,
5253
},
5354
"valid float as Float64 max": {
54-
val: types.Float64{Value: 3.1},
55+
val: types.Float64Value(3.1),
5556
min: 0.90,
5657
max: 3.10,
5758
},
5859
"too small float as Float64": {
59-
val: types.Float64{Value: -1.1111},
60+
val: types.Float64Value(-1.1111),
6061
min: 0.90,
6162
max: 3.10,
6263
expectError: true,
6364
},
6465
"too large float as Float64": {
65-
val: types.Float64{Value: 4.2},
66+
val: types.Float64Value(4.2),
6667
min: 0.90,
6768
max: 3.10,
6869
expectError: true,

float64validator/none_of.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package float64validator
22

33
import (
4-
"github.com/hashicorp/terraform-plugin-framework-validators/internal/primitivevalidator"
54
"github.com/hashicorp/terraform-plugin-framework/attr"
65
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
76
"github.com/hashicorp/terraform-plugin-framework/types"
7+
8+
"github.com/hashicorp/terraform-plugin-framework-validators/internal/primitivevalidator"
89
)
910

1011
// NoneOf checks that the float64 held in the attribute
1112
// is none of the given `unacceptableFloats`.
1213
func NoneOf(unacceptableFloats ...float64) tfsdk.AttributeValidator {
1314
unacceptableFloatValues := make([]attr.Value, 0, len(unacceptableFloats))
1415
for _, f := range unacceptableFloats {
15-
unacceptableFloatValues = append(unacceptableFloatValues, types.Float64{Value: f})
16+
unacceptableFloatValues = append(unacceptableFloatValues, types.Float64Value(f))
1617
}
1718

1819
return primitivevalidator.NoneOf(unacceptableFloatValues...)

float64validator/none_of_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
87
"github.com/hashicorp/terraform-plugin-framework/attr"
98
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
109
"github.com/hashicorp/terraform-plugin-framework/types"
10+
11+
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
1112
)
1213

1314
func TestNoneOfValidator(t *testing.T) {
@@ -21,7 +22,7 @@ func TestNoneOfValidator(t *testing.T) {
2122

2223
testCases := map[string]testCase{
2324
"simple-match": {
24-
in: types.Float64{Value: 123.456},
25+
in: types.Float64Value(123.456),
2526
validator: float64validator.NoneOf(
2627
123.456,
2728
234.567,
@@ -31,7 +32,7 @@ func TestNoneOfValidator(t *testing.T) {
3132
expErrors: 1,
3233
},
3334
"simple-mismatch": {
34-
in: types.Float64{Value: 123.456},
35+
in: types.Float64Value(123.456),
3536
validator: float64validator.NoneOf(
3637
234.567,
3738
8910.11,
@@ -40,7 +41,7 @@ func TestNoneOfValidator(t *testing.T) {
4041
expErrors: 0,
4142
},
4243
"skip-validation-on-null": {
43-
in: types.Float64{Null: true},
44+
in: types.Float64Null(),
4445
validator: float64validator.NoneOf(
4546
234.567,
4647
8910.11,
@@ -49,7 +50,7 @@ func TestNoneOfValidator(t *testing.T) {
4950
expErrors: 0,
5051
},
5152
"skip-validation-on-unknown": {
52-
in: types.Float64{Unknown: true},
53+
in: types.Float64Unknown(),
5354
validator: float64validator.NoneOf(
5455
234.567,
5556
8910.11,

float64validator/one_of.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package float64validator
22

33
import (
4-
"github.com/hashicorp/terraform-plugin-framework-validators/internal/primitivevalidator"
54
"github.com/hashicorp/terraform-plugin-framework/attr"
65
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
76
"github.com/hashicorp/terraform-plugin-framework/types"
7+
8+
"github.com/hashicorp/terraform-plugin-framework-validators/internal/primitivevalidator"
89
)
910

1011
// OneOf checks that the float64 held in the attribute
1112
// is one of the given `acceptableFloats`.
1213
func OneOf(acceptableFloats ...float64) tfsdk.AttributeValidator {
1314
acceptableFloatValues := make([]attr.Value, 0, len(acceptableFloats))
1415
for _, f := range acceptableFloats {
15-
acceptableFloatValues = append(acceptableFloatValues, types.Float64{Value: f})
16+
acceptableFloatValues = append(acceptableFloatValues, types.Float64Value(f))
1617
}
1718

1819
return primitivevalidator.OneOf(acceptableFloatValues...)

float64validator/one_of_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
87
"github.com/hashicorp/terraform-plugin-framework/attr"
98
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
109
"github.com/hashicorp/terraform-plugin-framework/types"
10+
11+
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
1112
)
1213

1314
func TestOneOfValidator(t *testing.T) {
@@ -21,7 +22,7 @@ func TestOneOfValidator(t *testing.T) {
2122

2223
testCases := map[string]testCase{
2324
"simple-match": {
24-
in: types.Float64{Value: 123.456},
25+
in: types.Float64Value(123.456),
2526
validator: float64validator.OneOf(
2627
123.456,
2728
234.567,
@@ -31,7 +32,7 @@ func TestOneOfValidator(t *testing.T) {
3132
expErrors: 0,
3233
},
3334
"simple-mismatch": {
34-
in: types.Float64{Value: 123.456},
35+
in: types.Float64Value(123.456),
3536
validator: float64validator.OneOf(
3637
234.567,
3738
8910.11,
@@ -40,7 +41,7 @@ func TestOneOfValidator(t *testing.T) {
4041
expErrors: 1,
4142
},
4243
"skip-validation-on-null": {
43-
in: types.Float64{Null: true},
44+
in: types.Float64Null(),
4445
validator: float64validator.OneOf(
4546
234.567,
4647
8910.11,
@@ -49,7 +50,7 @@ func TestOneOfValidator(t *testing.T) {
4950
expErrors: 0,
5051
},
5152
"skip-validation-on-unknown": {
52-
in: types.Float64{Unknown: true},
53+
in: types.Float64Unknown(),
5354
validator: float64validator.OneOf(
5455
234.567,
5556
8910.11,

float64validator/type_validation_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestValidateFloat(t *testing.T) {
2020
}{
2121
"invalid-type": {
2222
request: tfsdk.ValidateAttributeRequest{
23-
AttributeConfig: types.Bool{Value: true},
23+
AttributeConfig: types.BoolValue(true),
2424
AttributePath: path.Root("test"),
2525
AttributePathExpression: path.MatchRoot("test"),
2626
},
@@ -29,7 +29,7 @@ func TestValidateFloat(t *testing.T) {
2929
},
3030
"float64-null": {
3131
request: tfsdk.ValidateAttributeRequest{
32-
AttributeConfig: types.Float64{Null: true},
32+
AttributeConfig: types.Float64Null(),
3333
AttributePath: path.Root("test"),
3434
AttributePathExpression: path.MatchRoot("test"),
3535
},
@@ -38,7 +38,7 @@ func TestValidateFloat(t *testing.T) {
3838
},
3939
"float64-value": {
4040
request: tfsdk.ValidateAttributeRequest{
41-
AttributeConfig: types.Float64{Value: 1.2},
41+
AttributeConfig: types.Float64Value(1.2),
4242
AttributePath: path.Root("test"),
4343
AttributePathExpression: path.MatchRoot("test"),
4444
},
@@ -47,7 +47,7 @@ func TestValidateFloat(t *testing.T) {
4747
},
4848
"float64-unknown": {
4949
request: tfsdk.ValidateAttributeRequest{
50-
AttributeConfig: types.Float64{Unknown: true},
50+
AttributeConfig: types.Float64Unknown(),
5151
AttributePath: path.Root("test"),
5252
AttributePathExpression: path.MatchRoot("test"),
5353
},

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/google/go-cmp v0.5.9
7-
github.com/hashicorp/terraform-plugin-framework v0.15.0
7+
github.com/hashicorp/terraform-plugin-framework v0.16.0
88
github.com/hashicorp/terraform-plugin-go v0.14.1
99
)
1010

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
1313
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1414
github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw=
1515
github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
16-
github.com/hashicorp/terraform-plugin-framework v0.15.0 h1:6f4UY2yfp5UsSX9JhUA6RSptjd+ojStBGWA4jrPhB6Q=
17-
github.com/hashicorp/terraform-plugin-framework v0.15.0/go.mod h1:wcZdk4+Uef6Ng+BiBJjGAcIPlIs5bhlEV/TA1k6Xkq8=
16+
github.com/hashicorp/terraform-plugin-framework v0.16.0 h1:kEHh0d6dp5Ig/ey6PYXkWDZPMLIW8Me41T/Oa7bpO4s=
17+
github.com/hashicorp/terraform-plugin-framework v0.16.0/go.mod h1:Vk5MuIJoE1qksHZawAZr6psx6YXsQBFIKDrWbROrwus=
1818
github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek=
1919
github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ=
2020
github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs=

0 commit comments

Comments
 (0)