Skip to content

Commit

Permalink
Bump github.com/hashicorp/terraform-plugin-go from 0.6.0 to 0.7.0 (#249)
Browse files Browse the repository at this point in the history
* Bump github.com/hashicorp/terraform-plugin-go from 0.6.0 to 0.7.0

Bumps [github.com/hashicorp/terraform-plugin-go](https://github.com/hashicorp/terraform-plugin-go) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-go/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-go/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-go@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* tfsdk: Remove `ListNestedAttributesOptions`, `MapNestedAttributeOptions`, and `SetNestedAttributeOptions` type `MaxItems` and `MinItems` fields

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brian Flad <bflad417@gmail.com>
  • Loading branch information
dependabot[bot] and bflad authored Jan 21, 2022
1 parent 25319fc commit 7e408a5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 333 deletions.
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

0 comments on commit 7e408a5

Please sign in to comment.