Skip to content

Bump github.com/hashicorp/terraform-plugin-go from 0.6.0 to 0.7.0 #249

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/249.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
tfsdk: The `ListNestedAttributesOptions`, `MapNestedAttributeOptions`, and `SetNestedAttributeOptions` type `MaxItems` and `MinItems` fields have been removed since the protocol and framework never supported this type of nested attribute validation. Use attribute validators instead.
```
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.17

require (
github.com/google/go-cmp v0.5.6
github.com/hashicorp/terraform-plugin-go v0.6.0
github.com/hashicorp/terraform-plugin-go v0.7.0
github.com/hashicorp/terraform-plugin-log v0.2.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ3
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/terraform-plugin-go v0.6.0 h1:EmeULv7+/eMsQpb1iJpuVCcbxNmY5C0lo5cEX712Zhc=
github.com/hashicorp/terraform-plugin-go v0.6.0/go.mod h1:p+L2cRtja1Rr5A/S9flPLAzHyt2544MhIpAfwqnK7U0=
github.com/hashicorp/terraform-plugin-go v0.7.0 h1:djd0aLO1uRr/VHaR12wryEFAPEFoHNIvRfCGkOrQqQI=
github.com/hashicorp/terraform-plugin-go v0.7.0/go.mod h1:p+L2cRtja1Rr5A/S9flPLAzHyt2544MhIpAfwqnK7U0=
github.com/hashicorp/terraform-plugin-log v0.2.1 h1:hl0G6ctSx7DRTE62VNsPWrq7d+JWy1kjk9ApOFrCq3I=
github.com/hashicorp/terraform-plugin-log v0.2.1/go.mod h1:RW/n0x4dyITmenuirZ1ViPQGP5JQdPTZ4Wwc0rLKi94=
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw=
Expand Down
5 changes: 1 addition & 4 deletions tfsdk/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ func (a Attribute) tfprotov6SchemaAttribute(ctx context.Context, name string, pa
return schemaAttribute, nil
}

object := &tfprotov6.SchemaObject{
MinItems: a.Attributes.GetMinItems(),
MaxItems: a.Attributes.GetMaxItems(),
}
object := &tfprotov6.SchemaObject{}
nm := a.Attributes.GetNestingMode()
switch nm {
case NestingModeSingle:
Expand Down
250 changes: 0 additions & 250 deletions tfsdk/attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,131 +334,6 @@ func TestAttributeTfprotov6SchemaAttribute(t *testing.T) {
},
},
},
"nested-attr-list-min": {
name: "list_nested",
attr: Attribute{
Attributes: ListNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, ListNestedAttributesOptions{
MinItems: 1,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "list_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeList,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MinItems: 1,
},
},
},
"nested-attr-list-max": {
name: "list_nested",
attr: Attribute{
Attributes: ListNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, ListNestedAttributesOptions{
MaxItems: 1,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "list_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeList,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MaxItems: 1,
},
},
},
"nested-attr-list-minmax": {
name: "list_nested",
attr: Attribute{
Attributes: ListNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, ListNestedAttributesOptions{
MinItems: 1,
MaxItems: 10,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "list_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeList,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MinItems: 1,
MaxItems: 10,
},
},
},
"nested-attr-set": {
name: "set_nested",
attr: Attribute{
Expand Down Expand Up @@ -497,131 +372,6 @@ func TestAttributeTfprotov6SchemaAttribute(t *testing.T) {
},
},
},
"nested-attr-set-min": {
name: "set_nested",
attr: Attribute{
Attributes: SetNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, SetNestedAttributesOptions{
MinItems: 1,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "set_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeSet,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MinItems: 1,
},
},
},
"nested-attr-set-max": {
name: "set_nested",
attr: Attribute{
Attributes: SetNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, SetNestedAttributesOptions{
MaxItems: 1,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "set_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeSet,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MaxItems: 1,
},
},
},
"nested-attr-set-minmax": {
name: "set_nested",
attr: Attribute{
Attributes: SetNestedAttributes(map[string]Attribute{
"string": {
Type: types.StringType,
Optional: true,
},
"computed": {
Type: types.NumberType,
Computed: true,
Sensitive: true,
},
}, SetNestedAttributesOptions{
MinItems: 1,
MaxItems: 10,
}),
Optional: true,
},
path: tftypes.NewAttributePath(),
expected: &tfprotov6.SchemaAttribute{
Name: "set_nested",
Optional: true,
NestedType: &tfprotov6.SchemaObject{
Nesting: tfprotov6.SchemaObjectNestingModeSet,
Attributes: []*tfprotov6.SchemaAttribute{
{
Name: "computed",
Computed: true,
Sensitive: true,
Type: tftypes.Number,
},
{
Name: "string",
Optional: true,
Type: tftypes.String,
},
},
MinItems: 1,
MaxItems: 10,
},
},
},
"attr-and-nested-attr-set": {
name: "whoops",
attr: Attribute{
Expand Down
Loading