Skip to content

Commit 427de1c

Browse files
committed
Bump terraform-plugin-framework to v1.1.0 (#112)
1 parent b70ca47 commit 427de1c

File tree

4 files changed

+94
-42
lines changed

4 files changed

+94
-42
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ go 1.18
44

55
require (
66
github.com/hashicorp/terraform-plugin-docs v0.13.0
7-
github.com/hashicorp/terraform-plugin-framework v0.17.0
8-
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0
9-
github.com/hashicorp/terraform-plugin-go v0.14.2
7+
github.com/hashicorp/terraform-plugin-framework v1.1.0
8+
github.com/hashicorp/terraform-plugin-framework-validators v0.9.0
9+
github.com/hashicorp/terraform-plugin-go v0.14.3
1010
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
1111
)
1212

@@ -29,7 +29,7 @@ require (
2929
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
3030
github.com/hashicorp/go-hclog v1.2.1 // indirect
3131
github.com/hashicorp/go-multierror v1.1.1 // indirect
32-
github.com/hashicorp/go-plugin v1.4.6 // indirect
32+
github.com/hashicorp/go-plugin v1.4.8 // indirect
3333
github.com/hashicorp/go-uuid v1.0.3 // indirect
3434
github.com/hashicorp/go-version v1.6.0 // indirect
3535
github.com/hashicorp/hc-install v0.4.0 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH
9999
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
100100
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
101101
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
102-
github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA=
103-
github.com/hashicorp/go-plugin v1.4.6/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s=
102+
github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM=
103+
github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s=
104104
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
105105
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
106106
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -120,12 +120,12 @@ github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e
120120
github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM=
121121
github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY=
122122
github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ=
123-
github.com/hashicorp/terraform-plugin-framework v0.17.0 h1:0KUOY/oe1GPLFqaXnKDnd1rhCrnUtt8pV9wGEwNUFlU=
124-
github.com/hashicorp/terraform-plugin-framework v0.17.0/go.mod h1:FV97t2BZOARkL7NNlsc/N25c84MyeSSz72uPp7Vq1lg=
125-
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0 h1:tIYOMNmEMQIc6mwun8nX3e5U3TkgZg1TpXRlBEBQHwY=
126-
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0/go.mod h1:e1RKREyEVdd3FK8Jfgz8L/ThQgcJKLb4ZJxNzsuIH0A=
127-
github.com/hashicorp/terraform-plugin-go v0.14.2 h1:rhsVEOGCnY04msNymSvbUsXfRLKh9znXZmHlf5e8mhE=
128-
github.com/hashicorp/terraform-plugin-go v0.14.2/go.mod h1:Q12UjumPNGiFsZffxOsA40Tlz1WVXt2Evh865Zj0+UA=
123+
github.com/hashicorp/terraform-plugin-framework v1.1.0 h1:tdEapdbY5wPQDYlxEzdVWEbdir/cUd4qKyLBv2fGglA=
124+
github.com/hashicorp/terraform-plugin-framework v1.1.0/go.mod h1:DyZPxQA+4OKK5ELxFIIcqggcszqdWWUpTLPHAhS/tkY=
125+
github.com/hashicorp/terraform-plugin-framework-validators v0.9.0 h1:LYz4bXh3t7bTEydXOmPDPupRRnA480B/9+jV8yZvxBA=
126+
github.com/hashicorp/terraform-plugin-framework-validators v0.9.0/go.mod h1:+BVERsnfdlhYR2YkXMBtPnmn9UsL19U3qUtSZ+Y/5MY=
127+
github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0=
128+
github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A=
129129
github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs=
130130
github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
131131
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM=

internal/provider/data_source_archive_file_test.go

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,19 @@ func TestAccArchiveFile_SourceConfigMissing(t *testing.T) {
315315
Steps: []r.TestStep{
316316
{
317317
Config: testAccArchiveSourceConfigMissing(),
318-
ExpectError: regexp.MustCompile(`.*At least one of these attributes must be configured:\n\[source_content_filename,source_file,source_dir]`),
318+
ExpectError: regexp.MustCompile(`.*At least one of these attributes must be configured:\n\[source,source_content_filename,source_file,source_dir\]`),
319+
},
320+
},
321+
})
322+
}
323+
324+
func TestAccArchiveFile_SourceConfigConflicting(t *testing.T) {
325+
r.ParallelTest(t, r.TestCase{
326+
ProtoV5ProviderFactories: protoV5ProviderFactories(),
327+
Steps: []r.TestStep{
328+
{
329+
Config: testAccArchiveSourceConfigConflicting(),
330+
ExpectError: regexp.MustCompile(`.*Attribute "source_dir" cannot be specified when "source" is specified`),
319331
},
320332
},
321333
})
@@ -369,27 +381,27 @@ data "archive_file" "foo" {
369381
func testAccArchiveFileDirExcludesConfig(outputPath string) string {
370382
return fmt.Sprintf(`
371383
data "archive_file" "foo" {
372-
type = "zip"
373-
source_dir = "test-fixtures/test-dir"
374-
excludes = ["test-fixtures/test-dir/file2.txt"]
375-
output_path = "%s"
384+
type = "zip"
385+
source_dir = "test-fixtures/test-dir"
386+
excludes = ["test-fixtures/test-dir/file2.txt"]
387+
output_path = "%s"
376388
}
377389
`, filepath.ToSlash(outputPath))
378390
}
379391

380392
func testAccArchiveFileMultiSourceConfig(outputPath string) string {
381393
return fmt.Sprintf(`
382394
data "archive_file" "foo" {
383-
type = "zip"
384-
source {
385-
filename = "content_1.txt"
386-
content = "This is the content for content_1.txt"
387-
}
388-
source {
389-
filename = "content_2.txt"
390-
content = "This is the content for content_2.txt"
391-
}
392-
output_path = "%s"
395+
type = "zip"
396+
source {
397+
filename = "content_1.txt"
398+
content = "This is the content for content_1.txt"
399+
}
400+
source {
401+
filename = "content_2.txt"
402+
content = "This is the content for content_2.txt"
403+
}
404+
output_path = "%s"
393405
}
394406
`, filepath.ToSlash(outputPath))
395407
}
@@ -403,6 +415,20 @@ data "archive_file" "foo" {
403415
`
404416
}
405417

418+
func testAccArchiveSourceConfigConflicting() string {
419+
return `
420+
data "archive_file" "foo" {
421+
type = "zip"
422+
source {
423+
filename = "content_1.txt"
424+
content = "This is the content for content_1.txt"
425+
}
426+
source_dir = "test-fixtures/test-dir"
427+
output_path = "path"
428+
}
429+
`
430+
}
431+
406432
//nolint:unparam
407433
func testExtractResourceAttr(resourceName string, attributeName string, attributeValue *string) r.TestCheckFunc {
408434
return func(s *terraform.State) error {

internal/provider/resource_archive_file_test.go

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,19 @@ func TestResource_SourceConfigMissing(t *testing.T) {
396396
Steps: []r.TestStep{
397397
{
398398
Config: testResourceSourceConfigMissing(),
399-
ExpectError: regexp.MustCompile(`.*At least one of these attributes must be configured:\n\[source_content_filename,source_file,source_dir]`),
399+
ExpectError: regexp.MustCompile(`.*At least one of these attributes must be configured:\n\[source,source_content_filename,source_file,source_dir]`),
400+
},
401+
},
402+
})
403+
}
404+
405+
func TestResource_SourceConfigConflicting(t *testing.T) {
406+
r.ParallelTest(t, r.TestCase{
407+
ProtoV5ProviderFactories: protoV5ProviderFactories(),
408+
Steps: []r.TestStep{
409+
{
410+
Config: testResourceSourceConfigConflicting(),
411+
ExpectError: regexp.MustCompile(`.*Attribute "source_dir" cannot be specified when "source" is specified`),
400412
},
401413
},
402414
})
@@ -465,27 +477,27 @@ resource "archive_file" "foo" {
465477
func testAccArchiveFileResourceDirExcludesConfig(outputPath string) string {
466478
return fmt.Sprintf(`
467479
resource "archive_file" "foo" {
468-
type = "zip"
469-
source_dir = "test-fixtures/test-dir"
470-
excludes = ["test-fixtures/test-dir/file2.txt"]
471-
output_path = "%s"
480+
type = "zip"
481+
source_dir = "test-fixtures/test-dir"
482+
excludes = ["test-fixtures/test-dir/file2.txt"]
483+
output_path = "%s"
472484
}
473485
`, filepath.ToSlash(outputPath))
474486
}
475487

476488
func testAccArchiveFileResourceMultiSourceConfig(outputPath string) string {
477489
return fmt.Sprintf(`
478490
resource "archive_file" "foo" {
479-
type = "zip"
480-
source {
481-
filename = "content_1.txt"
482-
content = "This is the content for content_1.txt"
483-
}
484-
source {
485-
filename = "content_2.txt"
486-
content = "This is the content for content_2.txt"
487-
}
488-
output_path = "%s"
491+
type = "zip"
492+
source {
493+
filename = "content_1.txt"
494+
content = "This is the content for content_1.txt"
495+
}
496+
source {
497+
filename = "content_2.txt"
498+
content = "This is the content for content_2.txt"
499+
}
500+
output_path = "%s"
489501
}
490502
`, filepath.ToSlash(outputPath))
491503
}
@@ -498,3 +510,17 @@ resource "archive_file" "foo" {
498510
}
499511
`
500512
}
513+
514+
func testResourceSourceConfigConflicting() string {
515+
return `
516+
resource "archive_file" "foo" {
517+
type = "zip"
518+
source {
519+
filename = "content_1.txt"
520+
content = "This is the content for content_1.txt"
521+
}
522+
source_dir = "test-fixtures/test-dir"
523+
output_path = "path"
524+
}
525+
`
526+
}

0 commit comments

Comments
 (0)