Skip to content

Commit

Permalink
Update missed references to SDKv1
Browse files Browse the repository at this point in the history
  • Loading branch information
appilon committed Aug 4, 2020
1 parent 3d76c4a commit fce66db
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion aws/internal/keyvaluetags/generators/createtags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion awsproviderlint/passes/AWSAT001/testdata/src/a/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion awsproviderlint/passes/AWSAT004/testdata/src/a/main.go
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion awsproviderlint/passes/AWSR002/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/running-and-writing-acceptance-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fce66db

Please sign in to comment.