From beee7620357a18a8e75cdcb1db4edc85a6bf378b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 15:23:43 +0000 Subject: [PATCH 1/2] chore(deps): bump github.com/hashicorp/terraform-plugin-framework Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 0.13.0 to 0.14.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v0.13.0...v0.14.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] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2f77960..b81a62e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 - github.com/hashicorp/terraform-plugin-framework v0.13.0 + github.com/hashicorp/terraform-plugin-framework v0.14.0 github.com/hashicorp/terraform-plugin-go v0.14.0 ) diff --git a/go.sum b/go.sum index a0768c8..56b38a2 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/terraform-plugin-framework v0.13.0 h1:tGnqttzZwU3FKc+HasHr2Yi5L81FcQbdc8zQhbBD9jQ= -github.com/hashicorp/terraform-plugin-framework v0.13.0/go.mod h1:wcZdk4+Uef6Ng+BiBJjGAcIPlIs5bhlEV/TA1k6Xkq8= +github.com/hashicorp/terraform-plugin-framework v0.14.0 h1:Mwj55u+Jc/QGM6fLBPCe1P+ZF3cuYs6wbCdB15lx/Dg= +github.com/hashicorp/terraform-plugin-framework v0.14.0/go.mod h1:wcZdk4+Uef6Ng+BiBJjGAcIPlIs5bhlEV/TA1k6Xkq8= github.com/hashicorp/terraform-plugin-go v0.14.0 h1:ttnSlS8bz3ZPYbMb84DpcPhY4F5DsQtcAS7cHo8uvP4= github.com/hashicorp/terraform-plugin-go v0.14.0/go.mod h1:2nNCBeRLaenyQEi78xrGrs9hMbulveqG/zDMQSvVJTE= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= From ef1fcf5e02f707a7e3c3f3f52f003f6c00ee990b Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Thu, 6 Oct 2022 09:25:16 +1300 Subject: [PATCH 2/2] feat(uuidtypes): adds support for `github.com/hashicorp/terraform-plugin-framework@v0.14.0`. --- uuidtypes/uuid_type.go | 5 +++++ uuidtypes/uuid_type_test.go | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/uuidtypes/uuid_type.go b/uuidtypes/uuid_type.go index 06f7f01..209ee5a 100644 --- a/uuidtypes/uuid_type.go +++ b/uuidtypes/uuid_type.go @@ -110,3 +110,8 @@ func (u UUIDType) ValueFromTerraform(_ context.Context, value tftypes.Value) (at return UUIDFromGoogleUUID(parsedUUID), nil } + +// ValueType returns attr.Value type returned by ValueFromTerraform. +func (u UUIDType) ValueType(context.Context) attr.Value { + return UUID{} +} diff --git a/uuidtypes/uuid_type_test.go b/uuidtypes/uuid_type_test.go index e91589d..53a8aa1 100644 --- a/uuidtypes/uuid_type_test.go +++ b/uuidtypes/uuid_type_test.go @@ -412,3 +412,37 @@ func TestType_ValueFromTerraform(t *testing.T) { }) } } + +func TestUUIDType_ValueType(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + value uuidtypes.UUIDType + expected attr.Value + }{ + { + name: "always", + value: uuidtypes.UUIDType{}, + expected: uuidtypes.UUID{}, + }, + } + for _, testcase := range tests { + testcase := testcase + + t.Run(testcase.name, func(t *testing.T) { + t.Parallel() + + got := testcase.value.ValueType(context.Background()) + + if diff := cmp.Diff(got, testcase.expected); diff != "" { + t.Errorf( + "Type()\ngot : %v\nexpected: %v\ndiff: %v\n", + got, + testcase.expected, + diff, + ) + } + }) + } +}