From fce66dbf3cd31f28ef1c27d0ad5716130d6a2ad6 Mon Sep 17 00:00:00 2001 From: Alex Pilon Date: Fri, 31 Jul 2020 11:51:06 -0400 Subject: [PATCH] Update missed references to SDKv1 --- .golangci.yml | 2 +- aws/internal/keyvaluetags/generators/createtags/main.go | 2 +- awsproviderlint/passes/AWSAT001/testdata/src/a/main.go | 2 +- awsproviderlint/passes/AWSAT004/testdata/src/a/main.go | 2 +- awsproviderlint/passes/AWSR002/README.md | 2 +- docs/contributing/running-and-writing-acceptance-tests.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1f890181c59..7b207c74554 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,7 +35,7 @@ linters: linters-settings: errcheck: - ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close + ignore: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set,fmt:.*,io:Close run: modules-download-mode: vendor diff --git a/aws/internal/keyvaluetags/generators/createtags/main.go b/aws/internal/keyvaluetags/generators/createtags/main.go index 3355d83a86c..54c505be465 100644 --- a/aws/internal/keyvaluetags/generators/createtags/main.go +++ b/aws/internal/keyvaluetags/generators/createtags/main.go @@ -97,7 +97,7 @@ import ( {{- range .ServiceNames }} "github.com/aws/aws-sdk-go/service/{{ . }}" {{- end }} - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) const EventualConsistencyTimeout = 5 * time.Minute diff --git a/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go b/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go index ce09ccc7a09..c68c8187ef5 100644 --- a/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go +++ b/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go @@ -3,7 +3,7 @@ package a import ( "regexp" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) const resourceName = `aws_example_thing.test` diff --git a/awsproviderlint/passes/AWSAT004/testdata/src/a/main.go b/awsproviderlint/passes/AWSAT004/testdata/src/a/main.go index 8450bfc5f09..fac6f0b1e1d 100644 --- a/awsproviderlint/passes/AWSAT004/testdata/src/a/main.go +++ b/awsproviderlint/passes/AWSAT004/testdata/src/a/main.go @@ -1,7 +1,7 @@ package a import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func f() { diff --git a/awsproviderlint/passes/AWSR002/README.md b/awsproviderlint/passes/AWSR002/README.md index 122d53bec54..164b81386c3 100644 --- a/awsproviderlint/passes/AWSR002/README.md +++ b/awsproviderlint/passes/AWSR002/README.md @@ -1,6 +1,6 @@ # AWSR002 -The AWSR002 analyzer reports when a [(schema.ResourceData).Set()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema?tab=doc#ResourceData.Set) call with the `tags` key is missing a call to `(keyvaluetags.KeyValueTags).IgnoreConfig()` in the value, which ensures any provider level ignore tags configuration is applied. +The AWSR002 analyzer reports when a [(schema.ResourceData).Set()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema?tab=doc#ResourceData.Set) call with the `tags` key is missing a call to `(keyvaluetags.KeyValueTags).IgnoreConfig()` in the value, which ensures any provider level ignore tags configuration is applied. ## Flagged Code diff --git a/docs/contributing/running-and-writing-acceptance-tests.md b/docs/contributing/running-and-writing-acceptance-tests.md index 992f0b73722..bb393c931c8 100644 --- a/docs/contributing/running-and-writing-acceptance-tests.md +++ b/docs/contributing/running-and-writing-acceptance-tests.md @@ -777,7 +777,7 @@ Writing acceptance testing for data sources is similar to resources, with the bi - Adding `DataSource` to the test and configuration naming, such as `TestAccAwsExampleThingDataSource_Filter` - The basic test _may_ be named after the easiest lookup attribute instead, e.g. `TestAccAwsExampleThingDataSource_Name` - No disappears testing -- Almost all checks should be done with [`resource.TestCheckResourceAttrPair()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/resource?tab=doc#TestCheckResourceAttrPair) to compare the data source attributes to the resource attributes +- Almost all checks should be done with [`resource.TestCheckResourceAttrPair()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource?tab=doc#TestCheckResourceAttrPair) to compare the data source attributes to the resource attributes - The usage of an additional `dataSourceName` variable to store a data source reference, e.g. `data.aws_example_thing.test` Data sources testing should still utilize the `CheckDestroy` function of the resource, just to continue verifying that there are no dangling AWS resources after a test is ran.