diff --git a/.github/workflows/automation-open-pull-request.yaml b/.github/workflows/automation-open-pull-request.yaml index 4e4ddfe8eabc..d342b211627f 100644 --- a/.github/workflows/automation-open-pull-request.yaml +++ b/.github/workflows/automation-open-pull-request.yaml @@ -1,4 +1,6 @@ +--- name: Open Pull Request when an `auto-pr` is pushed + on: push: branches: diff --git a/.github/workflows/depscheck.yaml b/.github/workflows/depscheck.yaml index 855c8b97b058..308335f85469 100644 --- a/.github/workflows/depscheck.yaml +++ b/.github/workflows/depscheck.yaml @@ -1,23 +1,24 @@ --- name: Vendor Dependencies Check + permissions: contents: read + on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' - - '**.go' + - '.github/workflows/depscheck.yaml' - 'vendor/**' - - '.github/workflows/**' + - '**.go' jobs: depscheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make depscheck diff --git a/.github/workflows/gencheck.yaml b/.github/workflows/gencheck.yaml index 0595da4517cf..343000d3523f 100644 --- a/.github/workflows/gencheck.yaml +++ b/.github/workflows/gencheck.yaml @@ -1,15 +1,15 @@ --- name: Generation Check + permissions: contents: read + on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' + - '.github/workflows/gencheck.yaml' - '**.go' - - 'azurerm/**' - - '.github/workflows/**' concurrency: group: 'gencheck-${{ github.head_ref }}' @@ -17,11 +17,11 @@ concurrency: jobs: gencheck: - runs-on: ubuntu-latest + runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make gencheck diff --git a/.github/workflows/golint.yaml b/.github/workflows/golint.yaml index 11ab88033119..588d16e3f3d4 100644 --- a/.github/workflows/golint.yaml +++ b/.github/workflows/golint.yaml @@ -1,15 +1,16 @@ --- name: GoLang Linting + permissions: contents: read + on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' - - '**.go' + - '.github/workflows/golint.yaml' - 'vendor/**' - - '.github/workflows/**' + - '**.go' concurrency: group: 'golint-${{ github.head_ref }}' @@ -17,13 +18,13 @@ concurrency: jobs: golint: - runs-on: ubuntu-latest + runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' - - uses: golangci/golangci-lint-action@v2 + go-version-file: .go-version + - uses: golangci/golangci-lint-action@v3 with: - version: 'v1.45.0' + version: 'v1.50.1' args: -v diff --git a/.github/workflows/gradually-deprecated.yaml b/.github/workflows/gradually-deprecated.yaml index 9f3c74f45e7b..f13dbc149d75 100644 --- a/.github/workflows/gradually-deprecated.yaml +++ b/.github/workflows/gradually-deprecated.yaml @@ -1,12 +1,14 @@ --- name: Check for new usages of deprecated functionality + permissions: contents: read + on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' + - '.github/workflows/gradually-deprecated.yaml' - '**.go' jobs: @@ -16,7 +18,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: ./scripts/run-gradually-deprecated.sh diff --git a/.github/workflows/issue-comment-created.yaml b/.github/workflows/issue-comment-created.yaml index 9fc1a1778e70..55e524d7a1e6 100644 --- a/.github/workflows/issue-comment-created.yaml +++ b/.github/workflows/issue-comment-created.yaml @@ -1,3 +1,4 @@ +--- name: Issue Comment Created Triage on: @@ -26,6 +27,7 @@ jobs: with: github_token: "${{ secrets.GITHUB_TOKEN }}" labels: waiting-response + pull_request_comment: runs-on: ubuntu-latest if: github.event.issue.pull_request && endsWith(github.event.comment.body, '/wr') diff --git a/.github/workflows/issue-opened.yaml b/.github/workflows/issue-opened.yaml index be042499bd84..335a3a80623b 100644 --- a/.github/workflows/issue-opened.yaml +++ b/.github/workflows/issue-opened.yaml @@ -1,3 +1,4 @@ +--- name: Issue Opened Triage permissions: diff --git a/.github/workflows/link-milestone.yaml b/.github/workflows/link-milestone.yaml index 222032f37628..43969b37ea6e 100644 --- a/.github/workflows/link-milestone.yaml +++ b/.github/workflows/link-milestone.yaml @@ -1,5 +1,6 @@ --- name: Link Milestone + on: pull_request_target: branches: [main] @@ -14,9 +15,9 @@ jobs: pull-requests: write issues: write steps: - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: | go install github.com/stephybun/link-milestone@latest link-milestone diff --git a/.github/workflows/lock.yaml b/.github/workflows/lock.yaml index 4e162901f70c..cf7783fadd6b 100644 --- a/.github/workflows/lock.yaml +++ b/.github/workflows/lock.yaml @@ -1,3 +1,4 @@ +--- name: 'Lock Threads' on: diff --git a/.github/workflows/milestone-closed.yaml b/.github/workflows/milestone-closed.yaml index abb8b656eb85..cd68c1b973da 100644 --- a/.github/workflows/milestone-closed.yaml +++ b/.github/workflows/milestone-closed.yaml @@ -1,3 +1,4 @@ +--- name: Closed Milestones on: diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index d0bf91008465..319bdfb3f452 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,3 +1,4 @@ +--- name: "Pull Request Triage" permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yaml similarity index 80% rename from .github/workflows/release.yml rename to .github/workflows/release.yaml index f732d64ad444..e6d723ccbcda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yaml @@ -1,3 +1,4 @@ +--- name: Release on: @@ -9,14 +10,6 @@ permissions: contents: write jobs: - go-version: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.go-version.outputs.version }} - steps: - - uses: actions/checkout@v3 - - id: go-version - run: echo "::set-output name=version::$(cat ./.go-version)" release-notes: runs-on: ubuntu-latest steps: @@ -30,10 +23,11 @@ jobs: name: release-notes path: release-notes.txt retention-days: 1 + terraform-provider-release: name: 'Terraform Provider Release' needs: [go-version, release-notes] - uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v2 + uses: manicminer/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@1dba3fa320b576c92d2206c9514e5f9622730010 secrets: hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}' hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}' @@ -48,6 +42,6 @@ jobs: goreleaser-release-args: --timeout 2h hc-releases-aws-role-duration-seconds: 7200 release-notes: true - setup-go-version: '${{ needs.go-version.outputs.version }}' + setup-go-version-file: .go-version # Product Version (e.g. v1.2.3 or github.ref_name) product-version: '${{ github.ref_name }}' diff --git a/.github/workflows/teamcity-test.yaml b/.github/workflows/teamcity-test.yaml index 0651d797c2d8..6e45290c8b7d 100644 --- a/.github/workflows/teamcity-test.yaml +++ b/.github/workflows/teamcity-test.yaml @@ -8,10 +8,10 @@ on: pull_request: types: ['opened', 'synchronize'] paths: + - '.github/workflows/teamcity-test.yaml' - '!.teamcity/components/generated/**' - '!.teamcity/target/**' - '.teamcity/**' - - '.github/workflows/**' concurrency: group: 'tctest-${{ github.head_ref }}' @@ -22,11 +22,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: - java-version: '11' + distribution: zulu + java-version: 11 java-package: jdk - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/tflint.yaml b/.github/workflows/tflint.yaml index 00a27ef4bb1a..385a83364228 100644 --- a/.github/workflows/tflint.yaml +++ b/.github/workflows/tflint.yaml @@ -8,10 +8,9 @@ on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' - - '**.go' + - '.github/workflows/tflint.yaml' - 'vendor/**' - - '.github/workflows/**' + - '**.go' concurrency: group: 'tflint-${{ github.head_ref }}' @@ -20,11 +19,12 @@ concurrency: jobs: tflint: runs-on: ubuntu-latest + if: false # skip until https://github.com/bflad/tfproviderlint/issues/255 is fixed steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make tools - run: make tflint diff --git a/.github/workflows/thirty-two-bit.yaml b/.github/workflows/thirty-two-bit.yaml index 2bb4cc53b868..2d1417e488a3 100644 --- a/.github/workflows/thirty-two-bit.yaml +++ b/.github/workflows/thirty-two-bit.yaml @@ -9,10 +9,9 @@ on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/**' - - '**.go' + - '.github/workflows/thirty-two-bit.yaml' - 'vendor/**' - - '.github/workflows/**' + - '**.go' concurrency: group: 'thirtytwo-${{ github.head_ref }}' @@ -23,8 +22,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: GOARCH=386 GOOS=linux go build -o 32bitbuild . diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 26196e9b5bd7..6cfd445d0500 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -9,9 +9,9 @@ on: pull_request: types: ['opened', 'synchronize'] paths: - - '**.go' + - '.github/workflows/unit-test.yaml' - 'vendor/**' - - '.github/workflows/**' + - '**.go' concurrency: group: 'unit-${{ github.head_ref }}' @@ -19,12 +19,12 @@ concurrency: jobs: test: - runs-on: ubuntu-latest + runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make test env: diff --git a/.github/workflows/validate-examples.yaml b/.github/workflows/validate-examples.yaml index 534519e2acac..b8a9a8cdaf2d 100644 --- a/.github/workflows/validate-examples.yaml +++ b/.github/workflows/validate-examples.yaml @@ -9,7 +9,7 @@ on: pull_request: types: ['opened', 'synchronize'] paths: - - '.github/workflows/**' + - '.github/workflows/validate-examples.yaml' - 'examples/**' concurrency: @@ -18,12 +18,12 @@ concurrency: jobs: website-lint: - runs-on: ubuntu-latest + runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.19.3' + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make tools - run: make validate-examples diff --git a/.github/workflows/website-lint.yaml b/.github/workflows/website-lint.yaml index 9852956612a5..9d067106bf00 100644 --- a/.github/workflows/website-lint.yaml +++ b/.github/workflows/website-lint.yaml @@ -9,17 +9,17 @@ on: pull_request: types: ["opened", "synchronize"] paths: + - ".github/workflows/website-lint.yaml" - "website/**" - - ".github/workflows/**" jobs: website-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: "1.19.3" + go-version-file: .go-version - run: bash scripts/gogetcookie.sh - run: make tools - run: make website-lint diff --git a/.golangci.yml b/.golangci.yml index 96481cc43590..23d93685d83d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ run: skip-dirs: - /sdk/ # Excluding sdk folders as these are externally generated skip-files: - - ".*\\*_gen.go$" + - "internal/services/.*/.*_gen.go$" issues: max-per-linter: 0 @@ -15,7 +15,7 @@ linters: disable-all: true enable: - asciicheck - - deadcode + - bidichk - errcheck - gocritic - gofmt @@ -25,15 +25,17 @@ linters: - ineffassign - nakedret - misspell + #- nolintlint + #- nlreturn + - reassign - staticcheck - - structcheck - typecheck - unused - unconvert - unparam - - varcheck - vet - vetshadow + # - wastedassign # disabled because of generics # - whitespace # Disabled for performance reasons - Ignores cache and takes 12+ minutes to run on the repo for _any_ change linters-settings: diff --git a/GNUmakefile b/GNUmakefile index 9ba529b493fc..3532cb1423a2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,5 @@ TEST?=$$(go list ./... |grep -v 'vendor'|grep -v 'examples') WEBSITE_REPO=github.com/hashicorp/terraform-website -PKG_NAME=azurerm TESTTIMEOUT=180m .EXPORT_ALL_VARIABLES: @@ -17,7 +16,7 @@ tools: go install github.com/katbyte/terrafmt@latest go install golang.org/x/tools/cmd/goimports@latest go install mvdan.cc/gofumpt@latest - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH || $$GOPATH)/bin v1.45.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH || $$GOPATH)/bin v1.50.1 build: fmtcheck generate go install @@ -88,7 +87,7 @@ test: fmtcheck test-compile: @if [ "$(TEST)" = "./..." ]; then \ echo "ERROR: Set TEST to a specific package. For example,"; \ - echo " make test-compile TEST=./$(PKG_NAME)"; \ + echo " make test-compile TEST=./internal"; \ exit 1; \ fi go test -c $(TEST) $(TESTARGS) @@ -126,7 +125,7 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) endif - @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) + @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=azurerm scaffold-website: ./scripts/scaffold-website.sh diff --git a/contributing/topics/guide-new-data-source.md b/contributing/topics/guide-new-data-source.md index b6385c92359b..b77765e7b9fa 100644 --- a/contributing/topics/guide-new-data-source.md +++ b/contributing/topics/guide-new-data-source.md @@ -43,7 +43,7 @@ The Client for the Service Package can be found in `./internal/services/{name}/c package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/contributing/topics/guide-new-resource.md b/contributing/topics/guide-new-resource.md index 34481f8c8ff1..adbd8ad2db11 100644 --- a/contributing/topics/guide-new-resource.md +++ b/contributing/topics/guide-new-resource.md @@ -41,7 +41,7 @@ The Client for the Service Package can be found in `./internal/services/{name}/c package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -412,7 +412,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/acceptance/testing.go b/internal/acceptance/testing.go index 3d022d96ff86..3f25cb7011e8 100644 --- a/internal/acceptance/testing.go +++ b/internal/acceptance/testing.go @@ -47,8 +47,8 @@ func Environment() (*azure.Environment, error) { } func GetAuthConfig(t *testing.T) *authentication.Config { - if os.Getenv(resource.TestEnvVar) == "" { - t.Skip(fmt.Sprintf("Integration test skipped unless env '%s' set", resource.TestEnvVar)) + if os.Getenv(resource.EnvTfAcc) == "" { + t.Skipf("Integration test skipped unless env '%s' set", resource.EnvTfAcc) return nil } diff --git a/internal/clients/client.go b/internal/clients/client.go index ed4c81251ebf..c2ec9ea167f3 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -2,7 +2,6 @@ package clients import ( "context" - "fmt" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/validation" @@ -245,9 +244,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error // Disable the Azure SDK for Go's validation since it's unhelpful for our use-case validation.Disabled = true - if err := buildAutoClients(&client.autoClient, o); err != nil { - return fmt.Errorf("building auto-sdk clients: %+v", err) - } + buildAutoClients(&client.autoClient, o) client.Features = o.Features client.StopContext = ctx diff --git a/internal/clients/client_gen.go b/internal/clients/client_gen.go index ae043a1995cf..12c713ed5557 100644 --- a/internal/clients/client_gen.go +++ b/internal/clients/client_gen.go @@ -18,9 +18,8 @@ type autoClient struct { ManagedIdentity *managedidentity_v2022_01_31_preview.Client } -func buildAutoClients(client *autoClient, o *common.ClientOptions) error { +func buildAutoClients(client *autoClient, o *common.ClientOptions) { client.ContainerService = containers.NewClient(o) client.LoadTestService = loadtestservice.NewClient(o) client.ManagedIdentity = managedidentity.NewClient(o) - return nil } diff --git a/internal/sdk/README.md b/internal/sdk/README.md index 06abcf545524..3789aabe8000 100644 --- a/internal/sdk/README.md +++ b/internal/sdk/README.md @@ -28,7 +28,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/sdk/logger_console.go b/internal/sdk/logger_console.go index 2233705c181f..7771a7c80281 100644 --- a/internal/sdk/logger_console.go +++ b/internal/sdk/logger_console.go @@ -13,7 +13,7 @@ type ConsoleLogger struct{} // Info prints out a message prefixed with `[INFO]` verbatim func (ConsoleLogger) Info(message string) { - log.Print(fmt.Sprintf("[INFO] %s", message)) + log.Printf("[INFO] %s", message) } // Infof prints out a message prefixed with `[INFO]` formatted @@ -24,7 +24,7 @@ func (l ConsoleLogger) Infof(format string, args ...interface{}) { // Warn prints out a message prefixed with `[WARN]` formatted verbatim func (l ConsoleLogger) Warn(message string) { - log.Print(fmt.Sprintf("[WARN] %s", message)) + log.Printf("[WARN] %s", message) } // Warnf prints out a message prefixed with `[WARN]` formatted diff --git a/internal/sdk/plugin_sdk_test.go b/internal/sdk/plugin_sdk_test.go index 55acd3992d2a..22d2a611e3e0 100644 --- a/internal/sdk/plugin_sdk_test.go +++ b/internal/sdk/plugin_sdk_test.go @@ -60,7 +60,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }, } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -150,7 +150,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { d.SetId("some-id") d.Set("hello", "world") d.Set("random_number", 42) @@ -178,7 +178,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }) return nil }, - Read: func(d *schema.ResourceData, _ interface{}) error { //nolint:SA1019 + Read: func(d *schema.ResourceData, _ interface{}) error { //nolint:staticcheck wrapper := ResourceMetaData{ ResourceData: d, Logger: ConsoleLogger{}, @@ -196,7 +196,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { return nil }, - Delete: func(_ *schema.ResourceData, _ interface{}) error { //nolint:SA1019 + Delete: func(_ *schema.ResourceData, _ interface{}) error { //nolint:staticcheck return nil }, }, @@ -260,7 +260,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { } } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -269,7 +269,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { ResourcesMap: map[string]*schema.Resource{ "validator_decoder_specified": { Schema: commonSchema, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") return nil }, @@ -285,7 +285,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { "validator_decoder_unspecified": { Schema: commonSchema, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("hello", "value-from-create") d.Set("number", 42) @@ -346,7 +346,7 @@ func TestAccPluginSDKAndDecoderOptionalComputedOverride(t *testing.T) { // TODO: do we need other field types, or is this sufficient? } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -371,7 +371,7 @@ func TestAccPluginSDKAndDecoderOptionalComputedOverride(t *testing.T) { Computed: true, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("hello", "value-from-create") d.Set("number", 42) @@ -452,7 +452,7 @@ func TestAccPluginSDKAndDecoderSets(t *testing.T) { // so we should be covered via this test alone } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -490,7 +490,7 @@ func TestAccPluginSDKAndDecoderSets(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("set_of_strings", []string{ "some", @@ -645,7 +645,7 @@ func TestAccPluginSDKAndEncoder(t *testing.T) { SetOfFloats []float64 `tfschema:"set_of_floats"` } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -763,7 +763,7 @@ func TestAccPluginSDKAndEncoder(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck wrapper := ResourceMetaData{ ResourceData: d, Logger: ConsoleLogger{}, @@ -863,7 +863,7 @@ func TestAccPluginSDKReturnsComputedFields(t *testing.T) { os.Setenv("TF_ACC", "1") resourceName := "validator_computed.test" - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -980,7 +980,7 @@ func computedFieldsResource() *schema.Resource { }, }, }, - Create: func(d *schema.ResourceData, meta interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, meta interface{}) error { //nolint:staticcheck d.SetId("does-not-matter") return readFunc(d, meta) }, diff --git a/internal/services/advisor/advisor_recommendations_data_source.go b/internal/services/advisor/advisor_recommendations_data_source.go index d32a3a368f16..56ebc692cb97 100644 --- a/internal/services/advisor/advisor_recommendations_data_source.go +++ b/internal/services/advisor/advisor_recommendations_data_source.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" + "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/advisor/client/client.go b/internal/services/advisor/client/client.go index eb334883655d..e64c96e06ad8 100644 --- a/internal/services/advisor/client/client.go +++ b/internal/services/advisor/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" + "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/analysisservices/analysis_services_server_resource_test.go b/internal/services/analysisservices/analysis_services_server_resource_test.go index 6a6f268ccd77..46abf29602a0 100644 --- a/internal/services/analysisservices/analysis_services_server_resource_test.go +++ b/internal/services/analysisservices/analysis_services_server_resource_test.go @@ -126,7 +126,7 @@ func TestAccAzureRMAnalysisServicesServer_adminUsers(t *testing.T) { const ArmAccAdminEmail2 = "ARM_ACCTEST_ADMIN_EMAIL2" if os.Getenv(ArmAccAdminEmail1) == "" || os.Getenv(ArmAccAdminEmail2) == "" { - t.Skip(fmt.Sprintf("Acceptance test skipped unless env '%s' and '%s' set", ArmAccAdminEmail1, ArmAccAdminEmail2)) + t.Skipf("Acceptance test skipped unless env '%s' and '%s' set", ArmAccAdminEmail1, ArmAccAdminEmail2) return } diff --git a/internal/services/apimanagement/api_management_api_data_source.go b/internal/services/apimanagement/api_management_api_data_source.go index 25bd95d971c4..494e3d1ab612 100644 --- a/internal/services/apimanagement/api_management_api_data_source.go +++ b/internal/services/apimanagement/api_management_api_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_diagnostic_resource.go b/internal/services/apimanagement/api_management_api_diagnostic_resource.go index d829cfc6d3cc..24853c987a58 100644 --- a/internal/services/apimanagement/api_management_api_diagnostic_resource.go +++ b/internal/services/apimanagement/api_management_api_diagnostic_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -124,7 +124,7 @@ func resourceApiManagementApiDiagnostic() *pluginsdk.Resource { } func resourceApiManagementApiDiagnosticAdditionalContentSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, MaxItems: 1, diff --git a/internal/services/apimanagement/api_management_api_operation_policy_resource.go b/internal/services/apimanagement/api_management_api_operation_policy_resource.go index ea79f68aa332..d36c7fe2c4d6 100644 --- a/internal/services/apimanagement/api_management_api_operation_policy_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go b/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go index 2a37ca6e5224..7cd533192e58 100644 --- a/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_resource.go b/internal/services/apimanagement/api_management_api_operation_resource.go index 7e52908ea569..6a9c032a3f52 100644 --- a/internal/services/apimanagement/api_management_api_operation_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_tag_resource.go b/internal/services/apimanagement/api_management_api_operation_tag_resource.go index 6eeb705adfa4..bb9c042d2935 100644 --- a/internal/services/apimanagement/api_management_api_operation_tag_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_tag_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_policy_resource.go b/internal/services/apimanagement/api_management_api_policy_resource.go index 82fe7be34ec6..7df4ba936aa3 100644 --- a/internal/services/apimanagement/api_management_api_policy_resource.go +++ b/internal/services/apimanagement/api_management_api_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_policy_resource_test.go b/internal/services/apimanagement/api_management_api_policy_resource_test.go index e021d763d617..1e3bc38bdfcc 100644 --- a/internal/services/apimanagement/api_management_api_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_api_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_release.go b/internal/services/apimanagement/api_management_api_release.go index f50072a2cddf..f059c5579b81 100644 --- a/internal/services/apimanagement/api_management_api_release.go +++ b/internal/services/apimanagement/api_management_api_release.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_resource.go b/internal/services/apimanagement/api_management_api_resource.go index 58f423cf0155..8fdda6bfc444 100644 --- a/internal/services/apimanagement/api_management_api_resource.go +++ b/internal/services/apimanagement/api_management_api_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_schema_resource.go b/internal/services/apimanagement/api_management_api_schema_resource.go index 8372360d0e22..9fa825f14282 100644 --- a/internal/services/apimanagement/api_management_api_schema_resource.go +++ b/internal/services/apimanagement/api_management_api_schema_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_schema_resource_test.go b/internal/services/apimanagement/api_management_api_schema_resource_test.go index 7c4722f6c3e0..1476be504d94 100644 --- a/internal/services/apimanagement/api_management_api_schema_resource_test.go +++ b/internal/services/apimanagement/api_management_api_schema_resource_test.go @@ -215,17 +215,3 @@ resource "azurerm_api_management_api_schema" "test" { } `, r.template(data), data.RandomInteger) } -func (r ApiManagementApiSchemaResource) definitionsYaml(data acceptance.TestData) string { - return fmt.Sprintf(` -%s - -resource "azurerm_api_management_api_schema" "test" { - api_name = azurerm_api_management_api.test.name - api_management_name = azurerm_api_management_api.test.api_management_name - resource_group_name = azurerm_api_management_api.test.resource_group_name - schema_id = "acctestSchema%d" - content_type = "application/vnd.ms-azure-apim.swagger.definitions+json" - definitions = file("testdata/api_management_api_swagger_definitions.yaml") -} -`, r.template(data), data.RandomInteger) -} diff --git a/internal/services/apimanagement/api_management_api_tag_description_resource.go b/internal/services/apimanagement/api_management_api_tag_description_resource.go index 2bc6d1072f91..57beffd23e10 100644 --- a/internal/services/apimanagement/api_management_api_tag_description_resource.go +++ b/internal/services/apimanagement/api_management_api_tag_description_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_version_set_resource.go b/internal/services/apimanagement/api_management_api_version_set_resource.go index 04c5ee4ee6da..2fc0bad0dc40 100644 --- a/internal/services/apimanagement/api_management_api_version_set_resource.go +++ b/internal/services/apimanagement/api_management_api_version_set_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_authorization_server_resource.go b/internal/services/apimanagement/api_management_authorization_server_resource.go index 8b6b25beead1..63d5ba52c16a 100644 --- a/internal/services/apimanagement/api_management_authorization_server_resource.go +++ b/internal/services/apimanagement/api_management_authorization_server_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_backend_resource.go b/internal/services/apimanagement/api_management_backend_resource.go index f75aff48b981..1403ab5a18c7 100644 --- a/internal/services/apimanagement/api_management_backend_resource.go +++ b/internal/services/apimanagement/api_management_backend_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_certificate_resource.go b/internal/services/apimanagement/api_management_certificate_resource.go index 5630f72c46ed..4f8b4a14f669 100644 --- a/internal/services/apimanagement/api_management_certificate_resource.go +++ b/internal/services/apimanagement/api_management_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_custom_domain_resource.go b/internal/services/apimanagement/api_management_custom_domain_resource.go index 2e5bbc06794e..a242c8a1842e 100644 --- a/internal/services/apimanagement/api_management_custom_domain_resource.go +++ b/internal/services/apimanagement/api_management_custom_domain_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -194,7 +194,7 @@ func apiManagementCustomDomainRead(d *pluginsdk.ResourceData, meta interface{}) configs := flattenApiManagementHostnameConfiguration(resp.ServiceProperties.HostnameConfigurations, d, *resp.Name, apimHostNameSuffix) for _, config := range configs { for key, v := range config.(map[string]interface{}) { - //lintignore:R001 + // lintignore:R001 if err := d.Set(key, v); err != nil { return fmt.Errorf("setting `hostname_configuration` %q: %+v", key, err) } diff --git a/internal/services/apimanagement/api_management_custom_domain_resource_test.go b/internal/services/apimanagement/api_management_custom_domain_resource_test.go index 29d2d53ef0df..1664db5e06f9 100644 --- a/internal/services/apimanagement/api_management_custom_domain_resource_test.go +++ b/internal/services/apimanagement/api_management_custom_domain_resource_test.go @@ -175,7 +175,6 @@ resource "azurerm_api_management_custom_domain" "import" { } func (ApiManagementCustomDomainResource) template(data acceptance.TestData, systemAssignedIdentity bool) string { - identitySnippet := ` identity { type = "SystemAssigned" diff --git a/internal/services/apimanagement/api_management_data_source.go b/internal/services/apimanagement/api_management_data_source.go index 8b50e029b37c..79acb4a62d06 100644 --- a/internal/services/apimanagement/api_management_data_source.go +++ b/internal/services/apimanagement/api_management_data_source.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" diff --git a/internal/services/apimanagement/api_management_diagnostic_resource.go b/internal/services/apimanagement/api_management_diagnostic_resource.go index 9261769cc7ef..19003e3bcdd2 100644 --- a/internal/services/apimanagement/api_management_diagnostic_resource.go +++ b/internal/services/apimanagement/api_management_diagnostic_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_email_template_resource.go b/internal/services/apimanagement/api_management_email_template_resource.go index f101473480d7..98b61ffbe8df 100644 --- a/internal/services/apimanagement/api_management_email_template_resource.go +++ b/internal/services/apimanagement/api_management_email_template_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_email_template_resource_test.go b/internal/services/apimanagement/api_management_email_template_resource_test.go index 23aa687a369e..00fe56d5fdfd 100644 --- a/internal/services/apimanagement/api_management_email_template_resource_test.go +++ b/internal/services/apimanagement/api_management_email_template_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_gateway_api_resource.go b/internal/services/apimanagement/api_management_gateway_api_resource.go index 7893b3aff627..e0a16e10457a 100644 --- a/internal/services/apimanagement/api_management_gateway_api_resource.go +++ b/internal/services/apimanagement/api_management_gateway_api_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go b/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go index 4fa00c2e78af..e2af027a0c3b 100644 --- a/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go +++ b/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" @@ -86,12 +86,12 @@ func resourceApiManagementGatewayCertificateAuthorityCreateUpdate(d *pluginsdk.R }, } - resp, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, d.Get("gateway_name").(string), d.Get("certificate_name").(string), parameters, "") + _, err = client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, d.Get("gateway_name").(string), d.Get("certificate_name").(string), parameters, "") if err != nil { return fmt.Errorf("creating or updating %s: %+v", id, err) } - d.SetId(*resp.ID) + d.SetId(id.ID()) return resourceApiManagementGatewayCertificateAuthorityRead(d, meta) } diff --git a/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go b/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go index 086dce934e96..ce5da4b34f90 100644 --- a/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go +++ b/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" @@ -120,12 +120,12 @@ func resourceApiManagementGatewayHostNameConfigurationCreateUpdate(d *pluginsdk. }, } - resp, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, d.Get("gateway_name").(string), d.Get("name").(string), parameters, "") + _, err = client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, d.Get("gateway_name").(string), d.Get("name").(string), parameters, "") if err != nil { return fmt.Errorf("creating or updating %s: %+v", id, err) } - d.SetId(*resp.ID) + d.SetId(id.ID()) return resourceApiManagementGatewayHostNameConfigurationRead(d, meta) } diff --git a/internal/services/apimanagement/api_management_gateway_resource.go b/internal/services/apimanagement/api_management_gateway_resource.go index 1b51abd7bffe..9b1d56591adc 100644 --- a/internal/services/apimanagement/api_management_gateway_resource.go +++ b/internal/services/apimanagement/api_management_gateway_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_group_resource.go b/internal/services/apimanagement/api_management_group_resource.go index 8148868bb7c3..738ed8148995 100644 --- a/internal/services/apimanagement/api_management_group_resource.go +++ b/internal/services/apimanagement/api_management_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aad_resource.go b/internal/services/apimanagement/api_management_identity_provider_aad_resource.go index 9c3c74b061b0..61964ef40e7b 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aad_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_aad_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go index 51123509ccbb..e03d01210384 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go index b0e82d8effb5..931ea0f456a5 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go index e7fd877b8826..93e416c926ce 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -81,7 +81,7 @@ func testAccAzureRMApiManagementIdentityProviderAADB2C_getB2CConfig(t *testing.T v := fmt.Sprintf("ARM_TEST_B2C_%s", strings.ToUpper(k)) vars = append(vars, v) } - t.Skip(fmt.Sprintf("Acceptance tests for resource `azurerm_api_management_identity_provider_aadb2c` skipped unless environment variables set: %s", strings.Join(vars, ", "))) + t.Skipf("Acceptance tests for resource `azurerm_api_management_identity_provider_aadb2c` skipped unless environment variables set: %s", strings.Join(vars, ", ")) } return config diff --git a/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go b/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go index 9648c6322eec..4e2ad9a060e1 100644 --- a/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go index 48cae792fbf1..60b976e1d521 100644 --- a/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_google_resource.go b/internal/services/apimanagement/api_management_identity_provider_google_resource.go index fed4df365556..016b91fbdcb8 100644 --- a/internal/services/apimanagement/api_management_identity_provider_google_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_google_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go index 5a89cad327c1..f05ac0c6b6c2 100644 --- a/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go index 078e717c0825..75b4f27e6dba 100644 --- a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go index 01596b5f71be..0ec2b44a9af9 100644 --- a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go b/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go index a72c88114467..7d4e3ac047ec 100644 --- a/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go index 9779a5182139..ff3ad5488f1c 100644 --- a/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_logger_resource.go b/internal/services/apimanagement/api_management_logger_resource.go index b065f2a792b4..55bbbe3dfc71 100644 --- a/internal/services/apimanagement/api_management_logger_resource.go +++ b/internal/services/apimanagement/api_management_logger_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_named_value_resource.go b/internal/services/apimanagement/api_management_named_value_resource.go index 3c53fd1f0271..0a07131dfca0 100644 --- a/internal/services/apimanagement/api_management_named_value_resource.go +++ b/internal/services/apimanagement/api_management_named_value_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_notification_recipient_email.go b/internal/services/apimanagement/api_management_notification_recipient_email.go index 5620e7025a5d..5b701b660bc9 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_email.go +++ b/internal/services/apimanagement/api_management_notification_recipient_email.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_notification_recipient_email_test.go b/internal/services/apimanagement/api_management_notification_recipient_email_test.go index 8d2eb39a5195..02e22bd12979 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_email_test.go +++ b/internal/services/apimanagement/api_management_notification_recipient_email_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_notification_recipient_user.go b/internal/services/apimanagement/api_management_notification_recipient_user.go index f1f5b5225cb5..96fa494fde81 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_user.go +++ b/internal/services/apimanagement/api_management_notification_recipient_user.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_notification_recipient_user_test.go b/internal/services/apimanagement/api_management_notification_recipient_user_test.go index a6b114a896b0..676de534ce22 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_user_test.go +++ b/internal/services/apimanagement/api_management_notification_recipient_user_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_openid_connect_provider_resource.go b/internal/services/apimanagement/api_management_openid_connect_provider_resource.go index fa1801d9a83e..d39ab6ac6fe4 100644 --- a/internal/services/apimanagement/api_management_openid_connect_provider_resource.go +++ b/internal/services/apimanagement/api_management_openid_connect_provider_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_policy_resource.go b/internal/services/apimanagement/api_management_policy_resource.go index dbcafed3ec19..8ea07ed53595 100644 --- a/internal/services/apimanagement/api_management_policy_resource.go +++ b/internal/services/apimanagement/api_management_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/migration" diff --git a/internal/services/apimanagement/api_management_product_data_source.go b/internal/services/apimanagement/api_management_product_data_source.go index c9447bdf2196..31ca0844d20a 100644 --- a/internal/services/apimanagement/api_management_product_data_source.go +++ b/internal/services/apimanagement/api_management_product_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_product_policy_resource.go b/internal/services/apimanagement/api_management_product_policy_resource.go index 4558c52be04a..64ff77e04af0 100644 --- a/internal/services/apimanagement/api_management_product_policy_resource.go +++ b/internal/services/apimanagement/api_management_product_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_product_policy_resource_test.go b/internal/services/apimanagement/api_management_product_policy_resource_test.go index 3a7eea9521b8..30e7d3fad2c2 100644 --- a/internal/services/apimanagement/api_management_product_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_product_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_product_resource.go b/internal/services/apimanagement/api_management_product_resource.go index 8636d2480b59..7135e47cf184 100644 --- a/internal/services/apimanagement/api_management_product_resource.go +++ b/internal/services/apimanagement/api_management_product_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_redis_cache_resource.go b/internal/services/apimanagement/api_management_redis_cache_resource.go index 9bd1a044cc26..c8bbbf5762da 100644 --- a/internal/services/apimanagement/api_management_redis_cache_resource.go +++ b/internal/services/apimanagement/api_management_redis_cache_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_resource.go b/internal/services/apimanagement/api_management_resource.go index d4949f8c0a4f..ab7e6130e726 100644 --- a/internal/services/apimanagement/api_management_resource.go +++ b/internal/services/apimanagement/api_management_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -452,7 +452,7 @@ func resourceApiManagementSchema() map[string]*pluginsdk.Schema { }, }, - //lintignore:XS003 + // lintignore:XS003 "policy": { Type: pluginsdk.TypeList, Optional: true, @@ -882,7 +882,6 @@ func resourceApiManagementServiceCreateUpdate(d *pluginsdk.ResourceData, meta in return fmt.Errorf("deleting %s: %+v", productId, err) } } - } signInSettingsRaw := d.Get("sign_in").([]interface{}) @@ -953,7 +952,6 @@ func resourceApiManagementServiceRead(d *pluginsdk.ResourceData, meta interface{ signInClient := meta.(*clients.Client).ApiManagement.SignInClient signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient tenantAccessClient := meta.(*clients.Client).ApiManagement.TenantAccessClient - environment := meta.(*clients.Client).Account.Environment ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -1026,8 +1024,7 @@ func resourceApiManagementServiceRead(d *pluginsdk.ResourceData, meta interface{ return fmt.Errorf("setting `protocols`: %+v", err) } - apimHostNameSuffix := environment.APIManagementHostNameSuffix - hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d, id.ServiceName, apimHostNameSuffix) + hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d) if err := d.Set("hostname_configuration", hostnameConfigs); err != nil { return fmt.Errorf("setting `hostname_configuration`: %+v", err) } @@ -1052,7 +1049,6 @@ func resourceApiManagementServiceRead(d *pluginsdk.ResourceData, meta interface{ minApiVersion = *props.APIVersionConstraint.MinAPIVersion } d.Set("min_api_version", minApiVersion) - } if err := d.Set("sku_name", flattenApiManagementServiceSkuName(resp.Sku)); err != nil { @@ -1262,7 +1258,7 @@ func expandApiManagementCommonHostnameConfiguration(input map[string]interface{} return output } -func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameConfiguration, d *pluginsdk.ResourceData, name, apimHostNameSuffix string) []interface{} { +func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameConfiguration, d *pluginsdk.ResourceData) []interface{} { results := make([]interface{}, 0) if input == nil { return results @@ -1974,7 +1970,6 @@ func flattenApiManagementTenantAccessSettings(input apimanagement.AccessInformat if input.SecondaryKey != nil { result["secondary_key"] = *input.SecondaryKey - } return []interface{}{result} diff --git a/internal/services/apimanagement/api_management_subscription_resource.go b/internal/services/apimanagement/api_management_subscription_resource.go index 7e112d3b00a7..47d2da8086b2 100644 --- a/internal/services/apimanagement/api_management_subscription_resource.go +++ b/internal/services/apimanagement/api_management_subscription_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/apimanagement/api_management_tag_resource.go b/internal/services/apimanagement/api_management_tag_resource.go index 55365d9113f3..8250a886f153 100644 --- a/internal/services/apimanagement/api_management_tag_resource.go +++ b/internal/services/apimanagement/api_management_tag_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_user_resource.go b/internal/services/apimanagement/api_management_user_resource.go index d2596b13ee32..fe8ad623fd1e 100644 --- a/internal/services/apimanagement/api_management_user_resource.go +++ b/internal/services/apimanagement/api_management_user_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/client/client.go b/internal/services/apimanagement/client/client.go index dc8df51cdbdc..dfa91a58207a 100644 --- a/internal/services/apimanagement/client/client.go +++ b/internal/services/apimanagement/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck pandoraAPIMGlobalSchema "github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2021-08-01/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/apimanagement/identity_provider_import.go b/internal/services/apimanagement/identity_provider_import.go index 2d19f3ac713c..b7b4915331f2 100644 --- a/internal/services/apimanagement/identity_provider_import.go +++ b/internal/services/apimanagement/identity_provider_import.go @@ -3,7 +3,7 @@ package apimanagement import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/apimanagement/migration/policy.go b/internal/services/apimanagement/migration/policy.go index c52c6e5e4898..a9190dfb0dec 100644 --- a/internal/services/apimanagement/migration/policy.go +++ b/internal/services/apimanagement/migration/policy.go @@ -5,7 +5,7 @@ import ( "fmt" "html" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/apimanagement/schemaz/api_management.go b/internal/services/apimanagement/schemaz/api_management.go index 710a43cb1b42..2b682ff791bf 100644 --- a/internal/services/apimanagement/schemaz/api_management.go +++ b/internal/services/apimanagement/schemaz/api_management.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/appconfiguration/app_configuration_keys_data_source_test.go b/internal/services/appconfiguration/app_configuration_keys_data_source_test.go index eab859e81be5..54bb40e3b3eb 100644 --- a/internal/services/appconfiguration/app_configuration_keys_data_source_test.go +++ b/internal/services/appconfiguration/app_configuration_keys_data_source_test.go @@ -53,7 +53,7 @@ func TestAccAppConfigurationKeysDataSource_label(t *testing.T) { } func (t AppConfigurationKeysDataSource) keys() string { - return fmt.Sprintf(` + return ` resource "azurerm_app_configuration_key" "test" { configuration_store_id = azurerm_app_configuration.test.id key = "key1" @@ -92,7 +92,7 @@ resource "azurerm_app_configuration_key" "test5" { content_type = "test" value = "a test" } -`) +` } func (t AppConfigurationKeysDataSource) allKeys(data acceptance.TestData) string { diff --git a/internal/services/appconfiguration/app_configuration_resource.go b/internal/services/appconfiguration/app_configuration_resource.go index 7277f3ebebc3..485cb02fe4dd 100644 --- a/internal/services/appconfiguration/app_configuration_resource.go +++ b/internal/services/appconfiguration/app_configuration_resource.go @@ -287,11 +287,7 @@ func resourceAppConfigurationCreate(d *pluginsdk.ResourceData, meta interface{}) publicNetworkAccessValue, publicNetworkAccessNotEmpty := d.GetOk("public_network_access") if publicNetworkAccessNotEmpty { - publicNetworkAccess, err := parsePublicNetworkAccess(publicNetworkAccessValue.(string)) - if err != nil { - return fmt.Errorf("unable to parse public_network_access: %+v", err) - } - parameters.Properties.PublicNetworkAccess = publicNetworkAccess + parameters.Properties.PublicNetworkAccess = parsePublicNetworkAccess(publicNetworkAccessValue.(string)) } identity, err := identity.ExpandSystemAndUserAssignedMap(d.Get("identity").([]interface{})) @@ -372,11 +368,7 @@ func resourceAppConfigurationUpdate(d *pluginsdk.ResourceData, meta interface{}) publicNetworkAccessValue, publicNetworkAccessNotEmpty := d.GetOk("public_network_access") if publicNetworkAccessNotEmpty { - publicNetworkAccess, err := parsePublicNetworkAccess(publicNetworkAccessValue.(string)) - if err != nil { - return fmt.Errorf("unable to parse public_network_access: %+v", err) - } - update.Properties.PublicNetworkAccess = publicNetworkAccess + update.Properties.PublicNetworkAccess = parsePublicNetworkAccess(publicNetworkAccessValue.(string)) } } @@ -674,16 +666,16 @@ this into Terraform via "terraform import", or pick a different name/location. `, name, location) } -func parsePublicNetworkAccess(input string) (*configurationstores.PublicNetworkAccess, error) { +func parsePublicNetworkAccess(input string) *configurationstores.PublicNetworkAccess { vals := map[string]configurationstores.PublicNetworkAccess{ "disabled": configurationstores.PublicNetworkAccessDisabled, "enabled": configurationstores.PublicNetworkAccessEnabled, } if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil + return &v } // otherwise presume it's an undefined value and best-effort it out := configurationstores.PublicNetworkAccess(input) - return &out, nil + return &out } diff --git a/internal/services/applicationinsights/application_insights_analytics_item_resource.go b/internal/services/applicationinsights/application_insights_analytics_item_resource.go index 1146d93a9885..b2a91443304b 100644 --- a/internal/services/applicationinsights/application_insights_analytics_item_resource.go +++ b/internal/services/applicationinsights/application_insights_analytics_item_resource.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/applicationinsights/application_insights_api_key_resource.go b/internal/services/applicationinsights/application_insights_api_key_resource.go index e4411b8dbd49..dc406e111fb2 100644 --- a/internal/services/applicationinsights/application_insights_api_key_resource.go +++ b/internal/services/applicationinsights/application_insights_api_key_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/applicationinsights/application_insights_resource.go b/internal/services/applicationinsights/application_insights_resource.go index 63debf756cac..4737e759f754 100644 --- a/internal/services/applicationinsights/application_insights_resource.go +++ b/internal/services/applicationinsights/application_insights_resource.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go b/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go index cb3a5a70e6e3..a32773f2b2e3 100644 --- a/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go +++ b/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/migration" diff --git a/internal/services/applicationinsights/application_insights_webtests_resource.go b/internal/services/applicationinsights/application_insights_webtests_resource.go index ac5b38e8af62..98f9ab15926b 100644 --- a/internal/services/applicationinsights/application_insights_webtests_resource.go +++ b/internal/services/applicationinsights/application_insights_webtests_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/applicationinsights/application_insights_workbook_resource.go b/internal/services/applicationinsights/application_insights_workbook_resource.go index 51fbb666fc4b..bcea33fdfe48 100644 --- a/internal/services/applicationinsights/application_insights_workbook_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_resource.go @@ -298,10 +298,7 @@ func (r ApplicationInsightsWorkbookResource) Read() sdk.ResourceFunc { if model.Tags != nil { // The backend returns a tags with key `hidden-title` by default. Since it has the same value with `display_name` and will cause inconsistency with user's configuration, remove it as a workaround. - if _, ok := (*model.Tags)["hidden-title"]; ok { - delete(*model.Tags, "hidden-title") - } - + delete(*model.Tags, "hidden-title") state.Tags = *model.Tags } diff --git a/internal/services/applicationinsights/application_insights_workbook_template_resource.go b/internal/services/applicationinsights/application_insights_workbook_template_resource.go index 881d0254e2cb..520f4b8482fb 100644 --- a/internal/services/applicationinsights/application_insights_workbook_template_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_template_resource.go @@ -189,11 +189,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Create() sdk.ResourceFunc { properties.Properties.Localized = &localizedValue } - galleriesValue, err := expandWorkbookTemplateGalleryModel(model.Galleries) - if err != nil { - return err - } - + galleriesValue := expandWorkbookTemplateGalleryModel(model.Galleries) if galleriesValue != nil { properties.Properties.Galleries = *galleriesValue } @@ -239,11 +235,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("galleries") { - galleriesValue, err := expandWorkbookTemplateGalleryModel(model.Galleries) - if err != nil { - return err - } - + galleriesValue := expandWorkbookTemplateGalleryModel(model.Galleries) if galleriesValue != nil { properties.Properties.Galleries = *galleriesValue } @@ -321,12 +313,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Read() sdk.ResourceFunc { state.Author = *properties.Author } - galleriesValue, err := flattenWorkbookTemplateGalleryModel(&properties.Galleries) - if err != nil { - return err - } - - state.Galleries = galleriesValue + state.Galleries = flattenWorkbookTemplateGalleryModel(&properties.Galleries) if properties.Priority != nil { state.Priority = *properties.Priority @@ -380,7 +367,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Delete() sdk.ResourceFunc { } } -func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) (*[]workbooktemplates.WorkbookTemplateGallery, error) { +func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) *[]workbooktemplates.WorkbookTemplateGallery { var outputList []workbooktemplates.WorkbookTemplateGallery for _, input := range inputList { output := workbooktemplates.WorkbookTemplateGallery{ @@ -394,13 +381,13 @@ func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.WorkbookTemplateGallery) ([]WorkbookTemplateGalleryModel, error) { +func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.WorkbookTemplateGallery) []WorkbookTemplateGalleryModel { var outputList []WorkbookTemplateGalleryModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -429,5 +416,5 @@ func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.Workbook outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/applicationinsights/azuresdkhacks/webtests.go b/internal/services/applicationinsights/azuresdkhacks/webtests.go index 76ae70e05907..dd5310afd358 100644 --- a/internal/services/applicationinsights/azuresdkhacks/webtests.go +++ b/internal/services/applicationinsights/azuresdkhacks/webtests.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/parse" diff --git a/internal/services/applicationinsights/client/client.go b/internal/services/applicationinsights/client/client.go index 0746f0d7e629..f9affc88fd0e 100644 --- a/internal/services/applicationinsights/client/client.go +++ b/internal/services/applicationinsights/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck workbooktemplates "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" workbooks "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" "github.com/hashicorp/terraform-provider-azurerm/internal/common" diff --git a/internal/services/appservice/client/client.go b/internal/services/appservice/client/client.go index a71a21626678..042cae861682 100644 --- a/internal/services/appservice/client/client.go +++ b/internal/services/appservice/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/appservice/function_app_active_slot_resource.go b/internal/services/appservice/function_app_active_slot_resource.go index d2a5254b28cb..5fb41759689c 100644 --- a/internal/services/appservice/function_app_active_slot_resource.go +++ b/internal/services/appservice/function_app_active_slot_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/function_app_function_resource.go b/internal/services/appservice/function_app_function_resource.go index 8aeec1c4fca5..448912d93d77 100644 --- a/internal/services/appservice/function_app_function_resource.go +++ b/internal/services/appservice/function_app_function_resource.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/function_app_hybrid_connection_resource.go b/internal/services/appservice/function_app_hybrid_connection_resource.go index 356456b9fd74..e7b4c957e830 100644 --- a/internal/services/appservice/function_app_hybrid_connection_resource.go +++ b/internal/services/appservice/function_app_hybrid_connection_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/hybridconnections" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/namespaces" diff --git a/internal/services/appservice/helpers/function_app_schema.go b/internal/services/appservice/helpers/function_app_schema.go index d4755fbb9e3d..072278a04611 100644 --- a/internal/services/appservice/helpers/function_app_schema.go +++ b/internal/services/appservice/helpers/function_app_schema.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" diff --git a/internal/services/appservice/helpers/function_app_schema_test.go b/internal/services/appservice/helpers/function_app_schema_test.go index 74650baaf155..bfdbd8e3b4cb 100644 --- a/internal/services/appservice/helpers/function_app_schema_test.go +++ b/internal/services/appservice/helpers/function_app_schema_test.go @@ -5,7 +5,7 @@ import ( "sort" "testing" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/appservice/helpers/function_app_slot_schema.go b/internal/services/appservice/helpers/function_app_slot_schema.go index 6a429acfc962..2439c8ca7f0b 100644 --- a/internal/services/appservice/helpers/function_app_slot_schema.go +++ b/internal/services/appservice/helpers/function_app_slot_schema.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -725,7 +725,6 @@ func ExpandSiteConfigWindowsFunctionAppSlot(siteConfig []SiteConfigWindowsFuncti Value: utils.String("dotnet-isolated"), }) expanded.WindowsFxVersion = utils.String(fmt.Sprintf("DOTNET-ISOLATED|%s", windowsAppStack.DotNetVersion)) - } else { appSettings = append(appSettings, web.NameValuePair{ Name: utils.String("FUNCTIONS_WORKER_RUNTIME"), @@ -1102,7 +1101,6 @@ func ExpandSiteConfigLinuxFunctionAppSlot(siteConfig []SiteConfigLinuxFunctionAp }) expanded.LinuxFxVersion = utils.String(fmt.Sprintf("DOCKER|%s/%s:%s", dockerConfig.RegistryURL, dockerConfig.ImageName, dockerConfig.ImageTag)) } - } else { appSettings = append(appSettings, web.NameValuePair{ Name: utils.String("FUNCTIONS_WORKER_RUNTIME"), diff --git a/internal/services/appservice/helpers/publish_app.go b/internal/services/appservice/helpers/publish_app.go index 6c8777b5831b..9f2e4ecd7e72 100644 --- a/internal/services/appservice/helpers/publish_app.go +++ b/internal/services/appservice/helpers/publish_app.go @@ -9,7 +9,7 @@ import ( "os" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) diff --git a/internal/services/appservice/helpers/shared_schema.go b/internal/services/appservice/helpers/shared_schema.go index d37d655d3473..9aeda6a69c89 100644 --- a/internal/services/appservice/helpers/shared_schema.go +++ b/internal/services/appservice/helpers/shared_schema.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/appservice/helpers/web_app_schema.go b/internal/services/appservice/helpers/web_app_schema.go index 3f068e8cdab1..35be8676b97c 100644 --- a/internal/services/appservice/helpers/web_app_schema.go +++ b/internal/services/appservice/helpers/web_app_schema.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -2896,10 +2896,10 @@ func ExpandSiteConfigWindows(siteConfig []SiteConfigWindows, existing *web.SiteC if servicePlan.Sku != nil && servicePlan.Sku.Name != nil { if isFreeOrSharedServicePlan(*servicePlan.Sku.Name) { - if winSiteConfig.AlwaysOn == true { + if winSiteConfig.AlwaysOn { return nil, nil, fmt.Errorf("always_on cannot be set to true when using Free, F1, D1 Sku") } - if expanded.AlwaysOn != nil && *expanded.AlwaysOn == true { + if expanded.AlwaysOn != nil && *expanded.AlwaysOn { return nil, nil, fmt.Errorf("always_on feature has to be turned off before switching to a free/shared Sku") } } @@ -3062,10 +3062,10 @@ func ExpandSiteConfigLinux(siteConfig []SiteConfigLinux, existing *web.SiteConfi if servicePlan.Sku != nil && servicePlan.Sku.Name != nil { if isFreeOrSharedServicePlan(*servicePlan.Sku.Name) { - if linuxSiteConfig.AlwaysOn == true { + if linuxSiteConfig.AlwaysOn { return nil, fmt.Errorf("always_on cannot be set to true when using Free, F1, D1 Sku") } - if expanded.AlwaysOn != nil && *expanded.AlwaysOn == true { + if expanded.AlwaysOn != nil && *expanded.AlwaysOn { return nil, fmt.Errorf("always_on feature has to be turned off before switching to a free/shared Sku") } } diff --git a/internal/services/appservice/helpers/web_app_slot_schema.go b/internal/services/appservice/helpers/web_app_slot_schema.go index b6e25a1b623e..10ef51144ff6 100644 --- a/internal/services/appservice/helpers/web_app_slot_schema.go +++ b/internal/services/appservice/helpers/web_app_slot_schema.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -831,7 +831,6 @@ func ExpandSiteConfigWindowsWebAppSlot(siteConfig []SiteConfigWindowsWebAppSlot, if metadata.ResourceData.HasChange("site_config.0.application_stack") { if len(winSlotSiteConfig.ApplicationStack) == 1 { - winAppStack := winSlotSiteConfig.ApplicationStack[0] expanded.NetFrameworkVersion = utils.String(winAppStack.NetFrameworkVersion) expanded.PhpVersion = utils.String(winAppStack.PhpVersion) diff --git a/internal/services/appservice/identity.go b/internal/services/appservice/identity.go index fd2e434e853b..f1bbadb8ca11 100644 --- a/internal/services/appservice/identity.go +++ b/internal/services/appservice/identity.go @@ -1,7 +1,7 @@ package appservice import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" ) diff --git a/internal/services/appservice/linux_function_app_data_source.go b/internal/services/appservice/linux_function_app_data_source.go index 4faa0e0ec231..f05502152a45 100644 --- a/internal/services/appservice/linux_function_app_data_source.go +++ b/internal/services/appservice/linux_function_app_data_source.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/linux_function_app_resource.go b/internal/services/appservice/linux_function_app_resource.go index 04df7b27ad42..39ac6c7dbc82 100644 --- a/internal/services/appservice/linux_function_app_resource.go +++ b/internal/services/appservice/linux_function_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index e507aebd8e84..1cb16be07172 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -794,7 +794,6 @@ func (r LinuxFunctionAppSlotResource) Update() sdk.ResourceFunc { } else { state.AppSettings["AzureWebJobsDashboard__accountName"] = state.StorageAccountName } - } if metadata.ResourceData.HasChange("site_config") { diff --git a/internal/services/appservice/linux_function_app_slot_resource_test.go b/internal/services/appservice/linux_function_app_slot_resource_test.go index 3ac67786e851..df7329ef8893 100644 --- a/internal/services/appservice/linux_function_app_slot_resource_test.go +++ b/internal/services/appservice/linux_function_app_slot_resource_test.go @@ -1621,6 +1621,7 @@ resource "azurerm_linux_function_app_slot" "test" { `, r.template(data, planSku), data.RandomInteger, javaVersion) } +// nolint: unparam func (r LinuxFunctionAppSlotResource) appStackNode(data acceptance.TestData, planSku string, nodeVersion string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/appservice/linux_web_app_resource.go b/internal/services/appservice/linux_web_app_resource.go index 74a4a762bd52..04c1c653a9e8 100644 --- a/internal/services/appservice/linux_web_app_resource.go +++ b/internal/services/appservice/linux_web_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -787,7 +787,7 @@ func (r LinuxWebAppResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublish(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile); err != nil { return err } diff --git a/internal/services/appservice/linux_web_app_slot_resource.go b/internal/services/appservice/linux_web_app_slot_resource.go index c06a7d4351e2..897fb30613a1 100644 --- a/internal/services/appservice/linux_web_app_slot_resource.go +++ b/internal/services/appservice/linux_web_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -687,7 +687,7 @@ func (r LinuxWebAppSlotResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublishSlot(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile, id.SlotName); err != nil { return err } diff --git a/internal/services/appservice/service_plan_resource.go b/internal/services/appservice/service_plan_resource.go index 44db8a01adbe..d2a722f837d0 100644 --- a/internal/services/appservice/service_plan_resource.go +++ b/internal/services/appservice/service_plan_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/source_control_resource.go b/internal/services/appservice/source_control_resource.go index 20c2b58d9241..ab8b2bc00b47 100644 --- a/internal/services/appservice/source_control_resource.go +++ b/internal/services/appservice/source_control_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" diff --git a/internal/services/appservice/source_control_schema.go b/internal/services/appservice/source_control_schema.go index 3e739ce2fe25..20c5c9649943 100644 --- a/internal/services/appservice/source_control_schema.go +++ b/internal/services/appservice/source_control_schema.go @@ -1,7 +1,7 @@ package appservice import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/appservice/source_control_slot_resource.go b/internal/services/appservice/source_control_slot_resource.go index f2eecc4bc638..d4dc84e0248e 100644 --- a/internal/services/appservice/source_control_slot_resource.go +++ b/internal/services/appservice/source_control_slot_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/source_control_token_resource.go b/internal/services/appservice/source_control_token_resource.go index 33479521167c..b74ddd96d98b 100644 --- a/internal/services/appservice/source_control_token_resource.go +++ b/internal/services/appservice/source_control_token_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" diff --git a/internal/services/appservice/web_app_active_slot_resource.go b/internal/services/appservice/web_app_active_slot_resource.go index 7cd5e09f269f..65a6d4a29f88 100644 --- a/internal/services/appservice/web_app_active_slot_resource.go +++ b/internal/services/appservice/web_app_active_slot_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/web_app_hybrid_connection_resource.go b/internal/services/appservice/web_app_hybrid_connection_resource.go index b3800e2a0b06..f01b63fdea29 100644 --- a/internal/services/appservice/web_app_hybrid_connection_resource.go +++ b/internal/services/appservice/web_app_hybrid_connection_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/hybridconnections" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/namespaces" diff --git a/internal/services/appservice/windows_function_app_data_source.go b/internal/services/appservice/windows_function_app_data_source.go index 1f3e5e971d2d..5cf2e0c42cac 100644 --- a/internal/services/appservice/windows_function_app_data_source.go +++ b/internal/services/appservice/windows_function_app_data_source.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/windows_function_app_resource.go b/internal/services/appservice/windows_function_app_resource.go index 7a15f2c3f5b1..780b39400977 100644 --- a/internal/services/appservice/windows_function_app_resource.go +++ b/internal/services/appservice/windows_function_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index ebac9b56bd4d..1da0dc327001 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/windows_web_app_resource.go b/internal/services/appservice/windows_web_app_resource.go index d8f397f9f1cf..c128e3e5e50e 100644 --- a/internal/services/appservice/windows_web_app_resource.go +++ b/internal/services/appservice/windows_web_app_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -807,7 +807,7 @@ func (r WindowsWebAppResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublish(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile); err != nil { return err } diff --git a/internal/services/appservice/windows_web_app_resource_test.go b/internal/services/appservice/windows_web_app_resource_test.go index a8bf84565418..ef8f17d8e75d 100644 --- a/internal/services/appservice/windows_web_app_resource_test.go +++ b/internal/services/appservice/windows_web_app_resource_test.go @@ -519,7 +519,6 @@ func TestAccWindowsWebApp_identityKeyVault(t *testing.T) { }, data.ImportStep(), }) - } // Windows Specific @@ -2246,6 +2245,7 @@ resource "azurerm_windows_web_app" "test" { `, r.baseTemplate(data), data.RandomInteger, pythonVersion) } +//nolint:unparam func (r WindowsWebAppResource) java(data acceptance.TestData, javaVersion string, javaContainer string, javaContainerVersion string) string { javaContainerStr := "" if javaContainer != "" { diff --git a/internal/services/appservice/windows_web_app_slot_resource.go b/internal/services/appservice/windows_web_app_slot_resource.go index 787955b29300..7312edef7ab4 100644 --- a/internal/services/appservice/windows_web_app_slot_resource.go +++ b/internal/services/appservice/windows_web_app_slot_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -696,7 +696,7 @@ func (r WindowsWebAppSlotResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublishSlot(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile, id.SlotName); err != nil { return err } diff --git a/internal/services/appservice/windows_web_app_slot_resource_test.go b/internal/services/appservice/windows_web_app_slot_resource_test.go index 81fe260f4453..138cf453f82d 100644 --- a/internal/services/appservice/windows_web_app_slot_resource_test.go +++ b/internal/services/appservice/windows_web_app_slot_resource_test.go @@ -428,7 +428,6 @@ func TestAccWindowsWebAppSlot_identityKeyVault(t *testing.T) { }, data.ImportStep(), }) - } // Attributes diff --git a/internal/services/authorization/azuresdkhacks/definitions.go b/internal/services/authorization/azuresdkhacks/definitions.go index 1f9a60526a50..93fa65c4dc28 100644 --- a/internal/services/authorization/azuresdkhacks/definitions.go +++ b/internal/services/authorization/azuresdkhacks/definitions.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" ) diff --git a/internal/services/authorization/client/client.go b/internal/services/authorization/client/client.go index d79a77bf94a4..2da83c9530f7 100644 --- a/internal/services/authorization/client/client.go +++ b/internal/services/authorization/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/authorization/role_assignment_resource.go b/internal/services/authorization/role_assignment_resource.go index 6817baf928c2..8a8bd491112d 100644 --- a/internal/services/authorization/role_assignment_resource.go +++ b/internal/services/authorization/role_assignment_resource.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-01-01/subscriptions" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-01-01/subscriptions" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/authorization/role_assignment_resource_test.go b/internal/services/authorization/role_assignment_resource_test.go index d17cfabaf06d..6ab149a33ca1 100644 --- a/internal/services/authorization/role_assignment_resource_test.go +++ b/internal/services/authorization/role_assignment_resource_test.go @@ -565,6 +565,7 @@ resource "azurerm_role_assignment" "test" { `, groupId) } +// nolint: unused func (RoleAssignmentResource) subscriptionScoped(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/authorization/role_definition_data_source.go b/internal/services/authorization/role_definition_data_source.go index 82928ac0a5be..d8c82f41f050 100644 --- a/internal/services/authorization/role_definition_data_source.go +++ b/internal/services/authorization/role_definition_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -123,7 +123,6 @@ func dataSourceArmRoleDefinitionRead(d *pluginsdk.ResourceData, meta interface{} if name != "" { // Accounting for eventual consistency err := pluginsdk.Retry(d.Timeout(pluginsdk.TimeoutRead), func() *pluginsdk.RetryError { - roleDefinitions, err := client.List(ctx, scope, fmt.Sprintf("roleName eq '%s'", name)) if err != nil { return pluginsdk.NonRetryableError(fmt.Errorf("loading Role Definition List: %+v", err)) diff --git a/internal/services/authorization/role_definition_resource.go b/internal/services/authorization/role_definition_resource.go index e832bbca6b8b..07a5b6b4c2f9 100644 --- a/internal/services/authorization/role_definition_resource.go +++ b/internal/services/authorization/role_definition_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -66,7 +66,7 @@ func resourceArmRoleDefinition() *pluginsdk.Resource { Optional: true, }, - //lintignore:XS003 + // lintignore:XS003 "permissions": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/automation/automation_account_resource.go b/internal/services/automation/automation_account_resource.go index ee764dfc0fba..701899ec6ca2 100644 --- a/internal/services/automation/automation_account_resource.go +++ b/internal/services/automation/automation_account_resource.go @@ -182,7 +182,7 @@ func resourceAutomationAccountCreate(d *pluginsdk.ResourceData, meta interface{} Location: utils.String(location.Normalize(d.Get("location").(string))), } - if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + if localAuth := d.Get("local_authentication_enabled").(bool); !localAuth { parameters.Properties.DisableLocalAuth = utils.Bool(true) } if encryption := d.Get("encryption").([]interface{}); len(encryption) > 0 { @@ -232,7 +232,7 @@ func resourceAutomationAccountUpdate(d *pluginsdk.ResourceData, meta interface{} Identity: identity, } - if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + if localAuth := d.Get("local_authentication_enabled").(bool); !localAuth { parameters.Properties.DisableLocalAuth = utils.Bool(true) } @@ -308,7 +308,7 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("sku_name", skuName) localAuthEnabled := true - if val := prop.DisableLocalAuth; val != nil && *val == true { + if val := prop.DisableLocalAuth; val != nil && *val { localAuthEnabled = false } d.Set("local_authentication_enabled", localAuthEnabled) diff --git a/internal/services/automation/automation_certificate_resource.go b/internal/services/automation/automation_certificate_resource.go index 1914c7e1f3c5..64d6a7db72d2 100644 --- a/internal/services/automation/automation_certificate_resource.go +++ b/internal/services/automation/automation_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_certificate_resource.go b/internal/services/automation/automation_connection_certificate_resource.go index 5ace12d25f09..30dcef8132fb 100644 --- a/internal/services/automation/automation_connection_certificate_resource.go +++ b/internal/services/automation/automation_connection_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_classic_certificate_resource.go b/internal/services/automation/automation_connection_classic_certificate_resource.go index b5cb0b7aedb3..598e49e64956 100644 --- a/internal/services/automation/automation_connection_classic_certificate_resource.go +++ b/internal/services/automation/automation_connection_classic_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_resource.go b/internal/services/automation/automation_connection_resource.go index 7c954a2c7755..573448ca28cd 100644 --- a/internal/services/automation/automation_connection_resource.go +++ b/internal/services/automation/automation_connection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_service_principal_resource.go b/internal/services/automation/automation_connection_service_principal_resource.go index e81e71c0b19c..3eb9c186db15 100644 --- a/internal/services/automation/automation_connection_service_principal_resource.go +++ b/internal/services/automation/automation_connection_service_principal_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_type_resource.go b/internal/services/automation/automation_connection_type_resource.go index 5db52899c5a7..8bf1b390f014 100644 --- a/internal/services/automation/automation_connection_type_resource.go +++ b/internal/services/automation/automation_connection_type_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount" diff --git a/internal/services/automation/automation_credential_resource.go b/internal/services/automation/automation_credential_resource.go index 9fdc0272d313..481d8c08c825 100644 --- a/internal/services/automation/automation_credential_resource.go +++ b/internal/services/automation/automation_credential_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_dsc_configuration_resource.go b/internal/services/automation/automation_dsc_configuration_resource.go index b10250cf6cfb..4f767fb07554 100644 --- a/internal/services/automation/automation_dsc_configuration_resource.go +++ b/internal/services/automation/automation_dsc_configuration_resource.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go index 1235a5d67ad8..17efbef1f21a 100644 --- a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go +++ b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_job_schedule_resource.go b/internal/services/automation/automation_job_schedule_resource.go index 74e0053e3be2..3b9dd6979750 100644 --- a/internal/services/automation/automation_job_schedule_resource.go +++ b/internal/services/automation/automation_job_schedule_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_module_resource.go b/internal/services/automation/automation_module_resource.go index 8a5ff97a95af..6d5eeb1b5c5e 100644 --- a/internal/services/automation/automation_module_resource.go +++ b/internal/services/automation/automation_module_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -106,9 +106,7 @@ func resourceAutomationModuleCreateUpdate(d *pluginsdk.ResourceData, meta interf } // for existing global module do update instead of raising ImportAsExistsError - isGlobal := existing.ModuleProperties != nil && - existing.ModuleProperties.IsGlobal != nil && - *existing.ModuleProperties.IsGlobal == true + isGlobal := existing.ModuleProperties != nil && existing.ModuleProperties.IsGlobal != nil && *existing.ModuleProperties.IsGlobal if !utils.ResponseWasNotFound(existing.Response) && !isGlobal { return tf.ImportAsExistsError("azurerm_automation_module", id.ID()) } diff --git a/internal/services/automation/automation_runbook_resource.go b/internal/services/automation/automation_runbook_resource.go index 2ed0c15fe5da..8378d2999c51 100644 --- a/internal/services/automation/automation_runbook_resource.go +++ b/internal/services/automation/automation_runbook_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/automation/automation_schedule_resource.go b/internal/services/automation/automation_schedule_resource.go index 058fc969b042..c515a464a3fd 100644 --- a/internal/services/automation/automation_schedule_resource.go +++ b/internal/services/automation/automation_schedule_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_software_update_configuration.go b/internal/services/automation/automation_software_update_configuration.go index 5d02bf47336e..3e7fd6ef890e 100644 --- a/internal/services/automation/automation_software_update_configuration.go +++ b/internal/services/automation/automation_software_update_configuration.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" @@ -42,9 +42,7 @@ func (a *AzureQuery) LoadSDKTags(tags map[string][]string) { for k, vs := range tags { t := Tag{} t.Tag = k - for _, v := range vs { - t.Values = append(t.Values, v) - } + t.Values = append(t.Values, vs...) a.Tags = append(a.Tags, t) } } diff --git a/internal/services/automation/automation_source_control.go b/internal/services/automation/automation_source_control.go index b8bf3c16528a..6119decc785c 100644 --- a/internal/services/automation/automation_source_control.go +++ b/internal/services/automation/automation_source_control.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/parse" diff --git a/internal/services/automation/automation_variable.go b/internal/services/automation/automation_variable.go index 9be981ea8cd2..de1353123524 100644 --- a/internal/services/automation/automation_variable.go +++ b/internal/services/automation/automation_variable.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_variable_test.go b/internal/services/automation/automation_variable_test.go index f88b3cec9762..5caee2d537af 100644 --- a/internal/services/automation/automation_variable_test.go +++ b/internal/services/automation/automation_variable_test.go @@ -70,7 +70,7 @@ func TestParseAzureRmAutomationVariableValue(t *testing.T) { Value: "true", HasError: false, ExpectValue: true, - Expect: func(v interface{}) bool { return v.(bool) == true }, + Expect: func(v interface{}) bool { return v.(bool) }, }, { Name: "boolean variable false", @@ -78,7 +78,7 @@ func TestParseAzureRmAutomationVariableValue(t *testing.T) { Value: "false", HasError: false, ExpectValue: false, - Expect: func(v interface{}) bool { return v.(bool) == false }, + Expect: func(v interface{}) bool { return !v.(bool) }, }, { Name: "datetime variable", diff --git a/internal/services/automation/automation_watcher.go b/internal/services/automation/automation_watcher.go index cd9191e6aa95..49d41bc84791 100644 --- a/internal/services/automation/automation_watcher.go +++ b/internal/services/automation/automation_watcher.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/parse" diff --git a/internal/services/automation/automation_webhook.go b/internal/services/automation/automation_webhook.go index 776eefab7937..fd61166e9cbd 100644 --- a/internal/services/automation/automation_webhook.go +++ b/internal/services/automation/automation_webhook.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/automation/client/client.go b/internal/services/automation/client/client.go index f6c68ab66f60..9389c752f12d 100644 --- a/internal/services/automation/client/client.go +++ b/internal/services/automation/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworker" diff --git a/internal/services/automation/helper/automation_job_schedule.go b/internal/services/automation/helper/automation_job_schedule.go index 63a275ea0917..fea58c8d096c 100644 --- a/internal/services/automation/helper/automation_job_schedule.go +++ b/internal/services/automation/helper/automation_job_schedule.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/batch/batch_account.go b/internal/services/batch/batch_account.go index fa2c4bf438c3..9d0e9ec394c9 100644 --- a/internal/services/batch/batch_account.go +++ b/internal/services/batch/batch_account.go @@ -3,12 +3,12 @@ package batch import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck ) // expandBatchAccountKeyVaultReference expands Batch account KeyVault reference func expandBatchAccountKeyVaultReference(list []interface{}) (*batch.KeyVaultReference, error) { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("Error: key vault reference should be defined") } diff --git a/internal/services/batch/batch_account_data_source.go b/internal/services/batch/batch_account_data_source.go index 825c26057bb5..aa1a7e8da469 100644 --- a/internal/services/batch/batch_account_data_source.go +++ b/internal/services/batch/batch_account_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_account_resource.go b/internal/services/batch/batch_account_resource.go index 1475a36a30f0..4a034f7010ca 100644 --- a/internal/services/batch/batch_account_resource.go +++ b/internal/services/batch/batch_account_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -397,7 +397,6 @@ func resourceBatchAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) err } else { parameters.AllowedAuthenticationModes = expandAllowedAuthenticationModes(d.Get("allowed_authentication_modes").(*pluginsdk.Set).List()) } - } if d.HasChange("storage_account_id") { diff --git a/internal/services/batch/batch_application_resource.go b/internal/services/batch/batch_application_resource.go index 9741a8f2c81a..20d67d7a446d 100644 --- a/internal/services/batch/batch_application_resource.go +++ b/internal/services/batch/batch_application_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_certificate_resource.go b/internal/services/batch/batch_certificate_resource.go index 8bacd6f201e4..6fe8fb35f495 100644 --- a/internal/services/batch/batch_certificate_resource.go +++ b/internal/services/batch/batch_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/batch/batch_pool.go b/internal/services/batch/batch_pool.go index 96b16e1e8623..7eb2a6874970 100644 --- a/internal/services/batch/batch_pool.go +++ b/internal/services/batch/batch_pool.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -453,7 +453,7 @@ func flattenBatchPoolUserAccount(d *pluginsdk.ResourceData, account *batch.UserA // ExpandBatchPoolImageReference expands Batch pool image reference func ExpandBatchPoolImageReference(list []interface{}) (*batch.ImageReference, error) { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("Error: storage image reference should be defined") } @@ -591,7 +591,7 @@ func expandBatchPoolCertificateReference(ref map[string]interface{}) (*batch.Cer // ExpandBatchPoolStartTask expands Batch pool start task func ExpandBatchPoolStartTask(list []interface{}) (*batch.StartTask, error) { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("batch pool start task should be defined") } @@ -796,7 +796,7 @@ func expandBatchPoolOSDisk(ref interface{}) (*batch.OSDisk, error) { } func expandBatchPoolNodeReplacementConfig(list []interface{}) (*batch.NodePlacementConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("node_placement is empty") } item := list[0].(map[string]interface{})["policy"].(string) @@ -806,7 +806,7 @@ func expandBatchPoolNodeReplacementConfig(list []interface{}) (*batch.NodePlacem } func expandBatchPoolWindowsConfiguration(list []interface{}) (*batch.WindowsConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("windows is empty") } @@ -817,7 +817,7 @@ func expandBatchPoolWindowsConfiguration(list []interface{}) (*batch.WindowsConf } func expandBatchPoolExtensions(list []interface{}) (*[]batch.VMExtension, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("extensions is empty") } @@ -836,7 +836,7 @@ func expandBatchPoolExtensions(list []interface{}) (*[]batch.VMExtension, error) } func expandBatchPoolExtension(ref map[string]interface{}) (*batch.VMExtension, error) { - if ref == nil || len(ref) == 0 { + if len(ref) == 0 { return nil, fmt.Errorf("extension is empty") } @@ -870,7 +870,7 @@ func expandBatchPoolExtension(ref map[string]interface{}) (*batch.VMExtension, e } func expandBatchPoolDiskEncryptionConfiguration(list []interface{}) (*batch.DiskEncryptionConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("disk_encryption is empty") } var result batch.DiskEncryptionConfiguration @@ -891,30 +891,26 @@ func expandBatchPoolDiskEncryptionConfiguration(list []interface{}) (*batch.Disk } func expandBatchPoolDataDisks(list []interface{}) (*[]batch.DataDisk, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("data_disk is empty") } var result []batch.DataDisk for _, tempItem := range list { item := tempItem.(map[string]interface{}) - dataDisk, err := expandBatchPoolDataDisk(item) - if err != nil { - return nil, err - } - result = append(result, *dataDisk) + result = append(result, expandBatchPoolDataDisk(item)) } return &result, nil } -func expandBatchPoolDataDisk(ref map[string]interface{}) (*batch.DataDisk, error) { - return &batch.DataDisk{ +func expandBatchPoolDataDisk(ref map[string]interface{}) batch.DataDisk { + return batch.DataDisk{ Lun: utils.Int32(int32(ref["lun"].(int))), Caching: batch.CachingType(ref["caching"].(string)), DiskSizeGB: utils.Int32(int32(ref["disk_size_gb"].(int))), StorageAccountType: batch.StorageAccountType(ref["storage_account_type"].(string)), - }, nil + } } func expandCommonEnvironmentProperties(env map[string]interface{}) *[]batch.EnvironmentSetting { @@ -975,9 +971,7 @@ func ExpandBatchPoolMountConfigurations(d *pluginsdk.ResourceData) (*[]batch.Mou mountConfigList := mountConfigs.([]interface{}) for _, tempItem := range mountConfigList { item := tempItem.(map[string]interface{}) - if mountConfig, err := expandBatchPoolMountConfiguration(item); err == nil { - result = append(result, mountConfig) - } + result = append(result, expandBatchPoolMountConfiguration(item)) } return &result, nil } @@ -985,7 +979,7 @@ func ExpandBatchPoolMountConfigurations(d *pluginsdk.ResourceData) (*[]batch.Mou return nil, fmt.Errorf("mount either is empty or contains parsing errors") } -func expandBatchPoolMountConfiguration(ref map[string]interface{}) (batch.MountConfiguration, error) { +func expandBatchPoolMountConfiguration(ref map[string]interface{}) batch.MountConfiguration { var result batch.MountConfiguration if azureBlobFileSystemConfiguration, err := expandBatchPoolAzureBlobFileSystemConfiguration(ref["azure_blob_file_system"].([]interface{})); err == nil { result.AzureBlobFileSystemConfiguration = azureBlobFileSystemConfiguration @@ -1003,11 +997,11 @@ func expandBatchPoolMountConfiguration(ref map[string]interface{}) (batch.MountC result.NfsMountConfiguration = nfsMountConfiguration } - return result, nil + return result } func expandBatchPoolAzureBlobFileSystemConfiguration(list []interface{}) (*batch.AzureBlobFileSystemConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("azure_blob_file_system is empty") } @@ -1033,7 +1027,7 @@ func expandBatchPoolAzureBlobFileSystemConfiguration(list []interface{}) (*batch } func expandBatchPoolAzureFileShareConfiguration(list []interface{}) (*batch.AzureFileShareConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("azure_file_share is empty") } @@ -1053,7 +1047,7 @@ func expandBatchPoolAzureFileShareConfiguration(list []interface{}) (*batch.Azur } func expandBatchPoolCIFSMountConfiguration(list []interface{}) (*batch.CIFSMountConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("cifs_mount is empty") } @@ -1073,7 +1067,7 @@ func expandBatchPoolCIFSMountConfiguration(list []interface{}) (*batch.CIFSMount } func expandBatchPoolNFSMountConfiguration(list []interface{}) (*batch.NFSMountConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 || list[0] == nil { return nil, fmt.Errorf("nfs_mount is empty") } @@ -1100,7 +1094,7 @@ func expandBatchPoolIdentityReference(ref map[string]interface{}) (*batch.Comput // ExpandBatchPoolNetworkConfiguration expands Batch pool network configuration func ExpandBatchPoolNetworkConfiguration(list []interface{}) (*batch.NetworkConfiguration, error) { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return nil, nil } @@ -1152,7 +1146,7 @@ func ExpandBatchPoolTaskSchedulingPolicy(d *pluginsdk.ResourceData) (*batch.Task if taskSchedulingPolicyString, ok := d.GetOk("task_scheduling_policy"); ok { taskSchedulingPolicy := taskSchedulingPolicyString.([]interface{}) - if taskSchedulingPolicy != nil && len(taskSchedulingPolicy) > 0 { + if len(taskSchedulingPolicy) > 0 { item := taskSchedulingPolicy[0].(map[string]interface{}) result.NodeFillType = batch.ComputeNodeFillType(item["node_fill_type"].(string)) } @@ -1162,7 +1156,7 @@ func ExpandBatchPoolTaskSchedulingPolicy(d *pluginsdk.ResourceData) (*batch.Task } func expandPoolEndpointConfiguration(list []interface{}) (*batch.PoolEndpointConfiguration, error) { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return nil, nil } @@ -1203,7 +1197,7 @@ func expandPoolEndpointConfiguration(list []interface{}) (*batch.PoolEndpointCon } func expandPoolNetworkSecurityGroupRule(list []interface{}) []batch.NetworkSecurityGroupRule { - if len(list) == 0 { + if len(list) == 0 || list[0] == nil { return []batch.NetworkSecurityGroupRule{} } @@ -1330,9 +1324,7 @@ func ExpandBatchPoolUserAccounts(d *pluginsdk.ResourceData) (*[]batch.UserAccoun if len(userAccounts) > 0 && userAccounts[0] != nil { for _, tempItem := range userAccounts { item := tempItem.(map[string]interface{}) - if userAccount, err := expandBatchPoolUserAccount(item); err == nil { - result = append(result, userAccount) - } + result = append(result, expandBatchPoolUserAccount(item)) } return &result, nil } @@ -1341,7 +1333,7 @@ func ExpandBatchPoolUserAccounts(d *pluginsdk.ResourceData) (*[]batch.UserAccoun return nil, fmt.Errorf("user_accounts either is empty or contains parsing errors") } -func expandBatchPoolUserAccount(ref map[string]interface{}) (batch.UserAccount, error) { +func expandBatchPoolUserAccount(ref map[string]interface{}) batch.UserAccount { result := batch.UserAccount{ Name: utils.String(ref["name"].(string)), Password: utils.String(ref["password"].(string)), @@ -1374,5 +1366,5 @@ func expandBatchPoolUserAccount(ref map[string]interface{}) (batch.UserAccount, } } - return result, nil + return result } diff --git a/internal/services/batch/batch_pool_resource.go b/internal/services/batch/batch_pool_resource.go index 0136f3bc02b3..2126c4568078 100644 --- a/internal/services/batch/batch_pool_resource.go +++ b/internal/services/batch/batch_pool_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -1521,7 +1521,7 @@ func startTaskSchema() map[string]*pluginsdk.Schema { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "resource_file": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/batch/batch_pool_resource_test.go b/internal/services/batch/batch_pool_resource_test.go index 3decb97f526b..675c6e7264a8 100644 --- a/internal/services/batch/batch_pool_resource_test.go +++ b/internal/services/batch/batch_pool_resource_test.go @@ -620,7 +620,6 @@ func TestAccBatchPool_diskSettings(t *testing.T) { }, data.ImportStep("stop_pending_resize_operation"), }) - } func TestAccBatchPool_extensions(t *testing.T) { diff --git a/internal/services/batch/client/client.go b/internal/services/batch/client/client.go index b79ded39fcca..224a0ebac2b9 100644 --- a/internal/services/batch/client/client.go +++ b/internal/services/batch/client/client.go @@ -5,7 +5,7 @@ import ( "fmt" batchDataplane "github.com/Azure/azure-sdk-for-go/services/batch/2020-03-01.11.0/batch" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/services/batch/parse" diff --git a/internal/services/blueprints/blueprint.go b/internal/services/blueprints/blueprint.go index 9c6413f71cdd..9414a117d121 100644 --- a/internal/services/blueprints/blueprint.go +++ b/internal/services/blueprints/blueprint.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/blueprints/blueprint_assignment_resource.go b/internal/services/blueprints/blueprint_assignment_resource.go index 47f1691a33e7..1bc9772c4bd8 100644 --- a/internal/services/blueprints/blueprint_assignment_resource.go +++ b/internal/services/blueprints/blueprint_assignment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/blueprints/client/client.go b/internal/services/blueprints/client/client.go index 47fe979fab4a..0277a4cd3828 100644 --- a/internal/services/blueprints/client/client.go +++ b/internal/services/blueprints/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/bot/bot_channel_alexa_resource.go b/internal/services/bot/bot_channel_alexa_resource.go index 2e859e4dfc57..64951acb44a2 100644 --- a/internal/services/bot/bot_channel_alexa_resource.go +++ b/internal/services/bot/bot_channel_alexa_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_alexa_resource_test.go b/internal/services/bot/bot_channel_alexa_resource_test.go index 088473dea3b6..26c0a1378471 100644 --- a/internal/services/bot/bot_channel_alexa_resource_test.go +++ b/internal/services/bot/bot_channel_alexa_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" diff --git a/internal/services/bot/bot_channel_direct_line_speech_resource.go b/internal/services/bot/bot_channel_direct_line_speech_resource.go index 44c8a57271aa..38def3fbcafc 100644 --- a/internal/services/bot/bot_channel_direct_line_speech_resource.go +++ b/internal/services/bot/bot_channel_direct_line_speech_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_direct_line_speech_resource_test.go b/internal/services/bot/bot_channel_direct_line_speech_resource_test.go index f397c8101d8e..08977d00ad3e 100644 --- a/internal/services/bot/bot_channel_direct_line_speech_resource_test.go +++ b/internal/services/bot/bot_channel_direct_line_speech_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_directline_resource.go b/internal/services/bot/bot_channel_directline_resource.go index 4098b406c525..93d16d47a78b 100644 --- a/internal/services/bot/bot_channel_directline_resource.go +++ b/internal/services/bot/bot_channel_directline_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_directline_resource_test.go b/internal/services/bot/bot_channel_directline_resource_test.go index 7075c69aa5f5..45fad65b9965 100644 --- a/internal/services/bot/bot_channel_directline_resource_test.go +++ b/internal/services/bot/bot_channel_directline_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_email_resource.go b/internal/services/bot/bot_channel_email_resource.go index 1bca72e9f51b..84d853a999e8 100644 --- a/internal/services/bot/bot_channel_email_resource.go +++ b/internal/services/bot/bot_channel_email_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_email_resource_test.go b/internal/services/bot/bot_channel_email_resource_test.go index 37b3c3df81ef..ffe6b9491ee7 100644 --- a/internal/services/bot/bot_channel_email_resource_test.go +++ b/internal/services/bot/bot_channel_email_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_facebook_resource.go b/internal/services/bot/bot_channel_facebook_resource.go index ec56e43fc111..b9f41605b399 100644 --- a/internal/services/bot/bot_channel_facebook_resource.go +++ b/internal/services/bot/bot_channel_facebook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_facebook_resource_test.go b/internal/services/bot/bot_channel_facebook_resource_test.go index b3869ed8c14d..eaee63ecbc9c 100644 --- a/internal/services/bot/bot_channel_facebook_resource_test.go +++ b/internal/services/bot/bot_channel_facebook_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_line_resource.go b/internal/services/bot/bot_channel_line_resource.go index f068e155142b..345cb3957d0c 100644 --- a/internal/services/bot/bot_channel_line_resource.go +++ b/internal/services/bot/bot_channel_line_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_line_resource_test.go b/internal/services/bot/bot_channel_line_resource_test.go index e2c0109ffad8..93045f724111 100644 --- a/internal/services/bot/bot_channel_line_resource_test.go +++ b/internal/services/bot/bot_channel_line_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_ms_teams_resource.go b/internal/services/bot/bot_channel_ms_teams_resource.go index f20edcf1802e..8529ca3d27ac 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource.go +++ b/internal/services/bot/bot_channel_ms_teams_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_ms_teams_resource_test.go b/internal/services/bot/bot_channel_ms_teams_resource_test.go index 9335548f546e..3071eabe3845 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource_test.go +++ b/internal/services/bot/bot_channel_ms_teams_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_slack_resource.go b/internal/services/bot/bot_channel_slack_resource.go index e0f91ed53802..7394dc69ff11 100644 --- a/internal/services/bot/bot_channel_slack_resource.go +++ b/internal/services/bot/bot_channel_slack_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_slack_resource_test.go b/internal/services/bot/bot_channel_slack_resource_test.go index 7b4c39406265..516dd563b624 100644 --- a/internal/services/bot/bot_channel_slack_resource_test.go +++ b/internal/services/bot/bot_channel_slack_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_sms_resource.go b/internal/services/bot/bot_channel_sms_resource.go index d472f631da38..211094bb6b9a 100644 --- a/internal/services/bot/bot_channel_sms_resource.go +++ b/internal/services/bot/bot_channel_sms_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_sms_resource_test.go b/internal/services/bot/bot_channel_sms_resource_test.go index 0150129413dd..e9b8604df7d3 100644 --- a/internal/services/bot/bot_channel_sms_resource_test.go +++ b/internal/services/bot/bot_channel_sms_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_web_chat_resource.go b/internal/services/bot/bot_channel_web_chat_resource.go index 2fa789d0431d..4bd23a7a332b 100644 --- a/internal/services/bot/bot_channel_web_chat_resource.go +++ b/internal/services/bot/bot_channel_web_chat_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/bot/bot_channel_web_chat_resource_test.go b/internal/services/bot/bot_channel_web_chat_resource_test.go index 5fe9e3b544dc..7f07655d460f 100644 --- a/internal/services/bot/bot_channel_web_chat_resource_test.go +++ b/internal/services/bot/bot_channel_web_chat_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channels_registration_resource.go b/internal/services/bot/bot_channels_registration_resource.go index 47a7e44643b8..32258ee39a94 100644 --- a/internal/services/bot/bot_channels_registration_resource.go +++ b/internal/services/bot/bot_channels_registration_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_connection_resource.go b/internal/services/bot/bot_connection_resource.go index 1da3327e5b32..59a813eabfbd 100644 --- a/internal/services/bot/bot_connection_resource.go +++ b/internal/services/bot/bot_connection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_healthbot_resource.go b/internal/services/bot/bot_healthbot_resource.go index ea75e4b7a61d..9a8e3226e0e7 100644 --- a/internal/services/bot/bot_healthbot_resource.go +++ b/internal/services/bot/bot_healthbot_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" + "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/bot/bot_service_azure_bot_resource.go b/internal/services/bot/bot_service_azure_bot_resource.go index 032ee4a2e719..3a95937cc9a5 100644 --- a/internal/services/bot/bot_service_azure_bot_resource.go +++ b/internal/services/bot/bot_service_azure_bot_resource.go @@ -1,7 +1,7 @@ package bot import ( - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/bot/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/bot/bot_service_base_resource.go b/internal/services/bot/bot_service_base_resource.go index b0a0ede04190..be208ca17961 100644 --- a/internal/services/bot/bot_service_base_resource.go +++ b/internal/services/bot/bot_service_base_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_web_app_resource.go b/internal/services/bot/bot_web_app_resource.go index dc04c1e12771..ea56435a2cba 100644 --- a/internal/services/bot/bot_web_app_resource.go +++ b/internal/services/bot/bot_web_app_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/client/client.go b/internal/services/bot/client/client.go index 24b1797b78fd..f7b8c0e65ab9 100644 --- a/internal/services/bot/client/client.go +++ b/internal/services/bot/client/client.go @@ -1,8 +1,8 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go b/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go index e93d5be1d62d..ec721cc2225c 100644 --- a/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go +++ b/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" ) diff --git a/internal/services/cdn/cdn_endpoint_custom_domain_resource.go b/internal/services/cdn/cdn_endpoint_custom_domain_resource.go index 3dc453544d50..e3c3966e5d35 100644 --- a/internal/services/cdn/cdn_endpoint_custom_domain_resource.go +++ b/internal/services/cdn/cdn_endpoint_custom_domain_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" @@ -579,9 +579,7 @@ func flattenArmCdnEndpointCustomDomainUserManagedHttpsSettings(ctx context.Conte var certIdLiteral string cert, err := keyVaultsClient.ManagementClient.GetCertificate(ctx, *keyVaultBaseUrl, secretName, secretVersion) if err == nil && cert.ID != nil { - certId, err := keyvaultParse.ParseOptionallyVersionedNestedItemID(*cert.ID) - if err == nil { - } + certId, _ := keyvaultParse.ParseOptionallyVersionedNestedItemID(*cert.ID) certIdLiteral = certId.ID() if !isVersioned { certIdLiteral = certId.VersionlessID() diff --git a/internal/services/cdn/cdn_endpoint_resource.go b/internal/services/cdn/cdn_endpoint_resource.go index 2056aa749f65..768c079bd18a 100644 --- a/internal/services/cdn/cdn_endpoint_resource.go +++ b/internal/services/cdn/cdn_endpoint_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go b/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go index d06ee13e6044..52c5e7b84573 100644 --- a/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go +++ b/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck dnsValidate "github.com/hashicorp/go-azure-sdk/resource-manager/dns/2018-05-01/zones" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -156,7 +156,7 @@ func resourceCdnFrontDoorCustomDomainCreate(d *pluginsdk.ResourceData, meta inte props.AFDDomainProperties.AzureDNSZone = expandResourceReference(dnsZone) } - tlsSettings, err := expandTlsParameters(tls, false) + tlsSettings, err := expandTlsParameters(tls) if err != nil { return err } @@ -319,7 +319,7 @@ func resourceCdnFrontDoorCustomDomainDelete(d *pluginsdk.ResourceData, meta inte return nil } -func expandTlsParameters(input []interface{}, isPreValidatedDomain bool) (*cdn.AFDDomainHTTPSParameters, error) { +func expandTlsParameters(input []interface{}) (*cdn.AFDDomainHTTPSParameters, error) { // NOTE: With the Frontdoor service, they do not treat an empty object like an empty object // if it is not nil they assume it is fully defined and then end up throwing errors when they // attempt to get a value from one of the fields. diff --git a/internal/services/cdn/cdn_frontdoor_endpoint_resource.go b/internal/services/cdn/cdn_frontdoor_endpoint_resource.go index 52bea3317a6c..25f63e22fc38 100644 --- a/internal/services/cdn/cdn_frontdoor_endpoint_resource.go +++ b/internal/services/cdn/cdn_frontdoor_endpoint_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go b/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go index f93cd62d68d3..b23cffa5c81a 100644 --- a/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go +++ b/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" diff --git a/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go b/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go index 049a86828e21..ef307e0acc99 100644 --- a/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go +++ b/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/cdn/cdn_frontdoor_helpers.go b/internal/services/cdn/cdn_frontdoor_helpers.go index 449bd1d020e8..7fd09adfa0d7 100644 --- a/internal/services/cdn/cdn_frontdoor_helpers.go +++ b/internal/services/cdn/cdn_frontdoor_helpers.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck dnsValidate "github.com/hashicorp/go-azure-sdk/resource-manager/dns/2018-05-01/zones" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" @@ -501,7 +501,7 @@ func validateCustomDomainLinkToDefaultDomainState(resourceCustomDomains []interf return nil } -func validateRoutesCustomDomainProfile(customDomains []interface{}, routeName string, routeProfile string) error { +func validateRoutesCustomDomainProfile(customDomains []interface{}, routeProfile string) error { wrongProfile := make([]string, 0) if len(customDomains) != 0 { diff --git a/internal/services/cdn/cdn_frontdoor_origin_group_resource.go b/internal/services/cdn/cdn_frontdoor_origin_group_resource.go index 188a0565ac2c..15f2c65077cc 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_group_resource.go +++ b/internal/services/cdn/cdn_frontdoor_origin_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" diff --git a/internal/services/cdn/cdn_frontdoor_origin_resource.go b/internal/services/cdn/cdn_frontdoor_origin_resource.go index 718a0712e893..6760f197abd6 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_resource.go +++ b/internal/services/cdn/cdn_frontdoor_origin_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/cdn_frontdoor_origin_resource_test.go b/internal/services/cdn/cdn_frontdoor_origin_resource_test.go index ce4cb9ec62c2..e98fdad1c969 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_resource_test.go +++ b/internal/services/cdn/cdn_frontdoor_origin_resource_test.go @@ -206,6 +206,7 @@ func (r CdnFrontDoorOriginResource) Exists(ctx context.Context, clients *clients return utils.Bool(true), nil } +//nolint:unused func (r CdnFrontDoorOriginResource) templatePrivateLinkStorage(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -232,6 +233,7 @@ resource "azurerm_storage_account" "test" { `, template, data.RandomString) } +// nolint: unused func (r CdnFrontDoorOriginResource) templatePrivateLinkStorageStaticWebSite(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -264,6 +266,7 @@ resource "azurerm_storage_account" "test" { `, template, data.RandomString) } +// nolint: unused func (r CdnFrontDoorOriginResource) templatePrivateLinkLoadBalancer(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", true) return fmt.Sprintf(` @@ -325,6 +328,7 @@ resource "azurerm_private_link_service" "test" { `, template, data.RandomInteger) } +//nolint:unused func (r CdnFrontDoorOriginResource) templatePrivateLinkWebApp(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -525,6 +529,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkBlobPrimary(data acceptance.TestData) string { template := r.templatePrivateLinkStorage(data) return fmt.Sprintf(` @@ -555,6 +560,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkStaticWebSite(data acceptance.TestData) string { template := r.templatePrivateLinkStorageStaticWebSite(data) return fmt.Sprintf(` @@ -585,6 +591,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkAppServices(data acceptance.TestData) string { template := r.templatePrivateLinkWebApp(data) return fmt.Sprintf(` @@ -615,6 +622,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkLoadBalancer(data acceptance.TestData) string { template := r.templatePrivateLinkLoadBalancer(data) return fmt.Sprintf(` diff --git a/internal/services/cdn/cdn_frontdoor_profile_resource.go b/internal/services/cdn/cdn_frontdoor_profile_resource.go index 0312231345cd..79086f37d9b9 100644 --- a/internal/services/cdn/cdn_frontdoor_profile_resource.go +++ b/internal/services/cdn/cdn_frontdoor_profile_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go b/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go index ea8f101cf869..f08d13887b94 100644 --- a/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go +++ b/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/cdn/cdn_frontdoor_route_resource.go b/internal/services/cdn/cdn_frontdoor_route_resource.go index 4537ed9a56c4..17b3909e089e 100644 --- a/internal/services/cdn/cdn_frontdoor_route_resource.go +++ b/internal/services/cdn/cdn_frontdoor_route_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -254,7 +254,7 @@ func resourceCdnFrontDoorRouteCreate(d *pluginsdk.ResourceData, meta interface{} return err } - if err := validateRoutesCustomDomainProfile(normalizedCustomDomains, id.RouteName, id.ProfileName); err != nil { + if err := validateRoutesCustomDomainProfile(normalizedCustomDomains, id.ProfileName); err != nil { return err } } @@ -447,7 +447,7 @@ func resourceCdnFrontDoorRouteUpdate(d *pluginsdk.ResourceData, meta interface{} return err } - if err := validateRoutesCustomDomainProfile(customDomains, id.RouteName, id.ProfileName); err != nil { + if err := validateRoutesCustomDomainProfile(customDomains, id.ProfileName); err != nil { return err } } diff --git a/internal/services/cdn/cdn_frontdoor_rule_resource.go b/internal/services/cdn/cdn_frontdoor_rule_resource.go index 8844038cf67b..fb87f105be30 100644 --- a/internal/services/cdn/cdn_frontdoor_rule_resource.go +++ b/internal/services/cdn/cdn_frontdoor_rule_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - cdn "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + cdn "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnFrontDoorRuleActions "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorruleactions" diff --git a/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go b/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go index 77c5caed3195..11908d674456 100644 --- a/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go +++ b/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go @@ -1,9 +1,7 @@ package cdn_test import ( - "fmt" "os" - "strings" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -30,56 +28,3 @@ func TestAccCdnFrontDoorSecretDataSource_basic(t *testing.T) { data.ImportStep(), }) } - -func (r CdnFrontdoorSecretResourceDataSource) preCheck(t *testing.T) { - if r.DoNotRunFrontDoorCustomDomainTests == "" { - t.Skipf("`ARM_TEST_DO_NOT_RUN_CDN_FRONT_DOOR_CUSTOM_DOMAIN` must be set for acceptance tests") - } - - if strings.EqualFold(r.DoNotRunFrontDoorCustomDomainTests, "true") { - t.Skipf("`data.azurerm_cdn_frontdoor_secret` currently is not testable due to service requirements") - } -} - -func (r CdnFrontdoorSecretResourceDataSource) template(data acceptance.TestData) string { - return fmt.Sprintf(` -resource "azurerm_resource_group" "test" { - name = "acctestRG-cdn-afdx-%[1]d" - location = "%[2]s" -} - -resource "azurerm_cdn_frontdoor_profile" "test" { - name = "accTestProfile-%[1]d" - resource_group_name = azurerm_resource_group.test.name - sku_name = "Standard_AzureFrontDoor" -} - -resource "azurerm_cdn_frontdoor_secret" "test" { - name = "accTestSecret-%[1]d" - cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile.test.id - - secret { - customer_certificate { - key_vault_certificate_id = azurerm_key_vault_certificate.test.id - } - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) -} - -func (r CdnFrontdoorSecretResourceDataSource) basic(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -%s - -data "azurerm_cdn_frontdoor_secret" "test" { - name = azurerm_cdn_frontdoor_secret.test.name - profile_name = azurerm_cdn_frontdoor_profile.test.name - resource_group_name = azurerm_cdn_frontdoor_profile.test.resource_group_name -} -`, template) -} diff --git a/internal/services/cdn/cdn_frontdoor_secret_resource.go b/internal/services/cdn/cdn_frontdoor_secret_resource.go index 0397dddf0415..074ed8f29cfd 100644 --- a/internal/services/cdn/cdn_frontdoor_secret_resource.go +++ b/internal/services/cdn/cdn_frontdoor_secret_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnFrontDoorsecretparams "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorsecretparams" diff --git a/internal/services/cdn/cdn_frontdoor_security_policy_resource.go b/internal/services/cdn/cdn_frontdoor_security_policy_resource.go index ee8bb671f710..7f9a763c9d96 100644 --- a/internal/services/cdn/cdn_frontdoor_security_policy_resource.go +++ b/internal/services/cdn/cdn_frontdoor_security_policy_resource.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnfrontdoorsecurityparams "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorsecurityparams" diff --git a/internal/services/cdn/cdn_frontdoor_shared_schema.go b/internal/services/cdn/cdn_frontdoor_shared_schema.go index 449fbff7687d..e5f3f24a1c1f 100644 --- a/internal/services/cdn/cdn_frontdoor_shared_schema.go +++ b/internal/services/cdn/cdn_frontdoor_shared_schema.go @@ -1,7 +1,7 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/cdn_profile_resource.go b/internal/services/cdn/cdn_profile_resource.go index 7104e9f4a194..11ec03362cb5 100644 --- a/internal/services/cdn/cdn_profile_resource.go +++ b/internal/services/cdn/cdn_profile_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/client/client.go b/internal/services/cdn/client/client.go index bf75b270da9d..44b54beee5f6 100644 --- a/internal/services/cdn/client/client.go +++ b/internal/services/cdn/client/client.go @@ -1,9 +1,9 @@ package client import ( - cdnSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" - cdnFrontDoorSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + cdnSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck + cdnFrontDoorSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/cdn/deliveryruleactions/cache_expiration.go b/internal/services/cdn/deliveryruleactions/cache_expiration.go index ffeebece03b9..10f82d5e70b5 100644 --- a/internal/services/cdn/deliveryruleactions/cache_expiration.go +++ b/internal/services/cdn/deliveryruleactions/cache_expiration.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/deliveryruleactions/cache_key_query_string.go b/internal/services/cdn/deliveryruleactions/cache_key_query_string.go index ff2393137040..89dafe9c73d8 100644 --- a/internal/services/cdn/deliveryruleactions/cache_key_query_string.go +++ b/internal/services/cdn/deliveryruleactions/cache_key_query_string.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/modify_request_header.go b/internal/services/cdn/deliveryruleactions/modify_request_header.go index 1c86bbe087a6..f1deaba40c45 100644 --- a/internal/services/cdn/deliveryruleactions/modify_request_header.go +++ b/internal/services/cdn/deliveryruleactions/modify_request_header.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/modify_response_header.go b/internal/services/cdn/deliveryruleactions/modify_response_header.go index b092eba0eec0..99814fad7c1c 100644 --- a/internal/services/cdn/deliveryruleactions/modify_response_header.go +++ b/internal/services/cdn/deliveryruleactions/modify_response_header.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/url_redirect.go b/internal/services/cdn/deliveryruleactions/url_redirect.go index 146200972d27..26cf323b8d55 100644 --- a/internal/services/cdn/deliveryruleactions/url_redirect.go +++ b/internal/services/cdn/deliveryruleactions/url_redirect.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/deliveryruleactions/url_rewrite.go b/internal/services/cdn/deliveryruleactions/url_rewrite.go index 4cb2cd71116c..40e586046750 100644 --- a/internal/services/cdn/deliveryruleactions/url_rewrite.go +++ b/internal/services/cdn/deliveryruleactions/url_rewrite.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/cookies.go b/internal/services/cdn/deliveryruleconditions/cookies.go index 1d9232e4896a..7da8f759db35 100644 --- a/internal/services/cdn/deliveryruleconditions/cookies.go +++ b/internal/services/cdn/deliveryruleconditions/cookies.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/device.go b/internal/services/cdn/deliveryruleconditions/device.go index e49065ab951a..f94b6cd486ff 100644 --- a/internal/services/cdn/deliveryruleconditions/device.go +++ b/internal/services/cdn/deliveryruleconditions/device.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/http_version.go b/internal/services/cdn/deliveryruleconditions/http_version.go index ea657535f777..c240de363b17 100644 --- a/internal/services/cdn/deliveryruleconditions/http_version.go +++ b/internal/services/cdn/deliveryruleconditions/http_version.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/post_arg.go b/internal/services/cdn/deliveryruleconditions/post_arg.go index 3058e9e1e769..15f3ff45768a 100644 --- a/internal/services/cdn/deliveryruleconditions/post_arg.go +++ b/internal/services/cdn/deliveryruleconditions/post_arg.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/query_string.go b/internal/services/cdn/deliveryruleconditions/query_string.go index d203a0fb8634..a0099cdc7e4d 100644 --- a/internal/services/cdn/deliveryruleconditions/query_string.go +++ b/internal/services/cdn/deliveryruleconditions/query_string.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/remote_address.go b/internal/services/cdn/deliveryruleconditions/remote_address.go index fb0bf1dac119..6aea1ebc5eec 100644 --- a/internal/services/cdn/deliveryruleconditions/remote_address.go +++ b/internal/services/cdn/deliveryruleconditions/remote_address.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_body.go b/internal/services/cdn/deliveryruleconditions/request_body.go index 27b1f9296abd..1cc298f2f97b 100644 --- a/internal/services/cdn/deliveryruleconditions/request_body.go +++ b/internal/services/cdn/deliveryruleconditions/request_body.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_header.go b/internal/services/cdn/deliveryruleconditions/request_header.go index a8a74234998b..7387f818044d 100644 --- a/internal/services/cdn/deliveryruleconditions/request_header.go +++ b/internal/services/cdn/deliveryruleconditions/request_header.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_method.go b/internal/services/cdn/deliveryruleconditions/request_method.go index 5c60f1de2fd6..3651bd3deac2 100644 --- a/internal/services/cdn/deliveryruleconditions/request_method.go +++ b/internal/services/cdn/deliveryruleconditions/request_method.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_scheme.go b/internal/services/cdn/deliveryruleconditions/request_scheme.go index 671f91ba1836..ccde8aa033d0 100644 --- a/internal/services/cdn/deliveryruleconditions/request_scheme.go +++ b/internal/services/cdn/deliveryruleconditions/request_scheme.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_uri.go b/internal/services/cdn/deliveryruleconditions/request_uri.go index dff82be951bf..343a543029c3 100644 --- a/internal/services/cdn/deliveryruleconditions/request_uri.go +++ b/internal/services/cdn/deliveryruleconditions/request_uri.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_file_extension.go b/internal/services/cdn/deliveryruleconditions/url_file_extension.go index f28afd065da3..1217dfd08d29 100644 --- a/internal/services/cdn/deliveryruleconditions/url_file_extension.go +++ b/internal/services/cdn/deliveryruleconditions/url_file_extension.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_file_name.go b/internal/services/cdn/deliveryruleconditions/url_file_name.go index 131257c7b5ee..3dcdc392a47e 100644 --- a/internal/services/cdn/deliveryruleconditions/url_file_name.go +++ b/internal/services/cdn/deliveryruleconditions/url_file_name.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_path.go b/internal/services/cdn/deliveryruleconditions/url_path.go index a90aa2c6aa6f..0cf018dea9f1 100644 --- a/internal/services/cdn/deliveryruleconditions/url_path.go +++ b/internal/services/cdn/deliveryruleconditions/url_path.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/endpoint_delivery_rule.go b/internal/services/cdn/endpoint_delivery_rule.go index 0367efd51919..d417227b640d 100644 --- a/internal/services/cdn/endpoint_delivery_rule.go +++ b/internal/services/cdn/endpoint_delivery_rule.go @@ -1,7 +1,7 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleactions" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleconditions" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" diff --git a/internal/services/cdn/endpoint_global_delivery_rule.go b/internal/services/cdn/endpoint_global_delivery_rule.go index ec9ebecd9d7d..2f1bb2cd4dcd 100644 --- a/internal/services/cdn/endpoint_global_delivery_rule.go +++ b/internal/services/cdn/endpoint_global_delivery_rule.go @@ -1,14 +1,14 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleactions" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) func endpointGlobalDeliveryRule() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go b/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go index d2213902406d..745ad533a36d 100644 --- a/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go +++ b/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go b/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go index 3b181a973df9..3f537beb7f4c 100644 --- a/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go +++ b/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go @@ -3,7 +3,7 @@ package CdnFrontDoorruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" cdnValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -1257,7 +1257,6 @@ func FlattenFrontdoorSslProtocolCondition(input cdn.BasicDeliveryRuleCondition) normalized := createCdnFrontDoorNormalizedConditionStub() if params := condition.Parameters; params != nil { - matchValues := make([]string, 0) for _, value := range *params.MatchValues { matchValues = append(matchValues, string(value)) diff --git a/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go b/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go index d9b9829b6eca..a21caa54803f 100644 --- a/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go +++ b/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go b/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go index 25426c85cf6a..4cce65f4b610 100644 --- a/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go +++ b/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go @@ -3,7 +3,7 @@ package cdnfrontdoorsecurityparams import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cdn/validate/front_door_route_https_redirect.go b/internal/services/cdn/validate/front_door_route_https_redirect.go index 03981050995c..c437bd22e936 100644 --- a/internal/services/cdn/validate/front_door_route_https_redirect.go +++ b/internal/services/cdn/validate/front_door_route_https_redirect.go @@ -3,7 +3,7 @@ package validate import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cdn/validate/front_door_rule_cidr_valid_test.go b/internal/services/cdn/validate/front_door_rule_cidr_valid_test.go index 3d57224ade38..dec4c87bfbfb 100644 --- a/internal/services/cdn/validate/front_door_rule_cidr_valid_test.go +++ b/internal/services/cdn/validate/front_door_rule_cidr_valid_test.go @@ -141,7 +141,6 @@ func TestFrontDoorRuleCidrIsValid(t *testing.T) { } else { t.Logf("[DEBUG] Testing Value %s", tc.Input) } - } } } diff --git a/internal/services/cdn/validate/front_door_validation_helpers.go b/internal/services/cdn/validate/front_door_validation_helpers.go index 70a482a25424..5fedb32eb988 100644 --- a/internal/services/cdn/validate/front_door_validation_helpers.go +++ b/internal/services/cdn/validate/front_door_validation_helpers.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" ) diff --git a/internal/services/cognitive/cognitive_account_resource.go b/internal/services/cognitive/cognitive_account_resource.go index 741128100f4b..96c052b75aef 100644 --- a/internal/services/cognitive/cognitive_account_resource.go +++ b/internal/services/cognitive/cognitive_account_resource.go @@ -579,7 +579,7 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e if props.RestrictOutboundNetworkAccess != nil { outboundNetworkAccessRestricted = *props.RestrictOutboundNetworkAccess } - //lintignore:R001 + // lintignore:R001 d.Set("outbound_network_access_restricted", outboundNetworkAccessRestricted) localAuthEnabled := true @@ -588,7 +588,7 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e } d.Set("local_auth_enabled", localAuthEnabled) - customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(id, props.Encryption) + customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(props.Encryption) if err != nil { return err } @@ -802,7 +802,6 @@ func flattenCognitiveAccountNetworkAcls(input *cognitiveservicesaccounts.Network } } - virtualNetworkSubnetIds := make([]interface{}, 0) virtualNetworkRules := make([]interface{}, 0) if input.VirtualNetworkRules != nil { for _, v := range *input.VirtualNetworkRules { @@ -812,7 +811,6 @@ func flattenCognitiveAccountNetworkAcls(input *cognitiveservicesaccounts.Network id = subnetId.ID() } - virtualNetworkSubnetIds = append(virtualNetworkSubnetIds, id) virtualNetworkRules = append(virtualNetworkRules, map[string]interface{}{ "subnet_id": id, "ignore_missing_vnet_service_endpoint": *v.IgnoreMissingVnetServiceEndpoint, @@ -870,7 +868,7 @@ func expandCognitiveAccountCustomerManagedKey(input []interface{}) *cognitiveser } } -func flattenCognitiveAccountCustomerManagedKey(cognitiveAccountId *cognitiveservicesaccounts.AccountId, input *cognitiveservicesaccounts.Encryption) ([]interface{}, error) { +func flattenCognitiveAccountCustomerManagedKey(input *cognitiveservicesaccounts.Encryption) ([]interface{}, error) { if input == nil { return []interface{}{}, nil } diff --git a/internal/services/cognitive/cognitive_account_resource_test.go b/internal/services/cognitive/cognitive_account_resource_test.go index f7a9da70fb59..3be2b569c776 100644 --- a/internal/services/cognitive/cognitive_account_resource_test.go +++ b/internal/services/cognitive/cognitive_account_resource_test.go @@ -789,25 +789,6 @@ resource "azurerm_cognitive_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } -func (CognitiveAccountResource) openAI(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} -resource "azurerm_resource_group" "test" { - name = "acctestRG-cognitive-%d" - location = "%s" -} -resource "azurerm_cognitive_account" "test" { - name = "acctestcogacc-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - kind = "OpenAI" - sku_name = "S0" -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) -} - func (CognitiveAccountResource) dynamicThrottlingEnabled(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index 870e86a1816c..e438f9aac1d1 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" + "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" diff --git a/internal/services/compute/disk_sas_token_resource.go b/internal/services/compute/disk_sas_token_resource.go index 5664769a740b..6085031e9385 100644 --- a/internal/services/compute/disk_sas_token_resource.go +++ b/internal/services/compute/disk_sas_token_resource.go @@ -27,7 +27,6 @@ type Output struct { } func resourceManagedDiskSasToken() *pluginsdk.Resource { - return &pluginsdk.Resource{ Create: resourceManagedDiskSasTokenCreate, Read: resourceManagedDiskSasTokenRead, @@ -77,7 +76,6 @@ func resourceManagedDiskSasToken() *pluginsdk.Resource { }, }, } - } func resourceManagedDiskSasTokenCreate(d *pluginsdk.ResourceData, meta interface{}) error { @@ -127,7 +125,7 @@ func resourceManagedDiskSasTokenCreate(d *pluginsdk.ResourceData, meta interface } var result Result - err = json.Unmarshal([]byte(buf.String()), &result) + err = json.Unmarshal(buf.Bytes(), &result) if err != nil { return fmt.Errorf("retrieving SAS Token for Disk Access %s: %+v", *diskId, err) } @@ -142,7 +140,6 @@ func resourceManagedDiskSasTokenCreate(d *pluginsdk.ResourceData, meta interface } return resourceManagedDiskSasTokenRead(d, meta) - } func resourceManagedDiskSasTokenRead(d *pluginsdk.ResourceData, meta interface{}) error { diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index fa032f0545a8..227a7fb22f0a 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -446,10 +446,7 @@ func resourceLinuxVirtualMachineCreate(d *pluginsdk.ResourceData, meta interface sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) sshKeysRaw := d.Get("admin_ssh_key").(*pluginsdk.Set).List() sshKeys := ExpandSSHKeys(sshKeysRaw) diff --git a/internal/services/compute/linux_virtual_machine_resource_other_test.go b/internal/services/compute/linux_virtual_machine_resource_other_test.go index b89729fc6f81..a58d55243405 100644 --- a/internal/services/compute/linux_virtual_machine_resource_other_test.go +++ b/internal/services/compute/linux_virtual_machine_resource_other_test.go @@ -892,6 +892,7 @@ resource "azurerm_linux_virtual_machine" "test" { `, r.template(data), data.RandomInteger) } +// nolint: unused func (r LinuxVirtualMachineResource) otherPatchAssessmentModeAutomaticByPlatform(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go b/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go index f567b68f8dc5..4097781ddbb6 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go @@ -542,52 +542,6 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger) } -func (r LinuxVirtualMachineScaleSetResource) disksOSDiskEphemeralResourceDisk(data acceptance.TestData) string { - return fmt.Sprintf(` -%s - -resource "azurerm_linux_virtual_machine_scale_set" "test" { - name = "acctestvmss-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard_F2s_v2" - instances = 1 - admin_username = "adminuser" - admin_password = "P@ssword1234!" - - disable_password_authentication = false - - source_image_reference { - publisher = "Canonical" - offer = "UbuntuServer" - sku = "16.04-LTS" - version = "latest" - } - - os_disk { - storage_account_type = "Standard_LRS" - caching = "ReadOnly" - - diff_disk_settings { - option = "Local" - placement = "ResourceDisk" - } - } - - network_interface { - name = "example" - primary = true - - ip_configuration { - name = "internal" - primary = true - subnet_id = azurerm_subnet.test.id - } - } -} -`, r.template(data), data.RandomInteger) -} - func (r LinuxVirtualMachineScaleSetResource) disksOSDiskStorageAccountType(data acceptance.TestData, storageAccountType string) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go b/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go index db516cbb2f71..3f671a4d1492 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go @@ -1585,6 +1585,8 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger, data.RandomInteger) } +// skipped +// nolint:unused func (r LinuxVirtualMachineScaleSetResource) networkPublicIPVersion(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_resource.go b/internal/services/compute/linux_virtual_machine_scale_set_resource.go index ad1d75417720..2eb34d1a8ae8 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_resource.go @@ -112,10 +112,7 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, meta i sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) sshKeysRaw := d.Get("admin_ssh_key").(*pluginsdk.Set).List() sshKeys := ExpandSSHKeys(sshKeysRaw) @@ -629,10 +626,7 @@ func resourceLinuxVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, meta i if d.HasChange("source_image_id") || d.HasChange("source_image_reference") { sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) // Must include all storage profile properties when updating disk image. See: https://github.com/hashicorp/terraform-provider-azurerm/issues/8273 updateProps.VirtualMachineProfile.StorageProfile.DataDisks = existing.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.DataDisks diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 702ec8087648..9fddf6e1839c 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -699,10 +699,7 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if oldSize, newSize := d.GetChange("disk_size_gb"); newSize.(int) > oldSize.(int) { canBeResizedWithoutDowntime := false if meta.(*clients.Client).Features.ManagedDisk.ExpandWithoutDowntime { - diskSupportsNoDowntimeResize, err := determineIfDataDiskSupportsNoDowntimeResize(disk.Model, oldSize.(int), newSize.(int)) - if err != nil { - return fmt.Errorf("determining if the Disk supports no-downtime-resize: %+v", err) - } + diskSupportsNoDowntimeResize := determineIfDataDiskSupportsNoDowntimeResize(disk.Model, oldSize.(int), newSize.(int)) vmSkuSupportsNoDowntimeResize, err := determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx, disk.Model.ManagedBy, virtualMachinesClient, skusClient) if err != nil { diff --git a/internal/services/compute/managed_disk_resource_test.go b/internal/services/compute/managed_disk_resource_test.go index 41b143b339f4..2576147a5af6 100644 --- a/internal/services/compute/managed_disk_resource_test.go +++ b/internal/services/compute/managed_disk_resource_test.go @@ -772,24 +772,6 @@ func (ManagedDiskResource) Exists(ctx context.Context, clients *clients.Client, return utils.Bool(resp.Model != nil), nil } -func (ManagedDiskResource) destroyVirtualMachine(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - vmName := state.Attributes["name"] - resourceGroup := state.Attributes["resource_group_name"] - - // this is a preview feature we don't want to use right now - var forceDelete *bool = nil - future, err := client.Compute.VMClient.Delete(ctx, resourceGroup, vmName, forceDelete) - if err != nil { - return fmt.Errorf("Bad: Delete on vmClient: %+v", err) - } - - if err = future.WaitForCompletionRef(ctx, client.Compute.VMClient.Client); err != nil { - return fmt.Errorf("Bad: Delete on vmClient: %+v", err) - } - - return nil -} - func (ManagedDiskResource) empty(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/compute/no_downtime_resize.go b/internal/services/compute/no_downtime_resize.go index c896620ed6e7..9dfcca72a43a 100644 --- a/internal/services/compute/no_downtime_resize.go +++ b/internal/services/compute/no_downtime_resize.go @@ -20,28 +20,28 @@ import ( // @tombuildsstuff: this is intentionally split out into it's own file since this'll need to be reused -func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, newSizeGb int) (*bool, error) { +func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, newSizeGb int) *bool { if disk == nil || disk.Properties == nil || disk.Sku == nil { - return pointer.To(false), nil + return pointer.To(false) } // Only supported for data disks. isDataDisk := disk.Properties.OsType != nil && string(*disk.Properties.OsType) != "" if isDataDisk { - return pointer.To(false), nil + return pointer.To(false) } // Not supported for shared disks. isSharedDisk := disk.Properties.MaxShares != nil && *disk.Properties.MaxShares >= 0 if isSharedDisk { log.Printf("[DEBUG] Disk is shared so does not support no-downtime-resize") - return pointer.To(false), nil + return pointer.To(false) } // If a disk is 4 TiB or less, you can't expand it beyond 4 TiB without deallocating the VM. // If a disk is already greater than 4 TiB, you can expand it without deallocating the VM. if oldSizeGb < 4096 && newSizeGb >= 4096 { - return pointer.To(false), nil + return pointer.To(false) } // Not supported for Ultra disks or Premium SSD v2 disks. @@ -53,13 +53,12 @@ func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, ne disks.DiskStorageAccountTypesStandardSSDLRS, disks.DiskStorageAccountTypesStandardSSDZRS, } { - if strings.EqualFold(string(*disk.Sku.Name), string(supportedDiskType)) { diskTypeIsSupported = true } } } - return pointer.To(diskTypeIsSupported), nil + return pointer.To(diskTypeIsSupported) } func determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx context.Context, virtualMachineIdRaw *string, virtualMachinesClient *virtualmachines.VirtualMachinesClient, skusClient *skus.SkusClient) (*bool, error) { diff --git a/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go b/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go index c8df6e5e9ae8..c1e950d73166 100644 --- a/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go @@ -380,10 +380,7 @@ func resourceOrchestratedVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) if len(sourceImageReferenceRaw) != 0 || sourceImageId != "" { - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) virtualMachineProfile.StorageProfile.ImageReference = sourceImageReference } @@ -936,10 +933,7 @@ func resourceOrchestratedVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, sourceImageId := d.Get("source_image_id").(string) if len(sourceImageReferenceRaw) != 0 || sourceImageId != "" { - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) updateProps.VirtualMachineProfile.StorageProfile.ImageReference = sourceImageReference } diff --git a/internal/services/compute/shared_image_resource.go b/internal/services/compute/shared_image_resource.go index 0d02e1e2b696..d297aae1a0f3 100644 --- a/internal/services/compute/shared_image_resource.go +++ b/internal/services/compute/shared_image_resource.go @@ -367,9 +367,7 @@ func resourceSharedImageRead(d *pluginsdk.ResourceData, meta interface{}) error diskTypesNotAllowed := make([]string, 0) if disallowed := props.Disallowed; disallowed != nil { if disallowed.DiskTypes != nil { - for _, v := range *disallowed.DiskTypes { - diskTypesNotAllowed = append(diskTypesNotAllowed, v) - } + diskTypesNotAllowed = append(diskTypesNotAllowed, *disallowed.DiskTypes...) } } d.Set("disk_types_not_allowed", diskTypesNotAllowed) diff --git a/internal/services/compute/shared_schema.go b/internal/services/compute/shared_schema.go index 7d63d1d02308..ce3a7063a4dc 100644 --- a/internal/services/compute/shared_schema.go +++ b/internal/services/compute/shared_schema.go @@ -95,7 +95,7 @@ func flattenAdditionalUnattendContent(input *[]compute.AdditionalUnattendContent } func bootDiagnosticsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, @@ -437,14 +437,14 @@ func isValidHotPatchSourceImageReference(referenceInput []interface{}, imageId s return false } -func expandSourceImageReference(referenceInput []interface{}, imageId string) (*compute.ImageReference, error) { +func expandSourceImageReference(referenceInput []interface{}, imageId string) *compute.ImageReference { if imageId != "" { // With Version : "/communityGalleries/publicGalleryName/images/myGalleryImageName/versions/(major.minor.patch | latest)" // Versionless(e.g. latest): "/communityGalleries/publicGalleryName/images/myGalleryImageName" if _, errors := validation.Any(validate.CommunityGalleryImageID, validate.CommunityGalleryImageVersionID)(imageId, "source_image_id"); len(errors) == 0 { return &compute.ImageReference{ CommunityGalleryImageID: utils.String(imageId), - }, nil + } } // With Version : "/sharedGalleries/galleryUniqueName/images/myGalleryImageName/versions/(major.minor.patch | latest)" @@ -452,12 +452,12 @@ func expandSourceImageReference(referenceInput []interface{}, imageId string) (* if _, errors := validation.Any(validate.SharedGalleryImageID, validate.SharedGalleryImageVersionID)(imageId, "source_image_id"); len(errors) == 0 { return &compute.ImageReference{ SharedGalleryImageID: utils.String(imageId), - }, nil + } } return &compute.ImageReference{ ID: utils.String(imageId), - }, nil + } } raw := referenceInput[0].(map[string]interface{}) @@ -466,7 +466,7 @@ func expandSourceImageReference(referenceInput []interface{}, imageId string) (* Offer: utils.String(raw["offer"].(string)), Sku: utils.String(raw["sku"].(string)), Version: utils.String(raw["version"].(string)), - }, nil + } } func flattenSourceImageReference(input *compute.ImageReference, hasImageId bool) []interface{} { diff --git a/internal/services/compute/virtual_machine_scale_set.go b/internal/services/compute/virtual_machine_scale_set.go index 66d2ded9ce73..39259d5d9350 100644 --- a/internal/services/compute/virtual_machine_scale_set.go +++ b/internal/services/compute/virtual_machine_scale_set.go @@ -2167,7 +2167,7 @@ func virtualMachineScaleSetExtensionHash(v interface{}) int { if v, ok := m["protected_settings_from_key_vault"]; ok { protectedSettingsFromKeyVault := v.([]interface{}) - if protectedSettingsFromKeyVault != nil && len(protectedSettingsFromKeyVault) > 0 { + if len(protectedSettingsFromKeyVault) > 0 { buf.WriteString(fmt.Sprintf("%s-", protectedSettingsFromKeyVault[0].(map[string]interface{})["secret_url"].(string))) buf.WriteString(fmt.Sprintf("%s-", protectedSettingsFromKeyVault[0].(map[string]interface{})["source_vault_id"].(string))) } diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index da423d33b6fd..c76b49bae7dc 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -481,10 +481,7 @@ func resourceWindowsVirtualMachineCreate(d *pluginsdk.ResourceData, meta interfa sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) winRmListenersRaw := d.Get("winrm_listener").(*pluginsdk.Set).List() winRmListeners := expandWinRMListener(winRmListenersRaw) diff --git a/internal/services/compute/windows_virtual_machine_resource_other_test.go b/internal/services/compute/windows_virtual_machine_resource_other_test.go index 3f1a8597ef11..41e70cae0720 100644 --- a/internal/services/compute/windows_virtual_machine_resource_other_test.go +++ b/internal/services/compute/windows_virtual_machine_resource_other_test.go @@ -1277,6 +1277,7 @@ resource "azurerm_windows_virtual_machine" "test" { `, r.template(data)) } +//nolint:unused func (r WindowsVirtualMachineResource) otherPatchAssessmentModeAutomaticByPlatform(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go b/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go index ef07f1f3d16b..161ea6cd43ba 100644 --- a/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go +++ b/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go @@ -1639,6 +1639,7 @@ resource "azurerm_windows_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger, data.RandomStringOfLength(9)) } +//nolint:unused func (r WindowsVirtualMachineScaleSetResource) networkPublicIPVersion(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/windows_virtual_machine_scale_set_resource.go b/internal/services/compute/windows_virtual_machine_scale_set_resource.go index bb8015cd3be0..c47064035ad2 100644 --- a/internal/services/compute/windows_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/windows_virtual_machine_scale_set_resource.go @@ -112,10 +112,7 @@ func resourceWindowsVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, meta sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) provisionVMAgent := d.Get("provision_vm_agent").(bool) zones := zones.ExpandUntyped(d.Get("zones").(*schema.Set).List()) @@ -639,10 +636,7 @@ func resourceWindowsVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, meta if d.HasChange("source_image_id") || d.HasChange("source_image_reference") { sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) // Must include all storage profile properties when updating disk image. See: https://github.com/hashicorp/terraform-provider-azurerm/issues/8273 updateProps.VirtualMachineProfile.StorageProfile.DataDisks = existing.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.DataDisks diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 147249a81bcf..b051c60ece3a 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -1,8 +1,8 @@ package client import ( - legacy "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + legacy "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools" diff --git a/internal/services/containers/container_connected_registry_resource.go b/internal/services/containers/container_connected_registry_resource.go index 5a3742c2afdd..19d0a05fa969 100644 --- a/internal/services/containers/container_connected_registry_resource.go +++ b/internal/services/containers/container_connected_registry_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" tfvalidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/containers/container_registry_agent_pool_resource.go b/internal/services/containers/container_registry_agent_pool_resource.go index 13b0f95d6c2a..562cca5faf6b 100644 --- a/internal/services/containers/container_registry_agent_pool_resource.go +++ b/internal/services/containers/container_registry_agent_pool_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index 0cb771bf4a73..9648f6ec8bf2 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -642,13 +642,11 @@ func resourceContainerRegistryRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("making Read request on Azure Container Registry %s for replications: %s", id.Name, err) } - geoReplicationLocations := make([]interface{}, 0) geoReplications := make([]interface{}, 0) for _, value := range replications.Values() { if value.Location != nil { valueLocation := azure.NormalizeLocation(*value.Location) if location != nil && valueLocation != azure.NormalizeLocation(*location) { - geoReplicationLocations = append(geoReplicationLocations, *value.Location) replication := make(map[string]interface{}) replication["location"] = valueLocation replication["tags"] = tags.Flatten(value.Tags) diff --git a/internal/services/containers/container_registry_scope_map_resource.go b/internal/services/containers/container_registry_scope_map_resource.go index d3f521b292d1..4fc624b7bbb6 100644 --- a/internal/services/containers/container_registry_scope_map_resource.go +++ b/internal/services/containers/container_registry_scope_map_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/containers/container_registry_task_resource.go b/internal/services/containers/container_registry_task_resource.go index 2f6bf304d735..56c8df47a71c 100644 --- a/internal/services/containers/container_registry_task_resource.go +++ b/internal/services/containers/container_registry_task_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/containers/container_registry_task_schedule_run_now_resource.go b/internal/services/containers/container_registry_task_schedule_run_now_resource.go index 39a5bce845ed..c455bc639567 100644 --- a/internal/services/containers/container_registry_task_schedule_run_now_resource.go +++ b/internal/services/containers/container_registry_task_schedule_run_now_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" diff --git a/internal/services/containers/container_registry_token_data_source.go b/internal/services/containers/container_registry_token_data_source.go index faad60026da5..a8a677b151f9 100644 --- a/internal/services/containers/container_registry_token_data_source.go +++ b/internal/services/containers/container_registry_token_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" diff --git a/internal/services/containers/container_registry_token_password_resource.go b/internal/services/containers/container_registry_token_password_resource.go index 081873aa269d..923085da7feb 100644 --- a/internal/services/containers/container_registry_token_password_resource.go +++ b/internal/services/containers/container_registry_token_password_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/containers/container_registry_token_resource.go b/internal/services/containers/container_registry_token_resource.go index 083b83fbe2d6..748bf843d4e4 100644 --- a/internal/services/containers/container_registry_token_resource.go +++ b/internal/services/containers/container_registry_token_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/containers/container_registry_webhook_resource.go b/internal/services/containers/container_registry_webhook_resource.go index e1ecefef2733..920201600b45 100644 --- a/internal/services/containers/container_registry_webhook_resource.go +++ b/internal/services/containers/container_registry_webhook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/containers/kubernetes_addons.go b/internal/services/containers/kubernetes_addons.go index 8943bb05dfce..6cd10fdd2653 100644 --- a/internal/services/containers/kubernetes_addons.go +++ b/internal/services/containers/kubernetes_addons.go @@ -434,7 +434,6 @@ func flattenKubernetesAddOns(profile map[string]managedclusters.ManagedClusterAd "log_analytics_workspace_id": workspaceID, "oms_agent_identity": omsAgentIdentity, }) - } ingressApplicationGateways := make([]interface{}, 0) diff --git a/internal/services/containers/kubernetes_cluster_data_source.go b/internal/services/containers/kubernetes_cluster_data_source.go index 0e9ade939bf0..88487f654159 100644 --- a/internal/services/containers/kubernetes_cluster_data_source.go +++ b/internal/services/containers/kubernetes_cluster_data_source.go @@ -794,7 +794,6 @@ func dataSourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{} } if adminProfileModel := adminProfile.Model; adminProfileModel != nil { - adminKubeConfigRaw, adminKubeConfig := flattenKubernetesClusterAccessProfile(*adminProfileModel) d.Set("kube_admin_config_raw", adminKubeConfigRaw) if err := d.Set("kube_admin_config", adminKubeConfig); err != nil { @@ -829,11 +828,9 @@ func dataSourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{} } func flattenKubernetesClusterDataSourceStorageProfile(input *managedclusters.ManagedClusterStorageProfile) []interface{} { - storageProfile := make([]interface{}, 0) if input != nil { - blobEnabled := false if input.BlobCSIDriver != nil { blobEnabled = *input.BlobCSIDriver.Enabled @@ -879,7 +876,7 @@ func flattenKubernetesClusterDataSourceAccessProfile(profile managedclusters.Man if kubeConfigRaw := profile.Properties.KubeConfig; kubeConfigRaw != nil { rawConfig := *kubeConfigRaw if base64IsEncoded(*kubeConfigRaw) { - rawConfig, _ = base64Decode(*kubeConfigRaw) + rawConfig = base64Decode(*kubeConfigRaw) } var flattenedKubeConfig []interface{} @@ -1234,7 +1231,6 @@ func flattenKubernetesClusterDataSourceLinuxProfile(input *managedclusters.Conta } } } - } values["ssh_key"] = sshKeys diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index 5c88a407fc64..20f8edef83d2 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -1462,7 +1462,6 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{} // RBAC profile updates need to be handled atomically before any call to createUpdate as a diff there will create a PropertyChangeNotAllowed error if d.HasChange("role_based_access_control_enabled") { - // check if we can determine current EnableRBAC state - don't do anything destructive if we can't be sure if props.EnableRBAC == nil { return fmt.Errorf("updating %s: RBAC Enabled was nil", *id) @@ -2114,7 +2113,6 @@ func resourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{}) // adminProfile is only available for RBAC enabled clusters with AAD and local account is not disabled if props.AadProfile != nil && (props.DisableLocalAccounts == nil || !*props.DisableLocalAccounts) { - accessProfileId := managedclusters.NewAccessProfileID(id.SubscriptionId, id.ResourceGroupName, id.ResourceName, "clusterAdmin") adminProfile, err := client.GetAccessProfile(ctx, accessProfileId) if err != nil { @@ -2198,7 +2196,7 @@ func flattenKubernetesClusterAccessProfile(profile managedclusters.ManagedCluste if kubeConfigRaw := accessProfile.KubeConfig; kubeConfigRaw != nil { rawConfig := *kubeConfigRaw if base64IsEncoded(*kubeConfigRaw) { - rawConfig, _ = base64Decode(*kubeConfigRaw) + rawConfig = base64Decode(*kubeConfigRaw) } var flattenedKubeConfig []interface{} @@ -2326,7 +2324,6 @@ func flattenKubernetesClusterLinuxProfile(profile *managedclusters.ContainerServ "key_data": keyData, }) } - } return []interface{}{ @@ -2386,7 +2383,6 @@ func expandGmsaProfile(input []interface{}) *managedclusters.WindowsGmsaProfile DnsServer: utils.String(config["dns_server"].(string)), RootDomainName: utils.String(config["root_domain"].(string)), } - } func flattenKubernetesClusterWindowsProfile(profile *managedclusters.ManagedClusterWindowsProfile, d *pluginsdk.ResourceData) []interface{} { @@ -3235,7 +3231,6 @@ func flattenKubernetesClusterMaintenanceConfigurationTimeSpans(input *[]maintena var start string if item.Start != nil { start = *item.Start - } results = append(results, map[string]interface{}{ "end": end, @@ -3369,7 +3364,6 @@ func flattenKubernetesClusterMicrosoftDefender(input *managedclusters.ManagedClu } func expandStorageProfile(input []interface{}) *managedclusters.ManagedClusterStorageProfile { - if (input == nil) || len(input) == 0 { return nil } @@ -3414,12 +3408,12 @@ func flattenEdgeZone(input *edgezones.Model) string { return edgezones.NormalizeNilable(&input.Name) } -func base64Decode(str string) (string, bool) { +func base64Decode(str string) string { data, err := base64.StdEncoding.DecodeString(str) if err != nil { - return "", true + return "" } - return string(data), false + return string(data) } func base64IsEncoded(data string) bool { diff --git a/internal/services/containers/migration/registry_webhook_migration_v0_to_v1.go b/internal/services/containers/migration/registry_webhook_migration_v0_to_v1.go index a18b27a0d121..8cb9dd7373b5 100644 --- a/internal/services/containers/migration/registry_webhook_migration_v0_to_v1.go +++ b/internal/services/containers/migration/registry_webhook_migration_v0_to_v1.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/resourcegroups" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" diff --git a/internal/services/containers/parse/repo_notification.go b/internal/services/containers/parse/repo_notification.go index 5155023dfc6b..2e9758303f7b 100644 --- a/internal/services/containers/parse/repo_notification.go +++ b/internal/services/containers/parse/repo_notification.go @@ -57,7 +57,6 @@ func ParseRepositoryNotification(v string) (*RepositoryNotification, error) { Artifact: *artifact, Action: action, }, nil - } func parseArtifact(v string) (*Artifact, error) { diff --git a/internal/services/cosmos/client/client.go b/internal/services/cosmos/client/client.go index 7496eadd0079..12f3bb51732f 100644 --- a/internal/services/cosmos/client/client.go +++ b/internal/services/cosmos/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/managedcassandras" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway" "github.com/hashicorp/terraform-provider-azurerm/internal/common" diff --git a/internal/services/cosmos/common/autoscale_settings.go b/internal/services/cosmos/common/autoscale_settings.go index c8e3644b21bb..bf6f31712702 100644 --- a/internal/services/cosmos/common/autoscale_settings.go +++ b/internal/services/cosmos/common/autoscale_settings.go @@ -3,7 +3,7 @@ package common import ( "log" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/conflict_resolution_policy.go b/internal/services/cosmos/common/conflict_resolution_policy.go index d6fc4f580982..8e1191a4d8d6 100644 --- a/internal/services/cosmos/common/conflict_resolution_policy.go +++ b/internal/services/cosmos/common/conflict_resolution_policy.go @@ -1,7 +1,7 @@ package common import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/cors_rule.go b/internal/services/cosmos/common/cors_rule.go index caba3497c791..af3315cccc54 100644 --- a/internal/services/cosmos/common/cors_rule.go +++ b/internal/services/cosmos/common/cors_rule.go @@ -3,7 +3,7 @@ package common import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cosmos/common/indexing_policy.go b/internal/services/cosmos/common/indexing_policy.go index 3f480bab0fca..4d87afb83118 100644 --- a/internal/services/cosmos/common/indexing_policy.go +++ b/internal/services/cosmos/common/indexing_policy.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cosmos/common/indexing_policy_test.go b/internal/services/cosmos/common/indexing_policy_test.go index 177d2628b3af..b2c740d8062c 100644 --- a/internal/services/cosmos/common/indexing_policy_test.go +++ b/internal/services/cosmos/common/indexing_policy_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/ip_rules.go b/internal/services/cosmos/common/ip_rules.go index 23711182127b..e238091ecf66 100644 --- a/internal/services/cosmos/common/ip_rules.go +++ b/internal/services/cosmos/common/ip_rules.go @@ -3,7 +3,7 @@ package common import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/ip_rules_test.go b/internal/services/cosmos/common/ip_rules_test.go index e7a2268de19d..9e13013f1203 100644 --- a/internal/services/cosmos/common/ip_rules_test.go +++ b/internal/services/cosmos/common/ip_rules_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck ) var ( diff --git a/internal/services/cosmos/common/schema.go b/internal/services/cosmos/common/schema.go index b417cdd7ef3d..532f4a87bc0e 100644 --- a/internal/services/cosmos/common/schema.go +++ b/internal/services/cosmos/common/schema.go @@ -1,7 +1,7 @@ package common import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" @@ -74,7 +74,7 @@ func CassandraTableSchemaPropertySchema() *pluginsdk.Schema { } func DatabaseAutoscaleSettingsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/cosmos/common/throughput.go b/internal/services/cosmos/common/throughput.go index 3d6082fd1545..a07f0e284dd4 100644 --- a/internal/services/cosmos/common/throughput.go +++ b/internal/services/cosmos/common/throughput.go @@ -3,7 +3,7 @@ package common import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/cosmosdb_account_data_source.go b/internal/services/cosmos/cosmosdb_account_data_source.go index c0482f713b04..cc1a9b58da20 100644 --- a/internal/services/cosmos/cosmosdb_account_data_source.go +++ b/internal/services/cosmos/cosmosdb_account_data_source.go @@ -6,7 +6,7 @@ import ( "sort" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_account_data_source_test.go b/internal/services/cosmos/cosmosdb_account_data_source_test.go index 005cc1bf27dc..9cdb1e50c403 100644 --- a/internal/services/cosmos/cosmosdb_account_data_source_test.go +++ b/internal/services/cosmos/cosmosdb_account_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" ) diff --git a/internal/services/cosmos/cosmosdb_account_resource.go b/internal/services/cosmos/cosmosdb_account_resource.go index a4ab65373f8d..2165988e7ba6 100644 --- a/internal/services/cosmos/cosmosdb_account_resource.go +++ b/internal/services/cosmos/cosmosdb_account_resource.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" @@ -1216,7 +1216,6 @@ func resourceCosmosDbAccountApiUpsert(client *documentdb.DatabaseAccountsClient, } status := "Succeeded" if props := resp.DatabaseAccountGetProperties; props != nil { - var locations []documentdb.Location if props.ReadLocations != nil { @@ -1593,7 +1592,6 @@ func expandAccountIdentity(input []interface{}) (*documentdb.ManagedServiceIdent } } return &out, nil - } func flattenAccountIdentity(input *documentdb.ManagedServiceIdentity) (*[]interface{}, error) { diff --git a/internal/services/cosmos/cosmosdb_account_resource_test.go b/internal/services/cosmos/cosmosdb_account_resource_test.go index 9ba80c22aac7..56f7803d749a 100644 --- a/internal/services/cosmos/cosmosdb_account_resource_test.go +++ b/internal/services/cosmos/cosmosdb_account_resource_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" @@ -176,6 +176,7 @@ func TestAccCosmosDBAccount_updateDefaultIdentity(t *testing.T) { }) } +//nolint:unparam func testAccCosmosDBAccount_basicWith(t *testing.T, kind documentdb.DatabaseAccountKind, consistency documentdb.DefaultConsistencyLevel) { data := acceptance.BuildTestData(t, "azurerm_cosmosdb_account", "test") r := CosmosDBAccountResource{} diff --git a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go index e2cc64b701d7..aa69537014ea 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go index 37f30f5e96ab..096f31ab37bf 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go index 4f104beecc36..dd6b2cc3f6ce 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go +++ b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_cassandra_table_resource.go b/internal/services/cosmos/cosmosdb_cassandra_table_resource.go index a6512e8eb18e..f45428032469 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_table_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_gremlin_database_resource.go b/internal/services/cosmos/cosmosdb_gremlin_database_resource.go index 393b9e0d3873..64d896885423 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_database_resource.go +++ b/internal/services/cosmos/cosmosdb_gremlin_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go b/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go index 67f66f39b314..b2de1a94f2be 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go b/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go index c4c3b31291ea..2eb128da97eb 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go +++ b/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_collection_resource.go b/internal/services/cosmos/cosmosdb_mongo_collection_resource.go index c167bb959556..d3f1eff47819 100644 --- a/internal/services/cosmos/cosmosdb_mongo_collection_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_collection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go index e2d9a1bdd9f8..f8ff22635c06 100644 --- a/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_mongo_database_resource.go b/internal/services/cosmos/cosmosdb_mongo_database_resource.go index 57cafb17133f..0f39cf43ffbd 100644 --- a/internal/services/cosmos/cosmosdb_mongo_database_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go index 9023b1884120..f434b723b856 100644 --- a/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go b/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go index 290ced46fd1f..4b4654cf4394 100644 --- a/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go +++ b/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go b/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go index 40158e78fff5..38aded285531 100644 --- a/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go +++ b/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go @@ -60,6 +60,7 @@ func (r CosmosDbNotebookWorkspaceResource) Exists(ctx context.Context, client *c return utils.Bool(true), nil } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -90,6 +91,7 @@ resource "azurerm_cosmosdb_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) basic(data acceptance.TestData) string { template := r.template(data) return fmt.Sprintf(` @@ -103,6 +105,7 @@ resource "azurerm_cosmosdb_notebook_workspace" "test" { `, template) } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) requiresImport(data acceptance.TestData) string { config := r.basic(data) return fmt.Sprintf(` diff --git a/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go b/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go index 2d0277feb898..251d441ea2fa 100644 --- a/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go +++ b/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_container_resource.go b/internal/services/cosmos/cosmosdb_sql_container_resource.go index ffa771e25162..4f6d32353823 100644 --- a/internal/services/cosmos/cosmosdb_sql_container_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_container_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_container_resource_test.go b/internal/services/cosmos/cosmosdb_sql_container_resource_test.go index 3b5aa92fe6b7..8f31918b876e 100644 --- a/internal/services/cosmos/cosmosdb_sql_container_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_container_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_database_resource.go b/internal/services/cosmos/cosmosdb_sql_database_resource.go index 821bb1244e3b..05d6facb543f 100644 --- a/internal/services/cosmos/cosmosdb_sql_database_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_database_resource_test.go b/internal/services/cosmos/cosmosdb_sql_database_resource_test.go index 6174d7f0d300..5eb215d82abf 100644 --- a/internal/services/cosmos/cosmosdb_sql_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_function_resource.go b/internal/services/cosmos/cosmosdb_sql_function_resource.go index 2230cfd267cc..2bdf51e66caa 100644 --- a/internal/services/cosmos/cosmosdb_sql_function_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_function_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_function_resource_test.go b/internal/services/cosmos/cosmosdb_sql_function_resource_test.go index f0add3eb47d2..5131f231a3f5 100644 --- a/internal/services/cosmos/cosmosdb_sql_function_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_function_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go b/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go index e6b4e65609af..f07dc15f5244 100644 --- a/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go b/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go index 68b330af40de..3c9620f885c6 100644 --- a/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go index 5c88f3a47b43..956d22dbd733 100644 --- a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go index 79af9aafd7d6..1b4409aac1a4 100644 --- a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_trigger_resource.go b/internal/services/cosmos/cosmosdb_sql_trigger_resource.go index 2e65ec7a4560..de66ec5e3292 100644 --- a/internal/services/cosmos/cosmosdb_sql_trigger_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_trigger_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go b/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go index 03aafe7fb2aa..3e0c4ad27952 100644 --- a/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_table_resource.go b/internal/services/cosmos/cosmosdb_table_resource.go index 1530ef920dee..8b5bc5a893c4 100644 --- a/internal/services/cosmos/cosmosdb_table_resource.go +++ b/internal/services/cosmos/cosmosdb_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_table_resource_test.go b/internal/services/cosmos/cosmosdb_table_resource_test.go index 1599149fc7fd..1708faa04cc0 100644 --- a/internal/services/cosmos/cosmosdb_table_resource_test.go +++ b/internal/services/cosmos/cosmosdb_table_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/customproviders/custom_provider_resource.go b/internal/services/customproviders/custom_provider_resource.go index 5a481b582fcc..2406fd8900f3 100644 --- a/internal/services/customproviders/custom_provider_resource.go +++ b/internal/services/customproviders/custom_provider_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/customproviders/mgmt/2018-09-01-preview/customproviders" + "github.com/Azure/azure-sdk-for-go/services/preview/customproviders/mgmt/2018-09-01-preview/customproviders" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/dashboard/client/client.go b/internal/services/dashboard/client/client.go index e6ade515621c..98c11333f2f7 100644 --- a/internal/services/dashboard/client/client.go +++ b/internal/services/dashboard/client/client.go @@ -10,7 +10,6 @@ type Client struct { } func NewClient(o *common.ClientOptions) *Client { - grafanaResourceClient := grafanaresource.NewGrafanaResourceClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&grafanaResourceClient.Client, o.ResourceManagerAuthorizer) diff --git a/internal/services/dashboard/dashboard_grafana_resource.go b/internal/services/dashboard/dashboard_grafana_resource.go index dc3f8ab9dbeb..592acceab246 100644 --- a/internal/services/dashboard/dashboard_grafana_resource.go +++ b/internal/services/dashboard/dashboard_grafana_resource.go @@ -158,10 +158,7 @@ func (r DashboardGrafanaResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - identityValue, err := expandLegacySystemAndUserAssignedMap(metadata.ResourceData.Get("identity").([]interface{})) - if err != nil { - return fmt.Errorf("expanding `identity`: %+v", err) - } + identityValue := expandLegacySystemAndUserAssignedMap(metadata.ResourceData.Get("identity").([]interface{})) apiKey := grafanaresource.ApiKeyDisabled if model.ApiKeyEnabled { @@ -312,10 +309,7 @@ func (r DashboardGrafanaResource) Read() sdk.ResourceFunc { Location: location.NormalizeNilable(model.Location), } - identityValue, err := flattenLegacySystemAndUserAssignedMap(model.Identity) - if err != nil { - return fmt.Errorf("flattening `identity`: %+v", err) - } + identityValue := flattenLegacySystemAndUserAssignedMap(model.Identity) if err := metadata.ResourceData.Set("identity", identityValue); err != nil { return fmt.Errorf("setting `identity`: %+v", err) @@ -404,20 +398,20 @@ func (r DashboardGrafanaResource) Delete() sdk.ResourceFunc { } } -func expandLegacySystemAndUserAssignedMap(input []interface{}) (*identity.LegacySystemAndUserAssignedMap, error) { +func expandLegacySystemAndUserAssignedMap(input []interface{}) *identity.LegacySystemAndUserAssignedMap { identityValue, err := identity.ExpandSystemAssigned(input) if err != nil { - return nil, err + return nil } return &identity.LegacySystemAndUserAssignedMap{ Type: identityValue.Type, - }, nil + } } -func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAssignedMap) (*[]interface{}, error) { +func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAssignedMap) *[]interface{} { if input == nil { - return &[]interface{}{}, nil + return &[]interface{}{} } identityValue := &identity.SystemAssigned{ @@ -427,5 +421,5 @@ func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAs } output := identity.FlattenSystemAssigned(identityValue) - return &output, nil + return &output } diff --git a/internal/services/databasemigration/client/client.go b/internal/services/databasemigration/client/client.go index 73f08a1f42f2..c6cc84cc4c2b 100644 --- a/internal/services/databasemigration/client/client.go +++ b/internal/services/databasemigration/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/databasemigration/database_migration_project_resource.go b/internal/services/databasemigration/database_migration_project_resource.go index f3feb2148c4e..5c867b78243f 100644 --- a/internal/services/databasemigration/database_migration_project_resource.go +++ b/internal/services/databasemigration/database_migration_project_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/databasemigration/database_migration_service_resource.go b/internal/services/databasemigration/database_migration_service_resource.go index 79e344ce8f6b..dbcdcdc71ae7 100644 --- a/internal/services/databasemigration/database_migration_service_resource.go +++ b/internal/services/databasemigration/database_migration_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/databoxedge/client/client.go b/internal/services/databoxedge/client/client.go index 110ca6f49a9a..a4c5018a2b5b 100644 --- a/internal/services/databoxedge/client/client.go +++ b/internal/services/databoxedge/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/databoxedge/databox_edge_device_resource.go b/internal/services/databoxedge/databox_edge_device_resource.go index 78c045fcebe4..2c2d200518b4 100644 --- a/internal/services/databoxedge/databox_edge_device_resource.go +++ b/internal/services/databoxedge/databox_edge_device_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/databoxedge/databox_edge_order_resource.go b/internal/services/databoxedge/databox_edge_order_resource.go index f308b8b2eb70..c76c5dd4413f 100644 --- a/internal/services/databoxedge/databox_edge_order_resource.go +++ b/internal/services/databoxedge/databox_edge_order_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/databoxedge/parse/databox_edge_device_sku.go b/internal/services/databoxedge/parse/databox_edge_device_sku.go index f264b65fef2d..7c0d1bd1417b 100644 --- a/internal/services/databoxedge/parse/databox_edge_device_sku.go +++ b/internal/services/databoxedge/parse/databox_edge_device_sku.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck ) // DataboxEdgeDeviceSku type diff --git a/internal/services/databoxedge/validate/databox_edge_device_sku_name.go b/internal/services/databoxedge/validate/databox_edge_device_sku_name.go index 774f6f6c0e1a..def67601b364 100644 --- a/internal/services/databoxedge/validate/databox_edge_device_sku_name.go +++ b/internal/services/databoxedge/validate/databox_edge_device_sku_name.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" ) diff --git a/internal/services/databricks/databricks_access_connector_resource.go b/internal/services/databricks/databricks_access_connector_resource.go index 7973430c0606..699f84294c48 100644 --- a/internal/services/databricks/databricks_access_connector_resource.go +++ b/internal/services/databricks/databricks_access_connector_resource.go @@ -67,7 +67,6 @@ func (r AccessConnectorResource) IDValidationFunc() pluginsdk.SchemaValidateFunc func (r AccessConnectorResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - var model AccessConnectorResourceModel if err := metadata.Decode(&model); err != nil { return fmt.Errorf("decoding %+v", err) diff --git a/internal/services/databricks/validate/access_connector_name_test.go b/internal/services/databricks/validate/access_connector_name_test.go index 21aa09333c24..f9397b704305 100644 --- a/internal/services/databricks/validate/access_connector_name_test.go +++ b/internal/services/databricks/validate/access_connector_name_test.go @@ -7,7 +7,6 @@ import ( func TestAccessConnectorName(t *testing.T) { const errEmpty = "cannot be an empty string" - const errMinLen = "must be at least 1 character" const errMaxLen = "must be no more than 30 characters" const errAllowList = "can contain only alphanumeric characters, underscores, and hyphens" diff --git a/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go b/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go index 3a23f622fa08..ef403f71b2ed 100644 --- a/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go +++ b/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/validate" diff --git a/internal/services/datadog/client/client.go b/internal/services/datadog/client/client.go index c76348862ede..9e804afd17a7 100644 --- a/internal/services/datadog/client/client.go +++ b/internal/services/datadog/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datadog/datadog_monitor_tag_rule_resource.go b/internal/services/datadog/datadog_monitor_tag_rule_resource.go index 205b39519d92..c8bc5238d7f6 100644 --- a/internal/services/datadog/datadog_monitor_tag_rule_resource.go +++ b/internal/services/datadog/datadog_monitor_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/validate" @@ -266,7 +266,6 @@ func expandMetricRules(input []interface{}) *datadog.MetricRules { } func expandFilteringTag(input []interface{}) *[]datadog.FilteringTag { - filteringTags := make([]datadog.FilteringTag, 0) for _, v := range input { @@ -309,7 +308,6 @@ func flattenLogRules(input *datadog.LogRules) []interface{} { result["filter"] = flattenFilteringTags(input.FilteringTags) return append(results, result) - } func flattenMetricRules(input *datadog.MetricRules) []interface{} { diff --git a/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go b/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go index fdbaff062fa2..7858b95fe7a6 100644 --- a/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go +++ b/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go @@ -77,7 +77,7 @@ func (r TagRulesDatadogMonitorResource) Exists(ctx context.Context, client *clie return nil, fmt.Errorf("retrieving Datadog Monitor %q (Resource Group %q): %+v", id.MonitorName, id.ResourceGroup, err) } - if (*resp.Properties.LogRules.SendResourceLogs == false && *resp.Properties.LogRules.SendSubscriptionLogs == false) || *resp.Properties.MetricRules.FilteringTags == nil { + if (!*resp.Properties.LogRules.SendResourceLogs && !*resp.Properties.LogRules.SendSubscriptionLogs) || *resp.Properties.MetricRules.FilteringTags == nil { return utils.Bool(false), nil } diff --git a/internal/services/datadog/datadog_monitors_resource.go b/internal/services/datadog/datadog_monitors_resource.go index 219e80ba19c5..954cd750d7ec 100644 --- a/internal/services/datadog/datadog_monitors_resource.go +++ b/internal/services/datadog/datadog_monitors_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -390,7 +390,6 @@ func flattenMonitorIdentityProperties(input *datadog.IdentityProperties) []inter } func flattenMonitorOrganizationProperties(input *datadog.OrganizationProperties, d *pluginsdk.ResourceData) []interface{} { - organisationProperties := d.Get("datadog_organization").([]interface{}) if len(organisationProperties) == 0 { return make([]interface{}, 0) diff --git a/internal/services/datafactory/client/client.go b/internal/services/datafactory/client/client.go index 5393bff79223..3d3e01abe1a6 100644 --- a/internal/services/datafactory/client/client.go +++ b/internal/services/datafactory/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datafactory/data_factory.go b/internal/services/datafactory/data_factory.go index a6896932adbb..4a441c6a8955 100644 --- a/internal/services/datafactory/data_factory.go +++ b/internal/services/datafactory/data_factory.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/datafactory/data_factory_custom_dataset_resource.go b/internal/services/datafactory/data_factory_custom_dataset_resource.go index 5f3a3040da36..743d3d00af08 100644 --- a/internal/services/datafactory/data_factory_custom_dataset_resource.go +++ b/internal/services/datafactory/data_factory_custom_dataset_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_data_flow.go b/internal/services/datafactory/data_factory_data_flow.go index f1fcd78ecc5d..ade700d54b9c 100644 --- a/internal/services/datafactory/data_factory_data_flow.go +++ b/internal/services/datafactory/data_factory_data_flow.go @@ -1,7 +1,7 @@ package datafactory import ( - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/datafactory/data_factory_data_flow_resource.go b/internal/services/datafactory/data_factory_data_flow_resource.go index b3ffac5500da..0f79b6bc1763 100644 --- a/internal/services/datafactory/data_factory_data_flow_resource.go +++ b/internal/services/datafactory/data_factory_data_flow_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_data_source.go b/internal/services/datafactory/data_factory_data_source.go index abfd651ed9b5..133fc99507dc 100644 --- a/internal/services/datafactory/data_factory_data_source.go +++ b/internal/services/datafactory/data_factory_data_source.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go b/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go index 127dd4db772b..407409108cb7 100644 --- a/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go +++ b/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_binary_resource.go b/internal/services/datafactory/data_factory_dataset_binary_resource.go index f888d708ad0f..e02d39abb05e 100644 --- a/internal/services/datafactory/data_factory_dataset_binary_resource.go +++ b/internal/services/datafactory/data_factory_dataset_binary_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go b/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go index 9723592805bf..f49911486113 100644 --- a/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go +++ b/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go b/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go index fa934ffe0a7f..98491a2c4af1 100644 --- a/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go +++ b/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_http_resource.go b/internal/services/datafactory/data_factory_dataset_http_resource.go index 623184f2dc92..f3a8bccc823c 100644 --- a/internal/services/datafactory/data_factory_dataset_http_resource.go +++ b/internal/services/datafactory/data_factory_dataset_http_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_json_resource.go b/internal/services/datafactory/data_factory_dataset_json_resource.go index a03a4c2994a2..336997da29a3 100644 --- a/internal/services/datafactory/data_factory_dataset_json_resource.go +++ b/internal/services/datafactory/data_factory_dataset_json_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_mysql_resource.go b/internal/services/datafactory/data_factory_dataset_mysql_resource.go index 5e55890dc9be..5ec403827432 100644 --- a/internal/services/datafactory/data_factory_dataset_mysql_resource.go +++ b/internal/services/datafactory/data_factory_dataset_mysql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_parquet_resource.go b/internal/services/datafactory/data_factory_dataset_parquet_resource.go index cb736b146366..561166121e88 100644 --- a/internal/services/datafactory/data_factory_dataset_parquet_resource.go +++ b/internal/services/datafactory/data_factory_dataset_parquet_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_postgresql_resource.go b/internal/services/datafactory/data_factory_dataset_postgresql_resource.go index f83d5ac2d0c8..e02fcf7b5b38 100644 --- a/internal/services/datafactory/data_factory_dataset_postgresql_resource.go +++ b/internal/services/datafactory/data_factory_dataset_postgresql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_snowflake_resource.go b/internal/services/datafactory/data_factory_dataset_snowflake_resource.go index 3641c876e916..78ca07ee227a 100644 --- a/internal/services/datafactory/data_factory_dataset_snowflake_resource.go +++ b/internal/services/datafactory/data_factory_dataset_snowflake_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go b/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go index 3389e48adf59..b5a7424c3768 100644 --- a/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go +++ b/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go b/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go index 1c53b51cd1f7..647ed15b7155 100644 --- a/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go +++ b/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go index bf2d474974ce..0c62203398ce 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go index c26e3b6d8a1e..0f50c85f1c24 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go index 07fea91f0f91..4512dcb968f5 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go b/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go index 77c8321818e9..a0eada77288b 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_custom_service_resource.go b/internal/services/datafactory/data_factory_linked_custom_service_resource.go index 94ce24e3ead6..a3a6c1f61dbb 100644 --- a/internal/services/datafactory/data_factory_linked_custom_service_resource.go +++ b/internal/services/datafactory/data_factory_linked_custom_service_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service.go b/internal/services/datafactory/data_factory_linked_service.go index 07bdc89498b1..3eba246b744b 100644 --- a/internal/services/datafactory/data_factory_linked_service.go +++ b/internal/services/datafactory/data_factory_linked_service.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go index 389c7cc5cf68..b3d7423bb15e 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" @@ -263,7 +263,6 @@ func resourceDataFactoryLinkedServiceBlobStorageCreateUpdate(d *pluginsdk.Resour blobStorageProperties.ServicePrincipalID = utils.String(d.Get("service_principal_id").(string)) blobStorageProperties.Tenant = utils.String(d.Get("tenant_id").(string)) - } blobStorageLinkedService := &datafactory.AzureBlobStorageLinkedService{ diff --git a/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go index a9ee2f2cd396..b1e0326aae3b 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2022-04-01-preview/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go index 25523496664a..ac9614798915 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go index c6fb87a13478..20a9ecfb7ccc 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go index 421ad9af8f5d..815869b3c06b 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go index 4226caad2bb6..478cbd51657d 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go index 0f6bc00bd3dc..ef52f1ec4ded 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go b/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go index 859f5e823044..52706a19da06 100644 --- a/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go b/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go index b9cde424bace..67e1ff36d254 100644 --- a/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go b/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go index b32884c74667..ffc83aa63453 100644 --- a/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go b/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go index 4092c47fc7a5..1e6e47dd2b0b 100644 --- a/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_linked_service_kusto_resource.go b/internal/services/datafactory/data_factory_linked_service_kusto_resource.go index b9379bc6f363..ec1014cdee82 100644 --- a/internal/services/datafactory/data_factory_linked_service_kusto_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_kusto_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_mysql_resource.go b/internal/services/datafactory/data_factory_linked_service_mysql_resource.go index 808cc252bba1..cded8a80b30a 100644 --- a/internal/services/datafactory/data_factory_linked_service_mysql_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_mysql_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_odata_resource.go b/internal/services/datafactory/data_factory_linked_service_odata_resource.go index 7212bd91a955..e14e9e2d00b0 100644 --- a/internal/services/datafactory/data_factory_linked_service_odata_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_odata_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_odbc_resource.go b/internal/services/datafactory/data_factory_linked_service_odbc_resource.go index f9e73a671e87..5a8808800e47 100644 --- a/internal/services/datafactory/data_factory_linked_service_odbc_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_odbc_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go b/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go index 6d51dd6ba4e8..196128654609 100644 --- a/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_sftp_resource.go b/internal/services/datafactory/data_factory_linked_service_sftp_resource.go index 01d40ff74fdd..ad32a189bd15 100644 --- a/internal/services/datafactory/data_factory_linked_service_sftp_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_sftp_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go b/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go index 93e815f337b6..bdee05afe87c 100644 --- a/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go b/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go index 53fff388f185..e2ea8df78460 100644 --- a/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_synapse_resource.go b/internal/services/datafactory/data_factory_linked_service_synapse_resource.go index 398d04515d25..ee620500a5bb 100644 --- a/internal/services/datafactory/data_factory_linked_service_synapse_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_synapse_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_web_resource.go b/internal/services/datafactory/data_factory_linked_service_web_resource.go index 5562eee51d27..ac6f5133bf34 100644 --- a/internal/services/datafactory/data_factory_linked_service_web_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_web_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go b/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go index 62f14b352784..23cc308d03b0 100644 --- a/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go +++ b/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_pipeline_resource.go b/internal/services/datafactory/data_factory_pipeline_resource.go index e029656f77f0..3b6e37a47da0 100644 --- a/internal/services/datafactory/data_factory_pipeline_resource.go +++ b/internal/services/datafactory/data_factory_pipeline_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_resource.go b/internal/services/datafactory/data_factory_resource.go index 50781c02c6e8..c9ee800b66c9 100644 --- a/internal/services/datafactory/data_factory_resource.go +++ b/internal/services/datafactory/data_factory_resource.go @@ -7,7 +7,7 @@ import ( "reflect" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/datafactory/data_factory_trigger_blob_event_resource.go b/internal/services/datafactory/data_factory_trigger_blob_event_resource.go index b515e6167eae..ad9a59ef8950 100644 --- a/internal/services/datafactory/data_factory_trigger_blob_event_resource.go +++ b/internal/services/datafactory/data_factory_trigger_blob_event_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_trigger_custom_event_resource.go b/internal/services/datafactory/data_factory_trigger_custom_event_resource.go index a6fed0f44642..b618c43a95be 100644 --- a/internal/services/datafactory/data_factory_trigger_custom_event_resource.go +++ b/internal/services/datafactory/data_factory_trigger_custom_event_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_trigger_schedule_resource.go b/internal/services/datafactory/data_factory_trigger_schedule_resource.go index 9732289e34ed..73f3b740f5a3 100644 --- a/internal/services/datafactory/data_factory_trigger_schedule_resource.go +++ b/internal/services/datafactory/data_factory_trigger_schedule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go b/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go index 4241b70b7834..d7e5a2ca6bb3 100644 --- a/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go +++ b/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/migration/data_factory.go b/internal/services/datafactory/migration/data_factory.go index 5c22d14b8950..6f0bd8c73081 100644 --- a/internal/services/datafactory/migration/data_factory.go +++ b/internal/services/datafactory/migration/data_factory.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) diff --git a/internal/services/dataprotection/data_protection_backup_instance_blob_storage_resource.go b/internal/services/dataprotection/data_protection_backup_instance_blob_storage_resource.go index 8758022a3ff2..809acc69cb80 100644 --- a/internal/services/dataprotection/data_protection_backup_instance_blob_storage_resource.go +++ b/internal/services/dataprotection/data_protection_backup_instance_blob_storage_resource.go @@ -165,7 +165,6 @@ func resourceDataProtectionBackupInstanceBlobStorageRead(d *schema.ResourceData, d.Set("vault_id", vaultId.ID()) if model := resp.Model; model != nil { if props := model.Properties; props != nil { - d.Set("storage_account_id", props.DataSourceInfo.ResourceID) d.Set("location", props.DataSourceInfo.ResourceLocation) d.Set("backup_policy_id", props.PolicyInfo.PolicyId) diff --git a/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go b/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go index 6e12c1a01146..1c4ae5003f36 100644 --- a/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go +++ b/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go @@ -551,9 +551,7 @@ func flattenBackupPolicyPostgreSQLBackupCriteriaArray(input *[]backuppolicies.Ba var scheduleTimes []string if criteria.ScheduleTimes != nil { scheduleTimes = make([]string, 0) - for _, item := range *criteria.ScheduleTimes { - scheduleTimes = append(scheduleTimes, item) - } + scheduleTimes = append(scheduleTimes, *criteria.ScheduleTimes...) } results = append(results, map[string]interface{}{ diff --git a/internal/services/datashare/client/client.go b/internal/services/datashare/client/client.go index 03a82968168d..d26ff118d02c 100644 --- a/internal/services/datashare/client/client.go +++ b/internal/services/datashare/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datashare/data_share_account_resource.go b/internal/services/datashare/data_share_account_resource.go index e1b6c82daa5b..1949b5e83d91 100644 --- a/internal/services/datashare/data_share_account_resource.go +++ b/internal/services/datashare/data_share_account_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/datashare/data_share_data_source.go b/internal/services/datashare/data_share_data_source.go index f61fac67049f..7fda3102c6c3 100644 --- a/internal/services/datashare/data_share_data_source.go +++ b/internal/services/datashare/data_share_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/validate" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_data_source.go b/internal/services/datashare/data_share_dataset_blob_storage_data_source.go index 4e897b94af10..317c89a56bbe 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_data_source.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_resource.go b/internal/services/datashare/data_share_dataset_blob_storage_resource.go index 211463c65c10..6865229baee8 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_resource.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go b/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go index dcd628f365be..5931a0c8a952 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go index 6f3d7e091da6..914433647b69 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go index 2afedc816212..eac49b3929b4 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go index 1681a0914ce1..14db893afb43 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go b/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go index 4c7b9c19111f..dec41556b965 100644 --- a/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go +++ b/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_kusto_database_resource.go b/internal/services/datashare/data_share_dataset_kusto_database_resource.go index 4492d42c906d..5083e0e214dd 100644 --- a/internal/services/datashare/data_share_dataset_kusto_database_resource.go +++ b/internal/services/datashare/data_share_dataset_kusto_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_resource.go b/internal/services/datashare/data_share_resource.go index 2f3825a68605..cd0899d8ef37 100644 --- a/internal/services/datashare/data_share_resource.go +++ b/internal/services/datashare/data_share_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/helper/data_share.go b/internal/services/datashare/helper/data_share.go index 6d56a0748a8f..944944ef24e5 100644 --- a/internal/services/datashare/helper/data_share.go +++ b/internal/services/datashare/helper/data_share.go @@ -1,7 +1,7 @@ package helper import ( - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck ) func GetAzurermDataShareDataSetId(dataset datashare.BasicDataSet) *string { diff --git a/internal/services/desktopvirtualization/virtual_desktop_host_pool_resource.go b/internal/services/desktopvirtualization/virtual_desktop_host_pool_resource.go index 1a96c9f73082..5a3f88938c9d 100644 --- a/internal/services/desktopvirtualization/virtual_desktop_host_pool_resource.go +++ b/internal/services/desktopvirtualization/virtual_desktop_host_pool_resource.go @@ -298,7 +298,6 @@ func resourceVirtualDesktopHostPoolUpdate(d *pluginsdk.ResourceData, meta interf if d.HasChanges("scheduled_agent_updates") { payload.Properties.AgentUpdate = expandAgentUpdatePatch(d.Get("scheduled_agent_updates").([]interface{})) } - } if _, err := client.Update(ctx, *id, payload); err != nil { @@ -359,7 +358,6 @@ func resourceVirtualDesktopHostPoolRead(d *pluginsdk.ResourceData, meta interfac d.Set("type", string(props.HostPoolType)) d.Set("validate_environment", props.ValidationEnvironment) d.Set("scheduled_agent_updates", flattenAgentUpdate(props.AgentUpdate)) - } return nil @@ -463,11 +461,9 @@ func expandAgentUpdatePatch(input []interface{}) *hostpool.AgentUpdatePatchPrope if raw["enabled"].(bool) { props.Type = &updatesScheduled props.MaintenanceWindows = expandAgentUpdateSchedulePatch(raw["schedule"].([]interface{})) - } else { props.Type = &updatesDefault props.MaintenanceWindows = &[]hostpool.MaintenanceWindowPatchProperties{} - } return &props @@ -527,7 +523,6 @@ func flattenAgentUpdate(input *hostpool.AgentUpdateProperties) []interface{} { } enabled := false if input.Type != nil { - if *input.Type == hostpool.SessionHostComponentUpdateTypeScheduled { enabled = true } @@ -541,5 +536,4 @@ func flattenAgentUpdate(input *hostpool.AgentUpdateProperties) []interface{} { "schedule": flattenAgentUpdateSchedule(input.MaintenanceWindows), }, } - } diff --git a/internal/services/devtestlabs/client/client.go b/internal/services/devtestlabs/client/client.go index 8b0dd55dca1c..e4e1398592f8 100644 --- a/internal/services/devtestlabs/client/client.go +++ b/internal/services/devtestlabs/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go index 9d3db0437c7a..58ab7b0bac15 100644 --- a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_lab_resource.go b/internal/services/devtestlabs/dev_test_lab_resource.go index e71c55e8fcd6..e8fd8d2d65d7 100644 --- a/internal/services/devtestlabs/dev_test_lab_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go index 646a074cf511..8f08d13ec11b 100644 --- a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go index 2d89d3aae7d3..d42d5ee3d40a 100644 --- a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_policy_resource.go b/internal/services/devtestlabs/dev_test_policy_resource.go index 62ae309a7b03..000788c6151d 100644 --- a/internal/services/devtestlabs/dev_test_policy_resource.go +++ b/internal/services/devtestlabs/dev_test_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go index cb5fb01f4852..e7cd6d36a661 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/parse" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_resource.go b/internal/services/devtestlabs/dev_test_virtual_network_resource.go index b24349967ae5..044064594beb 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_resource.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go index ef001118ba5f..d334b6a2e645 100644 --- a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/helpers.go b/internal/services/devtestlabs/helpers.go index 938dde67444a..bfaf762a50bd 100644 --- a/internal/services/devtestlabs/helpers.go +++ b/internal/services/devtestlabs/helpers.go @@ -1,7 +1,7 @@ package devtestlabs import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/devtestlabs/validate/devtest.go b/internal/services/devtestlabs/validate/devtest.go index 3f54d0d7e3f9..bdbe07574532 100644 --- a/internal/services/devtestlabs/validate/devtest.go +++ b/internal/services/devtestlabs/validate/devtest.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) diff --git a/internal/services/digitaltwins/client/client.go b/internal/services/digitaltwins/client/client.go index 1c1df4f9889e..2d16220c2a09 100644 --- a/internal/services/digitaltwins/client/client.go +++ b/internal/services/digitaltwins/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/digitaltwins/2022-10-31/timeseriesdatabaseconnections" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go index 122b582166b1..c605f85a158a 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go index 1ab6bbe39388..07442696a000 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go index 65b73dc57672..a870e169a3e7 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_instance_resource.go b/internal/services/digitaltwins/digital_twins_instance_resource.go index d2c1fd353268..0a215f3753ba 100644 --- a/internal/services/digitaltwins/digital_twins_instance_resource.go +++ b/internal/services/digitaltwins/digital_twins_instance_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/dns/dns_a_record_resource.go b/internal/services/dns/dns_a_record_resource.go index a68ce53891d0..72ddfd9330bd 100644 --- a/internal/services/dns/dns_a_record_resource.go +++ b/internal/services/dns/dns_a_record_resource.go @@ -192,7 +192,6 @@ func resourceDnsARecordRead(d *pluginsdk.ResourceData, meta interface{}) error { return err } } - } return nil diff --git a/internal/services/dns/dns_soa_record_data_source.go b/internal/services/dns/dns_soa_record_data_source.go index 119408e67a5d..01b02ad9e4e3 100644 --- a/internal/services/dns/dns_soa_record_data_source.go +++ b/internal/services/dns/dns_soa_record_data_source.go @@ -122,7 +122,6 @@ func dataSourceDnsSoaRecordRead(d *pluginsdk.ResourceData, meta interface{}) err return tags.FlattenAndSet(d, props.Metadata) } - } return nil diff --git a/internal/services/dns/dns_txt_record_data_source.go b/internal/services/dns/dns_txt_record_data_source.go index 1168e6e66af5..bd86d84c040a 100644 --- a/internal/services/dns/dns_txt_record_data_source.go +++ b/internal/services/dns/dns_txt_record_data_source.go @@ -94,7 +94,6 @@ func dataSourceDnsTxtRecordRead(d *pluginsdk.ResourceData, meta interface{}) err } return tags.FlattenAndSet(d, props.Metadata) - } } diff --git a/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go b/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go index 629d2571ff2d..b4c7533e7bc0 100644 --- a/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go +++ b/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go @@ -179,7 +179,7 @@ resource "azurerm_active_directory_domain_service_trust" "import" { `, template) } -func (r DomainServiceTrustResource) template(data acceptance.TestData) string { +func (r DomainServiceTrustResource) template(_ acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} diff --git a/internal/services/eventgrid/client/client.go b/internal/services/eventgrid/client/client.go index 5a61a0925b22..870be86261f2 100644 --- a/internal/services/eventgrid/client/client.go +++ b/internal/services/eventgrid/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/eventgrid/event_subscription.go b/internal/services/eventgrid/event_subscription.go index b983353cc732..77519c520036 100644 --- a/internal/services/eventgrid/event_subscription.go +++ b/internal/services/eventgrid/event_subscription.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/eventgrid/eventgrid.go b/internal/services/eventgrid/eventgrid.go index 0eb4997b0983..506ae445a6c3 100644 --- a/internal/services/eventgrid/eventgrid.go +++ b/internal/services/eventgrid/eventgrid.go @@ -1,7 +1,7 @@ package eventgrid import ( - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/eventgrid/eventgrid_domain_resource.go b/internal/services/eventgrid/eventgrid_domain_resource.go index 58fae37c8b16..563ddbbc5fff 100644 --- a/internal/services/eventgrid/eventgrid_domain_resource.go +++ b/internal/services/eventgrid/eventgrid_domain_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -70,7 +70,7 @@ func resourceEventGridDomain() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_fields": { Type: pluginsdk.TypeList, Optional: true, @@ -112,7 +112,7 @@ func resourceEventGridDomain() *pluginsdk.Resource { }, }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_default_values": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/eventgrid/eventgrid_event_subscription_resource.go b/internal/services/eventgrid/eventgrid_event_subscription_resource.go index 042ade0b0d84..de7172310676 100644 --- a/internal/services/eventgrid/eventgrid_event_subscription_resource.go +++ b/internal/services/eventgrid/eventgrid_event_subscription_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventgrid/parse" diff --git a/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go b/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go index 365b3d9b6bd4..dedce68d318a 100644 --- a/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go +++ b/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -304,7 +304,6 @@ func resourceEventGridSystemTopicEventSubscriptionRead(d *pluginsdk.ResourceData return fmt.Errorf("setting `%q` for EventGrid SystemTopic delivery properties %q: %s", "hybrid_connection_endpoint", id.EventSubscriptionName, err) } } - } if serviceBusQueueEndpoint, ok := destination.AsServiceBusQueueEventSubscriptionDestination(); ok { if err := d.Set("service_bus_queue_endpoint_id", serviceBusQueueEndpoint.ResourceID); err != nil { diff --git a/internal/services/eventgrid/eventgrid_system_topic_resource.go b/internal/services/eventgrid/eventgrid_system_topic_resource.go index 85b963e90b6e..3b1e091d8fff 100644 --- a/internal/services/eventgrid/eventgrid_system_topic_resource.go +++ b/internal/services/eventgrid/eventgrid_system_topic_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/eventgrid/eventgrid_topic_resource.go b/internal/services/eventgrid/eventgrid_topic_resource.go index fbbe8aaf8372..e9015bccf8ce 100644 --- a/internal/services/eventgrid/eventgrid_topic_resource.go +++ b/internal/services/eventgrid/eventgrid_topic_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -70,7 +70,7 @@ func resourceEventGridTopic() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_fields": { Type: pluginsdk.TypeList, Optional: true, @@ -112,7 +112,7 @@ func resourceEventGridTopic() *pluginsdk.Resource { }, }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_default_values": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/eventhub/migration/eventhub_authorization_rule.go b/internal/services/eventhub/migration/eventhub_authorization_rule.go index 52529b323223..9c8c1f344ab5 100644 --- a/internal/services/eventhub/migration/eventhub_authorization_rule.go +++ b/internal/services/eventhub/migration/eventhub_authorization_rule.go @@ -43,7 +43,6 @@ func (EventHubAuthorizationRuleV0ToV1) Schema() map[string]*pluginsdk.Schema { func (EventHubAuthorizationRuleV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { - oldID := rawState["id"].(string) newID, err := eventhubs.ParseEventhubAuthorizationRuleIDInsensitively(oldID) diff --git a/internal/services/frontdoor/frontdoor_resource_test.go b/internal/services/frontdoor/frontdoor_resource_test.go index ef36a3a503dd..bd6d6f4e6530 100644 --- a/internal/services/frontdoor/frontdoor_resource_test.go +++ b/internal/services/frontdoor/frontdoor_resource_test.go @@ -342,74 +342,6 @@ resource "azurerm_frontdoor" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } -// remove in 3.0 -func (FrontDoorResource) global(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-frontdoor-%[1]d" - location = "%[2]s" -} - -locals { - backend_name = "backend-bing" - endpoint_name = "frontend-endpoint" - health_probe_name = "health-probe" - load_balancing_name = "load-balancing-setting" -} - -resource "azurerm_frontdoor" "test" { - name = "acctest-FD-%[1]d" - resource_group_name = azurerm_resource_group.test.name - location = "%[2]s" - - backend_pool_settings { - enforce_backend_pools_certificate_name_check = false - } - - routing_rule { - name = "routing-rule" - accepted_protocols = ["Http", "Https"] - patterns_to_match = ["/*"] - frontend_endpoints = [local.endpoint_name] - forwarding_configuration { - forwarding_protocol = "MatchRequest" - backend_pool_name = local.backend_name - } - } - - backend_pool_load_balancing { - name = local.load_balancing_name - } - - backend_pool_health_probe { - name = local.health_probe_name - } - - backend_pool { - name = local.backend_name - backend { - host_header = "www.bing.com" - address = "www.bing.com" - http_port = 80 - https_port = 443 - } - - load_balancing_name = local.load_balancing_name - health_probe_name = local.health_probe_name - } - - frontend_endpoint { - name = local.endpoint_name - host_name = "acctest-FD-%[1]d.azurefd.net" - } -} -`, data.RandomInteger, data.Locations.Primary) -} - func (r FrontDoorResource) requiresImport(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/frontdoor/sdk/2020-04-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go b/internal/services/frontdoor/sdk/2020-04-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go index 9739f429deb2..46c40b46981e 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go @@ -71,7 +71,6 @@ func TestParseSubscriptionID(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } @@ -139,7 +138,6 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontdoor_test.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontdoor_test.go index abf0dabf6ee6..7bdc4e966d6b 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontdoor_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontdoor_test.go @@ -119,7 +119,6 @@ func TestParseFrontDoorID(t *testing.T) { if actual.FrontDoorName != v.Expected.FrontDoorName { t.Fatalf("Expected %q but got %q for FrontDoorName", v.Expected.FrontDoorName, actual.FrontDoorName) } - } } @@ -259,7 +258,6 @@ func TestParseFrontDoorIDInsensitively(t *testing.T) { if actual.FrontDoorName != v.Expected.FrontDoorName { t.Fatalf("Expected %q but got %q for FrontDoorName", v.Expected.FrontDoorName, actual.FrontDoorName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontendendpoint_test.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontendendpoint_test.go index 0d3a4a8554b1..ffd46a567834 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontendendpoint_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_frontendendpoint_test.go @@ -138,7 +138,6 @@ func TestParseFrontendEndpointID(t *testing.T) { if actual.FrontendEndpointName != v.Expected.FrontendEndpointName { t.Fatalf("Expected %q but got %q for FrontendEndpointName", v.Expected.FrontendEndpointName, actual.FrontendEndpointName) } - } } @@ -304,7 +303,6 @@ func TestParseFrontendEndpointIDInsensitively(t *testing.T) { if actual.FrontendEndpointName != v.Expected.FrontendEndpointName { t.Fatalf("Expected %q but got %q for FrontendEndpointName", v.Expected.FrontendEndpointName, actual.FrontendEndpointName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_resourcegroup_test.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_resourcegroup_test.go index b945632f5c48..dea5316aa02f 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_resourcegroup_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_resourcegroup_test.go @@ -90,7 +90,6 @@ func TestParseResourceGroupID(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } @@ -184,7 +183,6 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_rulesengine_test.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_rulesengine_test.go index 8001603f8616..4728bb7f6846 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_rulesengine_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_rulesengine_test.go @@ -138,7 +138,6 @@ func TestParseRulesEngineID(t *testing.T) { if actual.RulesEngineName != v.Expected.RulesEngineName { t.Fatalf("Expected %q but got %q for RulesEngineName", v.Expected.RulesEngineName, actual.RulesEngineName) } - } } @@ -304,7 +303,6 @@ func TestParseRulesEngineIDInsensitively(t *testing.T) { if actual.RulesEngineName != v.Expected.RulesEngineName { t.Fatalf("Expected %q but got %q for RulesEngineName", v.Expected.RulesEngineName, actual.RulesEngineName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_subscription_test.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_subscription_test.go index e8bab39adcee..51bd8ec3cb1c 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_subscription_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/id_subscription_test.go @@ -71,7 +71,6 @@ func TestParseSubscriptionID(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } @@ -139,7 +138,6 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/model_routeconfiguration.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/model_routeconfiguration.go index 72b6be9ecbcd..5f5c22c71e6a 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/model_routeconfiguration.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/model_routeconfiguration.go @@ -49,5 +49,4 @@ func unmarshalRouteConfigurationImplementation(input []byte) (RouteConfiguration Values: temp, } return out, nil - } diff --git a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/predicates.go b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/predicates.go index 35b92a85a4dd..c9ce234a8430 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/frontdoors/predicates.go +++ b/internal/services/frontdoor/sdk/2020-04-01/frontdoors/predicates.go @@ -8,7 +8,6 @@ type FrontDoorPredicate struct { } func (p FrontDoorPredicate) Matches(input FrontDoor) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } @@ -35,7 +34,6 @@ type FrontendEndpointPredicate struct { } func (p FrontendEndpointPredicate) Matches(input FrontendEndpoint) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } @@ -58,7 +56,6 @@ type RulesEnginePredicate struct { } func (p RulesEnginePredicate) Matches(input RulesEngine) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } diff --git a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/id_subscription_test.go b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/id_subscription_test.go index c356e0ebce7e..5bd3ef97b92e 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/id_subscription_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/id_subscription_test.go @@ -71,7 +71,6 @@ func TestParseSubscriptionID(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } @@ -139,7 +138,6 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/predicates.go b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/predicates.go index 853573a78982..878d1d2cf6f5 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/predicates.go +++ b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallmanagedrulesets/predicates.go @@ -8,7 +8,6 @@ type ManagedRuleSetDefinitionPredicate struct { } func (p ManagedRuleSetDefinitionPredicate) Matches(input ManagedRuleSetDefinition) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } diff --git a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicies_test.go b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicies_test.go index c06ed387369f..6681c3577716 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicies_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicies_test.go @@ -119,7 +119,6 @@ func TestParseFrontDoorWebApplicationFirewallPoliciesID(t *testing.T) { if actual.PolicyName != v.Expected.PolicyName { t.Fatalf("Expected %q but got %q for PolicyName", v.Expected.PolicyName, actual.PolicyName) } - } } @@ -259,7 +258,6 @@ func TestParseFrontDoorWebApplicationFirewallPoliciesIDInsensitively(t *testing. if actual.PolicyName != v.Expected.PolicyName { t.Fatalf("Expected %q but got %q for PolicyName", v.Expected.PolicyName, actual.PolicyName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_resourcegroup_test.go b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_resourcegroup_test.go index 9788fcb6bcab..04e4eb117d11 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_resourcegroup_test.go +++ b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/id_resourcegroup_test.go @@ -90,7 +90,6 @@ func TestParseResourceGroupID(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } @@ -184,7 +183,6 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/predicates.go b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/predicates.go index a73e8adf7698..77305e20e7e8 100644 --- a/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/predicates.go +++ b/internal/services/frontdoor/sdk/2020-04-01/webapplicationfirewallpolicies/predicates.go @@ -9,7 +9,6 @@ type WebApplicationFirewallPolicyPredicate struct { } func (p WebApplicationFirewallPolicyPredicate) Matches(input WebApplicationFirewallPolicy) bool { - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { return false } diff --git a/internal/services/frontdoor/sdk/2020-05-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go b/internal/services/frontdoor/sdk/2020-05-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go index 9739f429deb2..46c40b46981e 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/checkfrontdoornameavailabilitywithsubscription/id_subscription_test.go @@ -71,7 +71,6 @@ func TestParseSubscriptionID(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } @@ -139,7 +138,6 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontdoor_test.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontdoor_test.go index abf0dabf6ee6..7bdc4e966d6b 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontdoor_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontdoor_test.go @@ -119,7 +119,6 @@ func TestParseFrontDoorID(t *testing.T) { if actual.FrontDoorName != v.Expected.FrontDoorName { t.Fatalf("Expected %q but got %q for FrontDoorName", v.Expected.FrontDoorName, actual.FrontDoorName) } - } } @@ -259,7 +258,6 @@ func TestParseFrontDoorIDInsensitively(t *testing.T) { if actual.FrontDoorName != v.Expected.FrontDoorName { t.Fatalf("Expected %q but got %q for FrontDoorName", v.Expected.FrontDoorName, actual.FrontDoorName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontendendpoint_test.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontendendpoint_test.go index 0d3a4a8554b1..ffd46a567834 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontendendpoint_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_frontendendpoint_test.go @@ -138,7 +138,6 @@ func TestParseFrontendEndpointID(t *testing.T) { if actual.FrontendEndpointName != v.Expected.FrontendEndpointName { t.Fatalf("Expected %q but got %q for FrontendEndpointName", v.Expected.FrontendEndpointName, actual.FrontendEndpointName) } - } } @@ -304,7 +303,6 @@ func TestParseFrontendEndpointIDInsensitively(t *testing.T) { if actual.FrontendEndpointName != v.Expected.FrontendEndpointName { t.Fatalf("Expected %q but got %q for FrontendEndpointName", v.Expected.FrontendEndpointName, actual.FrontendEndpointName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_resourcegroup_test.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_resourcegroup_test.go index b945632f5c48..dea5316aa02f 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_resourcegroup_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_resourcegroup_test.go @@ -90,7 +90,6 @@ func TestParseResourceGroupID(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } @@ -184,7 +183,6 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { if actual.ResourceGroupName != v.Expected.ResourceGroupName { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_rulesengine_test.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_rulesengine_test.go index 8001603f8616..4728bb7f6846 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_rulesengine_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_rulesengine_test.go @@ -138,7 +138,6 @@ func TestParseRulesEngineID(t *testing.T) { if actual.RulesEngineName != v.Expected.RulesEngineName { t.Fatalf("Expected %q but got %q for RulesEngineName", v.Expected.RulesEngineName, actual.RulesEngineName) } - } } @@ -304,7 +303,6 @@ func TestParseRulesEngineIDInsensitively(t *testing.T) { if actual.RulesEngineName != v.Expected.RulesEngineName { t.Fatalf("Expected %q but got %q for RulesEngineName", v.Expected.RulesEngineName, actual.RulesEngineName) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_subscription_test.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_subscription_test.go index e8bab39adcee..51bd8ec3cb1c 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_subscription_test.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/id_subscription_test.go @@ -71,7 +71,6 @@ func TestParseSubscriptionID(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } @@ -139,7 +138,6 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) { if actual.SubscriptionId != v.Expected.SubscriptionId { t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) } - } } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/model_routeconfiguration.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/model_routeconfiguration.go index 72b6be9ecbcd..5f5c22c71e6a 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/model_routeconfiguration.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/model_routeconfiguration.go @@ -49,5 +49,4 @@ func unmarshalRouteConfigurationImplementation(input []byte) (RouteConfiguration Values: temp, } return out, nil - } diff --git a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/predicates.go b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/predicates.go index 35b92a85a4dd..c9ce234a8430 100644 --- a/internal/services/frontdoor/sdk/2020-05-01/frontdoors/predicates.go +++ b/internal/services/frontdoor/sdk/2020-05-01/frontdoors/predicates.go @@ -8,7 +8,6 @@ type FrontDoorPredicate struct { } func (p FrontDoorPredicate) Matches(input FrontDoor) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } @@ -35,7 +34,6 @@ type FrontendEndpointPredicate struct { } func (p FrontendEndpointPredicate) Matches(input FrontendEndpoint) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } @@ -58,7 +56,6 @@ type RulesEnginePredicate struct { } func (p RulesEnginePredicate) Matches(input RulesEngine) bool { - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false } diff --git a/internal/services/hdinsight/client/client.go b/internal/services/hdinsight/client/client.go index 8099d8c6001a..de5799708635 100644 --- a/internal/services/hdinsight/client/client.go +++ b/internal/services/hdinsight/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/hdinsight/common_hdinsight.go b/internal/services/hdinsight/common_hdinsight.go index 9a1e639421a6..33396ba87f42 100644 --- a/internal/services/hdinsight/common_hdinsight.go +++ b/internal/services/hdinsight/common_hdinsight.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/hdinsight/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go b/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go index e8b1bab8d273..8e2ec520ad88 100644 --- a/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go b/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go index 55b68437992f..616877b33cde 100644 --- a/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go b/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go index 843329e0bccf..c6e18ecc7ea7 100644 --- a/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go b/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go index 6a3b9cdae5fe..1e1f332b21f2 100644 --- a/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_spark_cluster_resource.go b/internal/services/hdinsight/hdinsight_spark_cluster_resource.go index 9c0dca179fbe..69ab576e1377 100644 --- a/internal/services/hdinsight/hdinsight_spark_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_spark_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_spark_cluster_resource_test.go b/internal/services/hdinsight/hdinsight_spark_cluster_resource_test.go index bfa505d70cec..ce423e99aa7c 100644 --- a/internal/services/hdinsight/hdinsight_spark_cluster_resource_test.go +++ b/internal/services/hdinsight/hdinsight_spark_cluster_resource_test.go @@ -1738,7 +1738,6 @@ resource "azurerm_hdinsight_spark_cluster" "test" { } } `, r.template(data), data.RandomInteger) - } func (r HDInsightSparkClusterResource) allMetastores(data acceptance.TestData) string { diff --git a/internal/services/hdinsight/schema.go b/internal/services/hdinsight/schema.go index 7bf6c394e54e..ae92289c3262 100644 --- a/internal/services/hdinsight/schema.go +++ b/internal/services/hdinsight/schema.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/healthcare/client/client.go b/internal/services/healthcare/client/client.go index f699d48e44b1..76a6e76b3a66 100644 --- a/internal/services/healthcare/client/client.go +++ b/internal/services/healthcare/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/healthcare/healthcare_dicom_resource.go b/internal/services/healthcare/healthcare_dicom_resource.go index 4e74ba607aa6..b306db357cad 100644 --- a/internal/services/healthcare/healthcare_dicom_resource.go +++ b/internal/services/healthcare/healthcare_dicom_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/healthcare/healthcare_fhir_resource.go b/internal/services/healthcare/healthcare_fhir_resource.go index 85d273a71052..ad9d3d09d001 100644 --- a/internal/services/healthcare/healthcare_fhir_resource.go +++ b/internal/services/healthcare/healthcare_fhir_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" @@ -223,7 +223,6 @@ func resourceHealthcareApisFhirService() *pluginsdk.Resource { "tags": commonschema.Tags(), }, } - } func resourceHealthcareApisFhirServiceCreate(d *pluginsdk.ResourceData, meta interface{}) error { @@ -359,7 +358,6 @@ func resourceHealthcareApisFhirServiceRead(d *pluginsdk.ResourceData, meta inter if artifacts := acrConfig.OciArtifacts; artifacts != nil { d.Set("oci_artifact", flattenOciArtifacts(artifacts)) } - } if props.ExportConfiguration != nil && props.ExportConfiguration.StorageAccountName != nil { d.Set("configuration_export_storage_account_name", props.ExportConfiguration.StorageAccountName) diff --git a/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go b/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go index 0647ca5eae3a..d648f973083c 100644 --- a/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go +++ b/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/healthcare/healthcare_medtech_service_resource.go b/internal/services/healthcare/healthcare_medtech_service_resource.go index 9f99fcbd3440..32a4f0fbca8a 100644 --- a/internal/services/healthcare/healthcare_medtech_service_resource.go +++ b/internal/services/healthcare/healthcare_medtech_service_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/healthcare/healthcare_service_resource.go b/internal/services/healthcare/healthcare_service_resource.go index a895d00a1142..dc6c77f0bcbe 100644 --- a/internal/services/healthcare/healthcare_service_resource.go +++ b/internal/services/healthcare/healthcare_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/healthcare/healthcare_workspace_resource.go b/internal/services/healthcare/healthcare_workspace_resource.go index 462bf317f1a6..2b3fe1d5987b 100644 --- a/internal/services/healthcare/healthcare_workspace_resource.go +++ b/internal/services/healthcare/healthcare_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hpccache/client/client.go b/internal/services/hpccache/client/client.go index 3e4863428f14..08be9b751c72 100644 --- a/internal/services/hpccache/client/client.go +++ b/internal/services/hpccache/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/hpccache/hpc_cache.go b/internal/services/hpccache/hpc_cache.go index ecafe1ab67c8..c28dc73f667e 100644 --- a/internal/services/hpccache/hpc_cache.go +++ b/internal/services/hpccache/hpc_cache.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/hpccache/hpc_cache_access_policy_resource.go b/internal/services/hpccache/hpc_cache_access_policy_resource.go index ae292d54a0bb..fa59b4bed7ce 100644 --- a/internal/services/hpccache/hpc_cache_access_policy_resource.go +++ b/internal/services/hpccache/hpc_cache_access_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go b/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go index 48670c23378b..9fe4f0f1c1a4 100644 --- a/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go +++ b/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_blob_target_resource.go b/internal/services/hpccache/hpc_cache_blob_target_resource.go index e7bcd04d1047..01a6702ff56a 100644 --- a/internal/services/hpccache/hpc_cache_blob_target_resource.go +++ b/internal/services/hpccache/hpc_cache_blob_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_nfs_target_resource.go b/internal/services/hpccache/hpc_cache_nfs_target_resource.go index da4179308a74..cb01b1f410fe 100644 --- a/internal/services/hpccache/hpc_cache_nfs_target_resource.go +++ b/internal/services/hpccache/hpc_cache_nfs_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_resource.go b/internal/services/hpccache/hpc_cache_resource.go index 500612e024e5..63cd62a94e8a 100644 --- a/internal/services/hpccache/hpc_cache_resource.go +++ b/internal/services/hpccache/hpc_cache_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource.go b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource.go index 852f5517f5ed..789d9acf3cbc 100644 --- a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource.go +++ b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource.go @@ -317,7 +317,6 @@ func flattenIotCentralApplicationNetworkRuleSetIPRule(input *[]apps.NetworkRuleS func isNetworkRuleSetNullified(networkRuleSet apps.NetworkRuleSets) bool { if networkRuleSet.ApplyToDevices != nil && *networkRuleSet.ApplyToDevices { - return false } diff --git a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go index c9025b546e75..4b8f27bc209c 100644 --- a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go +++ b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go @@ -183,7 +183,7 @@ func (IoTCentralApplicationNetworkRuleSetResource) Exists(ctx context.Context, c return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } - return utils.Bool(resp.Model != nil && resp.Model.Properties != nil && &resp.Model.Properties.NetworkRuleSets != nil), nil + return utils.Bool(resp.Model != nil && resp.Model.Properties != nil && resp.Model.Properties.NetworkRuleSets != nil), nil } func (r IoTCentralApplicationNetworkRuleSetResource) basic(data acceptance.TestData) string { diff --git a/internal/services/iotcentral/iotcentral_application_resource.go b/internal/services/iotcentral/iotcentral_application_resource.go index 47b6f064b554..5865b4c14c70 100644 --- a/internal/services/iotcentral/iotcentral_application_resource.go +++ b/internal/services/iotcentral/iotcentral_application_resource.go @@ -170,7 +170,7 @@ func resourceIotCentralAppCreate(d *pluginsdk.ResourceData, meta interface{}) er } // Public Network Access can only be disabled after creation - if d.Get("public_network_access_enabled").(bool) == false { + if !d.Get("public_network_access_enabled").(bool) { publicNetworkAccess := apps.PublicNetworkAccessDisabled app.Properties.PublicNetworkAccess = &publicNetworkAccess if err := client.CreateOrUpdateThenPoll(ctx, id, app); err != nil { diff --git a/internal/services/iothub/iothub_device_update_instance_resource.go b/internal/services/iothub/iothub_device_update_instance_resource.go index 5b638d77e3f5..ddf0aed864bb 100644 --- a/internal/services/iothub/iothub_device_update_instance_resource.go +++ b/internal/services/iothub/iothub_device_update_instance_resource.go @@ -202,11 +202,7 @@ func (r IotHubDeviceUpdateInstanceResource) Read() sdk.ResourceFunc { state.IotHubId = (*iotHubs)[0].ResourceId } - diagnosticStorageAccount, err := flattenDiagnosticStorageAccount(properties.DiagnosticStorageProperties, metadata) - if err != nil { - return err - } - state.DiagnosticStorageAccount = diagnosticStorageAccount + state.DiagnosticStorageAccount = flattenDiagnosticStorageAccount(properties.DiagnosticStorageProperties, metadata) diagnosticEnabled := false if properties.EnableDiagnostics != nil { @@ -307,10 +303,10 @@ func expandDiagnosticStorageAccount(inputList []DiagnosticStorageAccountModel) * return &output } -func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStorageProperties, metadata sdk.ResourceMetaData) ([]DiagnosticStorageAccountModel, error) { +func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStorageProperties, metadata sdk.ResourceMetaData) []DiagnosticStorageAccountModel { var outputList []DiagnosticStorageAccountModel if input == nil { - return outputList, nil + return outputList } output := DiagnosticStorageAccountModel{ @@ -322,5 +318,5 @@ func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStoragePrope output.ConnectionString = connectionString.(string) } - return append(outputList, output), nil + return append(outputList, output) } diff --git a/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go b/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go index eafcc2b7a9e4..1e9a5d906c0c 100644 --- a/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go +++ b/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go @@ -95,12 +95,11 @@ func dataSourceIotHubDPSSharedAccessPolicyRead(d *pluginsdk.ResourceData, meta i d.Set("resource_group_name", keyId.ResourceGroupName) d.SetId(id.ID()) - if model := accessPolicy.Model; model != nil { d.Set("primary_key", model.PrimaryKey) d.Set("secondary_key", model.SecondaryKey) - if dpsModel := iothubDps.Model; model != nil { + if dpsModel := iothubDps.Model; dpsModel != nil { properties := dpsModel.Properties primaryConnectionString := "" secondaryConnectionString := "" diff --git a/internal/services/iothub/iothub_dps_shared_access_policy_resource.go b/internal/services/iothub/iothub_dps_shared_access_policy_resource.go index aff0d2976567..2604f6a8e989 100644 --- a/internal/services/iothub/iothub_dps_shared_access_policy_resource.go +++ b/internal/services/iothub/iothub_dps_shared_access_policy_resource.go @@ -225,7 +225,7 @@ func resourceIotHubDPSSharedAccessPolicyRead(d *pluginsdk.ResourceData, meta int d.Set("primary_key", model.PrimaryKey) d.Set("secondary_key", model.SecondaryKey) - if iothubDpsModel := iothubDps.Model; model != nil { + if iothubDpsModel := iothubDps.Model; iothubDpsModel != nil { primaryConnectionString := "" secondaryConnectionString := "" properties := iothubDpsModel.Properties diff --git a/internal/services/iottimeseriesinsights/client/client.go b/internal/services/iottimeseriesinsights/client/client.go index 2096f5ea4f26..eac05f438b5c 100644 --- a/internal/services/iottimeseriesinsights/client/client.go +++ b/internal/services/iottimeseriesinsights/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go index 5b748e8a3546..f3547cfe96b0 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/iottimeseriesinsights/migration" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go index 751d290b0d7e..ed9b29d027df 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go index ac9c721a703c..a5a95da7e649 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go index b32167a73496..c493d8319f18 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go index 6e46b90b412e..b093ea701f41 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go index dd7d1f209003..0ad4305c9444 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/keyvault/access_policy_schema.go b/internal/services/keyvault/access_policy_schema.go index 1c1b1c76f9a9..b12fa3358de3 100644 --- a/internal/services/keyvault/access_policy_schema.go +++ b/internal/services/keyvault/access_policy_schema.go @@ -3,7 +3,7 @@ package keyvault import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/keyvault/client/client.go b/internal/services/keyvault/client/client.go index c6ae1f2bceb2..b6958de3f183 100644 --- a/internal/services/keyvault/client/client.go +++ b/internal/services/keyvault/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck keyvaultmgmt "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/keyvault/key_vault_access_policy_data_source.go b/internal/services/keyvault/key_vault_access_policy_data_source.go index d78bae3f4a43..0c17f517308f 100644 --- a/internal/services/keyvault/key_vault_access_policy_data_source.go +++ b/internal/services/keyvault/key_vault_access_policy_data_source.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/keyvault/key_vault_access_policy_resource.go b/internal/services/keyvault/key_vault_access_policy_resource.go index 5353bc9bfb4c..bb2c709f14f0 100644 --- a/internal/services/keyvault/key_vault_access_policy_resource.go +++ b/internal/services/keyvault/key_vault_access_policy_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/keyvault/key_vault_data_source.go b/internal/services/keyvault/key_vault_data_source.go index ad03262f124d..eb5c82e96ab8 100644 --- a/internal/services/keyvault/key_vault_data_source.go +++ b/internal/services/keyvault/key_vault_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go b/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go index 6b4dba150f6f..cd17449984db 100644 --- a/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go +++ b/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/keyvault/key_vault_resource.go b/internal/services/keyvault/key_vault_resource.go index a3fd9cb99421..b8f9334d1abf 100644 --- a/internal/services/keyvault/key_vault_resource.go +++ b/internal/services/keyvault/key_vault_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck KeyVaultMgmt "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" diff --git a/internal/services/keyvault/key_vault_secret_resource.go b/internal/services/keyvault/key_vault_secret_resource.go index 8d46fcafab3e..e6ef6587e711 100644 --- a/internal/services/keyvault/key_vault_secret_resource.go +++ b/internal/services/keyvault/key_vault_secret_resource.go @@ -419,7 +419,6 @@ func resourceKeyVaultSecretDelete(d *pluginsdk.ResourceData, meta interface{}) e if shouldPurge && kv.Properties != nil && utils.NormaliseNilableBool(kv.Properties.EnablePurgeProtection) { log.Printf("[DEBUG] cannot purge secret %q because vault %q has purge protection enabled", id.Name, keyVaultId.String()) shouldPurge = false - } description := fmt.Sprintf("Secret %q (Key Vault %q)", id.Name, id.KeyVaultBaseUrl) diff --git a/internal/services/kusto/client/client.go b/internal/services/kusto/client/client.go index 551eff602bb0..4fd6a741d4e8 100644 --- a/internal/services/kusto/client/client.go +++ b/internal/services/kusto/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/kusto/identity.go b/internal/services/kusto/identity.go index f74767d9ae54..58ad3b3e20db 100644 --- a/internal/services/kusto/identity.go +++ b/internal/services/kusto/identity.go @@ -1,7 +1,7 @@ package kusto import ( - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/kusto/kusto_attached_database_configuration_resource.go b/internal/services/kusto/kusto_attached_database_configuration_resource.go index 21e2c29db1cf..77c16048b405 100644 --- a/internal/services/kusto/kusto_attached_database_configuration_resource.go +++ b/internal/services/kusto/kusto_attached_database_configuration_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go b/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go index 0216be47c5ce..f7addfcd9de3 100644 --- a/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go +++ b/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go b/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go index fc6e27940a20..6d37eefdbaac 100644 --- a/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go +++ b/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/kusto/kusto_cluster_principal_assignment_resource.go b/internal/services/kusto/kusto_cluster_principal_assignment_resource.go index 61aa6e803e12..f4a8bd6dcc42 100644 --- a/internal/services/kusto/kusto_cluster_principal_assignment_resource.go +++ b/internal/services/kusto/kusto_cluster_principal_assignment_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_cluster_resource.go b/internal/services/kusto/kusto_cluster_resource.go index 1dc98a8ba076..eaf4da4eca5f 100644 --- a/internal/services/kusto/kusto_cluster_resource.go +++ b/internal/services/kusto/kusto_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -553,7 +553,7 @@ func flattenOptimizedAutoScale(optimizedAutoScale *kusto.OptimizedAutoscale) []i } func expandKustoListString(input []interface{}) (*[]string, error) { - if input == nil || len(input) == 0 { + if len(input) == 0 { return nil, fmt.Errorf("list of string is empty") } diff --git a/internal/services/kusto/kusto_data_connection_import.go b/internal/services/kusto/kusto_data_connection_import.go index c6f87a87302b..8cdc9b6dc47a 100644 --- a/internal/services/kusto/kusto_data_connection_import.go +++ b/internal/services/kusto/kusto_data_connection_import.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/kusto/kusto_database_principal_assignment_resource.go b/internal/services/kusto/kusto_database_principal_assignment_resource.go index 006a1d85e5cc..85bca06a12fb 100644 --- a/internal/services/kusto/kusto_database_principal_assignment_resource.go +++ b/internal/services/kusto/kusto_database_principal_assignment_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_database_resource.go b/internal/services/kusto/kusto_database_resource.go index 1a31a1f58cff..101310dcb162 100644 --- a/internal/services/kusto/kusto_database_resource.go +++ b/internal/services/kusto/kusto_database_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/kusto/kusto_database_script_resource.go b/internal/services/kusto/kusto_database_script_resource.go index 0ad460dcd78d..dbe54196a311 100644 --- a/internal/services/kusto/kusto_database_script_resource.go +++ b/internal/services/kusto/kusto_database_script_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_eventgrid_data_connection_resource.go b/internal/services/kusto/kusto_eventgrid_data_connection_resource.go index 14457332b3a9..c5cbd413f76d 100644 --- a/internal/services/kusto/kusto_eventgrid_data_connection_resource.go +++ b/internal/services/kusto/kusto_eventgrid_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/kusto/kusto_eventhub_data_connection_resource.go b/internal/services/kusto/kusto_eventhub_data_connection_resource.go index 136d2cee2903..4edc70fb89af 100644 --- a/internal/services/kusto/kusto_eventhub_data_connection_resource.go +++ b/internal/services/kusto/kusto_eventhub_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubs" diff --git a/internal/services/kusto/kusto_iothub_data_connection_resource.go b/internal/services/kusto/kusto_iothub_data_connection_resource.go index f001b16e9716..83017f75c219 100644 --- a/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/loadbalancer/loadbalancer_resource.go b/internal/services/loadbalancer/loadbalancer_resource.go index 78f9725326c7..5fa25ed675a9 100644 --- a/internal/services/loadbalancer/loadbalancer_resource.go +++ b/internal/services/loadbalancer/loadbalancer_resource.go @@ -117,11 +117,7 @@ func resourceArmLoadBalancerCreateUpdate(d *pluginsdk.ResourceData, meta interfa properties := network.LoadBalancerPropertiesFormat{} if _, ok := d.GetOk("frontend_ip_configuration"); ok { - frontendIPConfigurations, err := expandAzureRmLoadBalancerFrontendIpConfigurations(d) - if err != nil { - return err - } - properties.FrontendIPConfigurations = frontendIPConfigurations + properties.FrontendIPConfigurations = expandAzureRmLoadBalancerFrontendIpConfigurations(d) } loadBalancer := network.LoadBalancer{ @@ -226,7 +222,7 @@ func resourceArmLoadBalancerDelete(d *pluginsdk.ResourceData, meta interface{}) return nil } -func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData) (*[]network.FrontendIPConfiguration, error) { +func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData) *[]network.FrontendIPConfiguration { configs := d.Get("frontend_ip_configuration").([]interface{}) frontEndConfigs := make([]network.FrontendIPConfiguration, 0, len(configs)) @@ -283,7 +279,7 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData frontEndConfigs = append(frontEndConfigs, frontEndConfig) } - return &frontEndConfigs, nil + return &frontEndConfigs } func flattenLoadBalancerFrontendIpConfiguration(ipConfigs *[]network.FrontendIPConfiguration) []interface{} { diff --git a/internal/services/loganalytics/log_analytics_cluster.go b/internal/services/loganalytics/log_analytics_cluster.go index c729865227db..54b181a50e02 100644 --- a/internal/services/loganalytics/log_analytics_cluster.go +++ b/internal/services/loganalytics/log_analytics_cluster.go @@ -26,7 +26,6 @@ func logAnalyticsClusterWaitForState(ctx context.Context, client *clusters.Clust func logAnalyticsClusterRefresh(ctx context.Context, client *clusters.ClustersClient, clusterId clusters.ClusterId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - log.Printf("[INFO] checking on state of Log Analytics Cluster %q", clusterId.ClusterName) resp, err := client.Get(ctx, clusterId) diff --git a/internal/services/loganalytics/log_analytics_cluster_resource.go b/internal/services/loganalytics/log_analytics_cluster_resource.go index bf3f71260b7f..ebfe664e8fed 100644 --- a/internal/services/loganalytics/log_analytics_cluster_resource.go +++ b/internal/services/loganalytics/log_analytics_cluster_resource.go @@ -160,7 +160,6 @@ func resourceLogAnalyticsClusterRead(d *pluginsdk.ResourceData, meta interface{} } if props := model.Properties; props != nil { d.Set("cluster_id", props.ClusterId) - } capacity := 0 if sku := model.Sku; sku != nil { diff --git a/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go b/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go index 572bdeb231bf..6611d823463d 100644 --- a/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go +++ b/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go @@ -156,7 +156,6 @@ func resourceLogAnalyticsDataSourceWindowsEventRead(d *pluginsdk.ResourceData, m d.Set("workspace_name", id.WorkspaceName) if model := resp.Model; model != nil { - if props := resp.Model.Properties; props != nil { propStr, err := pluginsdk.FlattenJsonToString(props.(map[string]interface{})) if err != nil { diff --git a/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go b/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go index 6e3120952371..f31821cbb9cf 100644 --- a/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go +++ b/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go @@ -161,7 +161,6 @@ func resourceLogAnalyticsDataSourceWindowsPerformanceCounterRead(d *pluginsdk.Re d.Set("workspace_name", id.WorkspaceName) if model := resp.Model; model != nil { - if props := model.Properties; props != nil { propStr, err := pluginsdk.FlattenJsonToString(props.(map[string]interface{})) if err != nil { diff --git a/internal/services/loganalytics/log_analytics_linked_service.go b/internal/services/loganalytics/log_analytics_linked_service.go index 465133a8d8b2..941f77bbdb9c 100644 --- a/internal/services/loganalytics/log_analytics_linked_service.go +++ b/internal/services/loganalytics/log_analytics_linked_service.go @@ -23,7 +23,6 @@ func logAnalyticsLinkedServiceDeleteWaitForState(ctx context.Context, client *li func logAnalyticsLinkedServiceRefresh(ctx context.Context, client *linkedservices.LinkedServicesClient, id linkedservices.LinkedServiceId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - log.Printf("[INFO] checking on state of %s", id) resp, err := client.Get(ctx, id) diff --git a/internal/services/loganalytics/log_analytics_workspace_data_source.go b/internal/services/loganalytics/log_analytics_workspace_data_source.go index 42fc3995152d..4b874dea1e4f 100644 --- a/internal/services/loganalytics/log_analytics_workspace_data_source.go +++ b/internal/services/loganalytics/log_analytics_workspace_data_source.go @@ -98,7 +98,6 @@ func dataSourceLogAnalyticsWorkspaceRead(d *pluginsdk.ResourceData, meta interfa d.Set("location", location.NormalizeNilable(&model.Location)) if props := model.Properties; props != nil { - customerId := "" if props.CustomerId != nil { customerId = *props.CustomerId diff --git a/internal/services/loganalytics/log_analytics_workspace_resource.go b/internal/services/loganalytics/log_analytics_workspace_resource.go index 6956cc9737ef..26cafad1354e 100644 --- a/internal/services/loganalytics/log_analytics_workspace_resource.go +++ b/internal/services/loganalytics/log_analytics_workspace_resource.go @@ -239,6 +239,7 @@ func resourceLogAnalyticsWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta i }, } + // nolint : staticcheck if v, ok := d.GetOkExists("cmk_for_query_forced"); ok { parameters.Properties.ForceCmkForQuery = utils.Bool(v.(bool)) } @@ -299,7 +300,6 @@ func resourceLogAnalyticsWorkspaceRead(d *pluginsdk.ResourceData, meta interface if model := resp.Model; model != nil { if props := model.Properties; props != nil { - internetIngestionEnabled := true if props.PublicNetworkAccessForIngestion != nil { internetIngestionEnabled = *props.PublicNetworkAccessForIngestion == workspaces.PublicNetworkAccessTypeEnabled @@ -325,7 +325,6 @@ func resourceLogAnalyticsWorkspaceRead(d *pluginsdk.ResourceData, meta interface if strings.EqualFold(v, string(sku.Name)) { skuName = v } - } if capacityReservationLevel := sku.CapacityReservationLevel; capacityReservationLevel != nil { d.Set("reservation_capacity_in_gb_per_day", capacityReservationLevel) diff --git a/internal/services/logic/client/client.go b/internal/services/logic/client/client.go index 1f301a79efbd..a93288b8f94d 100644 --- a/internal/services/logic/client/client.go +++ b/internal/services/logic/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/logic/integration_service_environment.go b/internal/services/logic/integration_service_environment.go index 58e6d85dd9ee..a9269669a26e 100644 --- a/internal/services/logic/integration_service_environment.go +++ b/internal/services/logic/integration_service_environment.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/logic/logic_app_action_http_resource.go b/internal/services/logic/logic_app_action_http_resource.go index 12aff81e01a7..9e16a5a6c4d8 100644 --- a/internal/services/logic/logic_app_action_http_resource.go +++ b/internal/services/logic/logic_app_action_http_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/logic/logic_app_integration_account_agreement_resource.go b/internal/services/logic/logic_app_integration_account_agreement_resource.go index 0713c12589d6..13973e85dbdc 100644 --- a/internal/services/logic/logic_app_integration_account_agreement_resource.go +++ b/internal/services/logic/logic_app_integration_account_agreement_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_assembly_resource.go b/internal/services/logic/logic_app_integration_account_assembly_resource.go index eb86712261f9..6085ab57cdc4 100644 --- a/internal/services/logic/logic_app_integration_account_assembly_resource.go +++ b/internal/services/logic/logic_app_integration_account_assembly_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go index 81eb8e773667..489116c770c7 100644 --- a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go +++ b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_certificate_resource.go b/internal/services/logic/logic_app_integration_account_certificate_resource.go index 1cf137f3a17d..624173eb75ee 100644 --- a/internal/services/logic/logic_app_integration_account_certificate_resource.go +++ b/internal/services/logic/logic_app_integration_account_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_map_resource.go b/internal/services/logic/logic_app_integration_account_map_resource.go index 1951639b0a4e..36493a6ec96e 100644 --- a/internal/services/logic/logic_app_integration_account_map_resource.go +++ b/internal/services/logic/logic_app_integration_account_map_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_partner_resource.go b/internal/services/logic/logic_app_integration_account_partner_resource.go index 13a94eb38986..e1cf617d6cc4 100644 --- a/internal/services/logic/logic_app_integration_account_partner_resource.go +++ b/internal/services/logic/logic_app_integration_account_partner_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_resource.go b/internal/services/logic/logic_app_integration_account_resource.go index 6dc76582fcb7..7c82f549f2fb 100644 --- a/internal/services/logic/logic_app_integration_account_resource.go +++ b/internal/services/logic/logic_app_integration_account_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/logic/logic_app_integration_account_schema_resource.go b/internal/services/logic/logic_app_integration_account_schema_resource.go index 235d8c872dc2..dc80710c82bb 100644 --- a/internal/services/logic/logic_app_integration_account_schema_resource.go +++ b/internal/services/logic/logic_app_integration_account_schema_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_session_resource.go b/internal/services/logic/logic_app_integration_account_session_resource.go index 7e88b8af6bf8..7a234eb9f994 100644 --- a/internal/services/logic/logic_app_integration_account_session_resource.go +++ b/internal/services/logic/logic_app_integration_account_session_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_standard_data_source.go b/internal/services/logic/logic_app_standard_data_source.go index a3ff7b0cb8aa..a4333211fe35 100644 --- a/internal/services/logic/logic_app_standard_data_source.go +++ b/internal/services/logic/logic_app_standard_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index b519f005d614..63892c3d5b34 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/logic/logic_app_workflow_data_source.go b/internal/services/logic/logic_app_workflow_data_source.go index e36d95040398..33d616c8c746 100644 --- a/internal/services/logic/logic_app_workflow_data_source.go +++ b/internal/services/logic/logic_app_workflow_data_source.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_workflow_resource.go b/internal/services/logic/logic_app_workflow_resource.go index 3b26d394cf19..bf20995ef047 100644 --- a/internal/services/logic/logic_app_workflow_resource.go +++ b/internal/services/logic/logic_app_workflow_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/logic/logic_apps.go b/internal/services/logic/logic_apps.go index 5cf2b6382477..edc3d41d605e 100644 --- a/internal/services/logic/logic_apps.go +++ b/internal/services/logic/logic_apps.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/logz/client/client.go b/internal/services/logz/client/client.go index ee1d772446a9..94c1b6fecd3d 100644 --- a/internal/services/logz/client/client.go +++ b/internal/services/logz/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/logz/logz_common.go b/internal/services/logz/logz_common.go index 2a603b2e4a8f..e07a2728c39f 100644 --- a/internal/services/logz/logz_common.go +++ b/internal/services/logz/logz_common.go @@ -1,7 +1,7 @@ package logz import ( - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/logz/logz_monitor_resource.go b/internal/services/logz/logz_monitor_resource.go index d0cac70715cd..2cd3598c73a4 100644 --- a/internal/services/logz/logz_monitor_resource.go +++ b/internal/services/logz/logz_monitor_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/logz/logz_sub_account_resource.go b/internal/services/logz/logz_sub_account_resource.go index 8da494e0d7b8..e00dcb49c353 100644 --- a/internal/services/logz/logz_sub_account_resource.go +++ b/internal/services/logz/logz_sub_account_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/logz/logz_sub_account_tag_rule_resource.go b/internal/services/logz/logz_sub_account_tag_rule_resource.go index 4cb65c0f719d..6676667ccfe2 100644 --- a/internal/services/logz/logz_sub_account_tag_rule_resource.go +++ b/internal/services/logz/logz_sub_account_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/logz/logz_tag_rule_resource.go b/internal/services/logz/logz_tag_rule_resource.go index 8c282ca1f50d..140304b6becc 100644 --- a/internal/services/logz/logz_tag_rule_resource.go +++ b/internal/services/logz/logz_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/machinelearning/machine_learning_compute_instance_resource.go b/internal/services/machinelearning/machine_learning_compute_instance_resource.go index c5bb970f90ca..3878037b72ee 100644 --- a/internal/services/machinelearning/machine_learning_compute_instance_resource.go +++ b/internal/services/machinelearning/machine_learning_compute_instance_resource.go @@ -199,7 +199,6 @@ func resourceComputeInstanceCreate(d *pluginsdk.ResourceData, meta interface{}) authType := d.Get("authorization_type").(string) if authType != "" { computeInstance.Properties.ComputeInstanceAuthorizationType = utils.ToPtr(machinelearningcomputes.ComputeInstanceAuthorizationType(authType)) - } parameters := machinelearningcomputes.ComputeResource{ diff --git a/internal/services/machinelearning/machine_learning_workspace_resource.go b/internal/services/machinelearning/machine_learning_workspace_resource.go index d5f563f08dfc..71426c43e075 100644 --- a/internal/services/machinelearning/machine_learning_workspace_resource.go +++ b/internal/services/machinelearning/machine_learning_workspace_resource.go @@ -235,6 +235,7 @@ func resourceMachineLearningWorkspaceCreateOrUpdate(d *pluginsdk.ResourceData, m networkAccessBehindVnetEnabled := false + // nolint: staticcheck if v, ok := d.GetOkExists("public_network_access_enabled"); ok { networkAccessBehindVnetEnabled = v.(bool) } @@ -307,7 +308,6 @@ func resourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta interf id, err := workspaces.ParseWorkspaceID(d.Id()) if err != nil { - return fmt.Errorf("parsing Machine Learning Workspace ID `%q`: %+v", d.Id(), err) } @@ -348,7 +348,6 @@ func resourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta interf if !features.FourPointOhBeta() { d.Set("public_access_behind_virtual_network_enabled", props.AllowPublicAccessWhenBehindVnet) } - } flattenedIdentity, err := flattenMachineLearningWorkspaceIdentity(resp.Model.Identity) diff --git a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go index f2af7c3d1087..6e5d254a3668 100644 --- a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go +++ b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go @@ -100,9 +100,7 @@ func resourceArmMaintenanceAssignmentDedicatedHostCreate(d *pluginsdk.ResourceDa id := configurationassignments.NewProviders2ConfigurationAssignmentID(dedicatedHostId.SubscriptionId, dedicatedHostId.ResourceGroupName, "Microsoft.Compute", "hostGroups", dedicatedHostId.HostGroupName, "hosts", dedicatedHostId.HostName, assignmentName) err = pluginsdk.Retry(d.Timeout(pluginsdk.TimeoutCreate), func() *pluginsdk.RetryError { - if _, err := client.CreateOrUpdateParent(ctx, id, configurationAssignment); err != nil { - if strings.Contains(err.Error(), "It may take a few minutes after starting a VM for it to become available to assign to a configuration") { return pluginsdk.RetryableError(fmt.Errorf("expected VM is available to assign to a configuration but was in pending state, retrying")) } @@ -179,7 +177,6 @@ func resourceArmMaintenanceAssignmentDedicatedHostDelete(d *pluginsdk.ResourceDa } func getMaintenanceAssignmentDedicatedHost(ctx context.Context, client *configurationassignments.ConfigurationAssignmentsClient, hostId dedicatedhosts.HostId, dedicatedHostId string) (result *[]configurationassignments.ConfigurationAssignment, err error) { - id := configurationassignments.NewResourceGroupProviderID(hostId.SubscriptionId, hostId.ResourceGroupName, "Microsoft.Compute", "hostGroups", hostId.HostGroupName, "hosts", hostId.HostName) resp, err := client.ListParent(ctx, id) diff --git a/internal/services/maintenance/maintenance_assignment_virtual_machine_resource.go b/internal/services/maintenance/maintenance_assignment_virtual_machine_resource.go index 23942cf45133..3e4b04e81eed 100644 --- a/internal/services/maintenance/maintenance_assignment_virtual_machine_resource.go +++ b/internal/services/maintenance/maintenance_assignment_virtual_machine_resource.go @@ -182,7 +182,6 @@ func resourceArmMaintenanceAssignmentVirtualMachineDelete(d *pluginsdk.ResourceD } func getMaintenanceAssignmentVirtualMachine(ctx context.Context, client *configurationassignments.ConfigurationAssignmentsClient, vmId *parseCompute.VirtualMachineId, virtualMachineId string) (result *[]configurationassignments.ConfigurationAssignment, err error) { - id := configurationassignments.NewProviderID(vmId.SubscriptionId, vmId.ResourceGroup, "Microsoft.Compute", "virtualMachines", vmId.Name) resp, err := client.List(ctx, id) if err != nil { diff --git a/internal/services/maintenance/maintenance_assignment_virtual_machine_scale_set_resource.go b/internal/services/maintenance/maintenance_assignment_virtual_machine_scale_set_resource.go index c0248357b0e5..b7b9367bec84 100644 --- a/internal/services/maintenance/maintenance_assignment_virtual_machine_scale_set_resource.go +++ b/internal/services/maintenance/maintenance_assignment_virtual_machine_scale_set_resource.go @@ -169,7 +169,6 @@ func resourceArmMaintenanceAssignmentVirtualMachineScaleSetDelete(d *pluginsdk.R } func getMaintenanceAssignmentVirtualMachineScaleSet(ctx context.Context, client *configurationassignments.ConfigurationAssignmentsClient, vmScaleSetId *parseCompute.VirtualMachineScaleSetId) (result *[]configurationassignments.ConfigurationAssignment, err error) { - id := configurationassignments.NewProviderID(vmScaleSetId.SubscriptionId, vmScaleSetId.ResourceGroup, "Microsoft.Compute", "virtualMachineScaleSets", vmScaleSetId.Name) resp, err := client.List(ctx, id) diff --git a/internal/services/maintenance/public_maintenance_configurations_data_source.go b/internal/services/maintenance/public_maintenance_configurations_data_source.go index 577b20aa7f01..cb16984b86e5 100644 --- a/internal/services/maintenance/public_maintenance_configurations_data_source.go +++ b/internal/services/maintenance/public_maintenance_configurations_data_source.go @@ -138,7 +138,6 @@ func dataSourcePublicMaintenanceConfigurationsRead(d *pluginsdk.ResourceData, me if resp.Model != nil { if resp.Model.Value != nil { for _, maintenanceConfig := range *resp.Model.Value { - var configLocation, configRecurEvery, configScope string if maintenanceConfig.Location != nil { configLocation = azure.NormalizeLocation(*maintenanceConfig.Location) diff --git a/internal/services/maintenance/public_maintenance_configurations_data_source_test.go b/internal/services/maintenance/public_maintenance_configurations_data_source_test.go index c8c775cf48eb..e68950b184f6 100644 --- a/internal/services/maintenance/public_maintenance_configurations_data_source_test.go +++ b/internal/services/maintenance/public_maintenance_configurations_data_source_test.go @@ -1,7 +1,6 @@ package maintenance_test import ( - "fmt" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -57,28 +56,28 @@ func TestAccDataSourcePublicMaintenanceConfigurations_recurEvery(t *testing.T) { } func (PublicMaintenanceConfigurationsDataSource) allFilters() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { location = "West Europe" scope = "SQLManagedInstance" recur_every = "Monday-Thursday" } -`) +` } func (PublicMaintenanceConfigurationsDataSource) noFilters() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { } -`) +` } func (PublicMaintenanceConfigurationsDataSource) recurEvery() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { scope = "SQLManagedInstance" recur_every = "Friday-Sunday" } -`) +` } diff --git a/internal/services/managedapplications/client/client.go b/internal/services/managedapplications/client/client.go index 553b45281276..75ab9313e1f0 100644 --- a/internal/services/managedapplications/client/client.go +++ b/internal/services/managedapplications/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/managedapplications/managed_application_definition_resource.go b/internal/services/managedapplications/managed_application_definition_resource.go index 64b11e03a7f1..007eeb2292c3 100644 --- a/internal/services/managedapplications/managed_application_definition_resource.go +++ b/internal/services/managedapplications/managed_application_definition_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/managedapplications/managed_application_resource.go b/internal/services/managedapplications/managed_application_resource.go index 86bbb5ae1239..8ea51586068a 100644 --- a/internal/services/managedapplications/managed_application_resource.go +++ b/internal/services/managedapplications/managed_application_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/managedidentity/federated_identity_credential_resource.go b/internal/services/managedidentity/federated_identity_credential_resource.go index 67cde27d5d8d..cb43ddeb2b9b 100644 --- a/internal/services/managedidentity/federated_identity_credential_resource.go +++ b/internal/services/managedidentity/federated_identity_credential_resource.go @@ -102,9 +102,7 @@ func (r FederatedIdentityCredentialResource) Create() sdk.ResourceFunc { } var payload managedidentities.FederatedIdentityCredential - if err := r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(config, &payload); err != nil { - return fmt.Errorf("mapping schema model to sdk model: %+v", err) - } + r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(config, &payload) if _, err := client.FederatedIdentityCredentialsCreateOrUpdate(ctx, id, payload); err != nil { return fmt.Errorf("creating %s: %+v", id, err) @@ -140,9 +138,7 @@ func (r FederatedIdentityCredentialResource) Read() sdk.ResourceFunc { schema.ResourceGroupName = id.ResourceGroupName parentId := commonids.NewUserAssignedIdentityID(id.SubscriptionId, id.ResourceGroupName, id.ResourceName) schema.ResourceName = parentId.ID() - if err := r.mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(*model, &schema); err != nil { - return fmt.Errorf("flattening model: %+v", err) - } + r.mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(*model, &schema) } return metadata.Encode(&schema) @@ -169,52 +165,28 @@ func (r FederatedIdentityCredentialResource) Delete() sdk.ResourceFunc { } } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredentialProperties) error { - - audiences := make([]string, 0) - for _, v := range input.Audience { - audiences = append(audiences, v) - } - output.Audiences = audiences - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredentialProperties) { + output.Audiences = input.Audience output.Issuer = input.Issuer output.Subject = input.Subject - return nil } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredentialProperties, output *FederatedIdentityCredentialResourceSchema) error { - - audiences := make([]string, 0) - for _, v := range input.Audiences { - audiences = append(audiences, v) - } - output.Audience = audiences - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredentialProperties, output *FederatedIdentityCredentialResourceSchema) { + output.Audience = input.Audiences output.Issuer = input.Issuer output.Subject = input.Subject - return nil } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredential) error { - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredential) { if output.Properties == nil { output.Properties = &managedidentities.FederatedIdentityCredentialProperties{} } - if err := r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input, output.Properties); err != nil { - return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "FederatedIdentityCredentialProperties", "Properties", err) - } - - return nil + r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input, output.Properties) } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredential, output *FederatedIdentityCredentialResourceSchema) error { - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredential, output *FederatedIdentityCredentialResourceSchema) { if input.Properties == nil { input.Properties = &managedidentities.FederatedIdentityCredentialProperties{} } - if err := r.mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(*input.Properties, output); err != nil { - return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "FederatedIdentityCredentialProperties", "Properties", err) - } - - return nil + r.mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(*input.Properties, output) } diff --git a/internal/services/managementgroup/client/client.go b/internal/services/managementgroup/client/client.go index c5bd72f6631a..d6b9d056110b 100644 --- a/internal/services/managementgroup/client/client.go +++ b/internal/services/managementgroup/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/managementgroup/management_group_data_source.go b/internal/services/managementgroup/management_group_data_source.go index 88b0de7ee328..19492a3c43e7 100644 --- a/internal/services/managementgroup/management_group_data_source.go +++ b/internal/services/managementgroup/management_group_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/managementgroup/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/managementgroup/validate" diff --git a/internal/services/managementgroup/management_group_resource.go b/internal/services/managementgroup/management_group_resource.go index a1e4e3545c7b..4d760d83ef7b 100644 --- a/internal/services/managementgroup/management_group_resource.go +++ b/internal/services/managementgroup/management_group_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/managementgroup/subscription_association_resource.go b/internal/services/managementgroup/subscription_association_resource.go index ba6f8e0c4ac2..b632af6af74d 100644 --- a/internal/services/managementgroup/subscription_association_resource.go +++ b/internal/services/managementgroup/subscription_association_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/managementgroup/subscription_association_resource_test.go b/internal/services/managementgroup/subscription_association_resource_test.go index bb3b98cd4ea2..28a2a77db27c 100644 --- a/internal/services/managementgroup/subscription_association_resource_test.go +++ b/internal/services/managementgroup/subscription_association_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mariadb/mariadb_server_resource.go b/internal/services/mariadb/mariadb_server_resource.go index a1494ff193ed..7f8c095a744a 100644 --- a/internal/services/mariadb/mariadb_server_resource.go +++ b/internal/services/mariadb/mariadb_server_resource.go @@ -403,7 +403,6 @@ func resourceMariaDbServerRead(d *pluginsdk.ResourceData, meta interface{}) erro d.Set("geo_redundant_backup_enabled", geoRedundant) d.Set("backup_retention_days", storage.BackupRetentionDays) d.Set("storage_mb", storage.StorageMB) - } // Computed diff --git a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go index 96a79953ce3b..07ddc3def80d 100644 --- a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go +++ b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go @@ -188,7 +188,6 @@ func mariaDbVirtualNetworkStateStatusCodeRefreshFunc(ctx context.Context, client if props := model.Properties; props != nil { log.Printf("[DEBUG] Retrieving %s returned Status %s", id, *props.State) return resp, string(*props.State), nil - } } diff --git a/internal/services/media/media_asset_filter_resource.go b/internal/services/media/media_asset_filter_resource.go index fe723508caf4..13a4fd5cd9ca 100644 --- a/internal/services/media/media_asset_filter_resource.go +++ b/internal/services/media/media_asset_filter_resource.go @@ -147,7 +147,7 @@ func resourceMediaAssetFilter() *pluginsdk.Resource { Optional: true, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "condition": { Type: pluginsdk.TypeList, Required: true, diff --git a/internal/services/media/media_content_key_policy_resource.go b/internal/services/media/media_content_key_policy_resource.go index 100b9d0f9957..e03860babb01 100644 --- a/internal/services/media/media_content_key_policy_resource.go +++ b/internal/services/media/media_content_key_policy_resource.go @@ -95,7 +95,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "playready_configuration_license": { Type: pluginsdk.TypeList, Optional: true, @@ -155,7 +155,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "play_right": { Type: pluginsdk.TypeList, Optional: true, @@ -245,7 +245,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "fairplay_configuration": { Type: pluginsdk.TypeList, Optional: true, @@ -270,7 +270,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "offline_rental_configuration": { Type: pluginsdk.TypeList, Optional: true, @@ -308,7 +308,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "token_restriction": { Type: pluginsdk.TypeList, Optional: true, @@ -362,7 +362,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { Optional: true, ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "required_claim": { Type: pluginsdk.TypeList, Optional: true, @@ -552,11 +552,7 @@ func flattenPolicyOptions(input []contentkeypolicies.ContentKeyPolicyOption) ([] } if v, ok := option.Configuration.(contentkeypolicies.ContentKeyPolicyPlayReadyConfiguration); ok { - license, err := flattenPlayReadyLicenses(v.Licenses) - if err != nil { - return nil, err - } - playReadyLicense = license + playReadyLicense = flattenPlayReadyLicenses(v.Licenses) } if v, ok := option.Configuration.(contentkeypolicies.ContentKeyPolicyWidevineConfiguration); ok { @@ -569,11 +565,7 @@ func flattenPolicyOptions(input []contentkeypolicies.ContentKeyPolicyOption) ([] openRestrictionEnabled = true } if v, ok := option.Restriction.(contentkeypolicies.ContentKeyPolicyTokenRestriction); ok { - restriction, err := flattenTokenRestriction(v) - if err != nil { - return nil, err - } - tokenRestriction = restriction + tokenRestriction = flattenTokenRestriction(v) } results = append(results, map[string]interface{}{ @@ -643,7 +635,7 @@ func expandRestriction(option map[string]interface{}) (contentkeypolicies.Conten return nil, fmt.Errorf("policy_option must contain at least one type of restriction: open_restriction_enabled or token_restriction.") } -func flattenTokenRestriction(input contentkeypolicies.ContentKeyPolicyTokenRestriction) ([]interface{}, error) { +func flattenTokenRestriction(input contentkeypolicies.ContentKeyPolicyTokenRestriction) []interface{} { openIDConnectDiscoveryDocument := "" if input.OpenIdConnectDiscoveryDocument != nil { openIDConnectDiscoveryDocument = *input.OpenIdConnectDiscoveryDocument @@ -688,7 +680,7 @@ func flattenTokenRestriction(input contentkeypolicies.ContentKeyPolicyTokenRestr "primary_rsa_token_key_exponent": rsaTokenKeyExponent, "primary_rsa_token_key_modulus": rsaTokenKeyModulus, }, - }, nil + } } func expandConfiguration(input map[string]interface{}) (contentkeypolicies.ContentKeyPolicyConfiguration, error) { @@ -698,7 +690,7 @@ func expandConfiguration(input map[string]interface{}) (contentkeypolicies.Conte widevineConfigurationTemplate := input["widevine_configuration_template"].(string) configurationCount := 0 - if clearKeyConfigurationEnabled != false { + if clearKeyConfigurationEnabled { configurationCount++ } if len(fairPlayConfigurations) > 0 { @@ -1010,7 +1002,7 @@ func expandPlayReadyLicenses(input []interface{}) (*[]contentkeypolicies.Content return &results, nil } -func flattenPlayReadyLicenses(input []contentkeypolicies.ContentKeyPolicyPlayReadyLicense) ([]interface{}, error) { +func flattenPlayReadyLicenses(input []contentkeypolicies.ContentKeyPolicyPlayReadyLicense) []interface{} { results := make([]interface{}, 0) for _, v := range input { beginDate := "" @@ -1069,7 +1061,7 @@ func flattenPlayReadyLicenses(input []contentkeypolicies.ContentKeyPolicyPlayRea }) } - return results, nil + return results } func expandPlayRight(input []interface{}) *contentkeypolicies.ContentKeyPolicyPlayReadyPlayRight { diff --git a/internal/services/media/media_streaming_endpoint_resource.go b/internal/services/media/media_streaming_endpoint_resource.go index 2d30403b52df..59f69ec58bed 100644 --- a/internal/services/media/media_streaming_endpoint_resource.go +++ b/internal/services/media/media_streaming_endpoint_resource.go @@ -84,7 +84,7 @@ func resourceMediaStreamingEndpoint() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "akamai_signature_header_authentication_key": { Type: pluginsdk.TypeList, Optional: true, @@ -109,7 +109,7 @@ func resourceMediaStreamingEndpoint() *pluginsdk.Resource { }, AtLeastOneOf: []string{"access_control.0.akamai_signature_header_authentication_key", "access_control.0.ip_allow"}, }, - //lintignore:XS003 + // lintignore:XS003 "ip_allow": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_live_event_resource.go b/internal/services/media/media_streaming_live_event_resource.go index 2601613597f0..29237d606fe5 100644 --- a/internal/services/media/media_streaming_live_event_resource.go +++ b/internal/services/media/media_streaming_live_event_resource.go @@ -76,7 +76,7 @@ func resourceMediaLiveEvent() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "ip_access_control_allow": { Type: pluginsdk.TypeList, Optional: true, @@ -249,7 +249,7 @@ func resourceMediaLiveEvent() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "ip_access_control_allow": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_locator_resource.go b/internal/services/media/media_streaming_locator_resource.go index 33657537723c..63b9a2c98363 100644 --- a/internal/services/media/media_streaming_locator_resource.go +++ b/internal/services/media/media_streaming_locator_resource.go @@ -87,7 +87,7 @@ func resourceMediaStreamingLocator() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "content_key": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_policy_resource.go b/internal/services/media/media_streaming_policy_resource.go index 1b4ac61d1923..6284bd621c19 100644 --- a/internal/services/media/media_streaming_policy_resource.go +++ b/internal/services/media/media_streaming_policy_resource.go @@ -275,7 +275,7 @@ func resourceMediaStreamingPolicyDelete(d *pluginsdk.ResourceData, meta interfac } func enabledProtocolsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, @@ -312,7 +312,7 @@ func enabledProtocolsSchema() *pluginsdk.Schema { } func defaultContentKeySchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_transform_resource.go b/internal/services/media/media_transform_resource.go index 268df8898ac1..1dd36e7297a0 100644 --- a/internal/services/media/media_transform_resource.go +++ b/internal/services/media/media_transform_resource.go @@ -72,7 +72,7 @@ func resourceMediaTransform() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "output": { Type: pluginsdk.TypeList, Optional: true, @@ -84,7 +84,7 @@ func resourceMediaTransform() *pluginsdk.Resource { Optional: true, ValidateFunc: validation.StringInSlice(encodings.PossibleValuesForOnErrorType(), false), }, - //lintignore:XS003 + // lintignore:XS003 "builtin_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -99,7 +99,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "audio_analyzer_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -136,7 +136,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "video_analyzer_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -178,7 +178,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "face_detector_preset": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/monitor/action_rule.go b/internal/services/monitor/action_rule.go index 207d019d7a5d..d1221c224d72 100644 --- a/internal/services/monitor/action_rule.go +++ b/internal/services/monitor/action_rule.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/monitor/alert_processing_rule.go b/internal/services/monitor/alert_processing_rule.go index 0aaac95df897..5d6bec9a7aa3 100644 --- a/internal/services/monitor/alert_processing_rule.go +++ b/internal/services/monitor/alert_processing_rule.go @@ -420,7 +420,6 @@ func expandAlertProcessingRuleSingleConditions(input []AlertProcessingRuleSingle Values: &values, }) } - return } func expandAlertProcessingRuleSchedule(input []AlertProcessingRuleScheduleModel) *alertprocessingrules.Schedule { @@ -569,7 +568,6 @@ func flattenAlertProcessingRuleConditions(input *[]alertprocessingrules.Conditio case alertprocessingrules.FieldTargetResourceType: condition.TargetResourceType = []AlertProcessingRuleSingleConditionModel{{string(*item.Operator), *item.Values}} } - } } diff --git a/internal/services/monitor/client/client.go b/internal/services/monitor/client/client.go index 1653ad619ff0..4bc33617c524 100644 --- a/internal/services/monitor/client/client.go +++ b/internal/services/monitor/client/client.go @@ -1,11 +1,11 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" - "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" - classic "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" - newActionGroupClient "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck + classic "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck + newActionGroupClient "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionendpoints" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionruleassociations" diff --git a/internal/services/monitor/common_monitor.go b/internal/services/monitor/common_monitor.go index b9e9d648d0bf..c51759b3150d 100644 --- a/internal/services/monitor/common_monitor.go +++ b/internal/services/monitor/common_monitor.go @@ -1,7 +1,7 @@ package monitor import ( - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go b/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go index e136a2297adf..05dc2652c364 100644 --- a/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go +++ b/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" + "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" authRuleParse "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/authorizationrulesnamespaces" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/monitor/monitor_action_group_resource.go b/internal/services/monitor/monitor_action_group_resource.go index faa7117ce9a6..18931e02bc57 100644 --- a/internal/services/monitor/monitor_action_group_resource.go +++ b/internal/services/monitor/monitor_action_group_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/monitor/monitor_action_rule_action_group_resource.go b/internal/services/monitor/monitor_action_rule_action_group_resource.go index 326026fd426a..5e6ea990b7ca 100644 --- a/internal/services/monitor/monitor_action_rule_action_group_resource.go +++ b/internal/services/monitor/monitor_action_rule_action_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_action_rule_suppression_resource.go b/internal/services/monitor/monitor_action_rule_suppression_resource.go index f87413a3c0b4..ca55cc36668b 100644 --- a/internal/services/monitor/monitor_action_rule_suppression_resource.go +++ b/internal/services/monitor/monitor_action_rule_suppression_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_activity_log_alert_resource.go b/internal/services/monitor/monitor_activity_log_alert_resource.go index 391fe876cd89..29fd6d328380 100644 --- a/internal/services/monitor/monitor_activity_log_alert_resource.go +++ b/internal/services/monitor/monitor_activity_log_alert_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" + "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -159,7 +159,7 @@ func resourceMonitorActivityLogAlert() *pluginsdk.Resource { Optional: true, ConflictsWith: []string{"criteria.0.recommendation_category", "criteria.0.recommendation_impact"}, }, - //lintignore:XS003 + // lintignore:XS003 "resource_health": { Type: pluginsdk.TypeList, Computed: true, @@ -217,7 +217,7 @@ func resourceMonitorActivityLogAlert() *pluginsdk.Resource { }, ConflictsWith: []string{"criteria.0.recommendation_category", "criteria.0.recommendation_impact", "criteria.0.status", "criteria.0.sub_status", "criteria.0.recommendation_impact", "criteria.0.resource_provider", "criteria.0.resource_type", "criteria.0.operation_name", "criteria.0.caller", "criteria.0.operation_name", "criteria.0.service_health"}, }, - //lintignore:XS003 + // lintignore:XS003 "service_health": { Type: pluginsdk.TypeList, Computed: true, diff --git a/internal/services/monitor/monitor_autoscale_setting_resource.go b/internal/services/monitor/monitor_autoscale_setting_resource.go index c9da34378e1f..5d8cb9b2cee4 100644 --- a/internal/services/monitor/monitor_autoscale_setting_resource.go +++ b/internal/services/monitor/monitor_autoscale_setting_resource.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/monitor/monitor_data_collection_endpoint_resource.go b/internal/services/monitor/monitor_data_collection_endpoint_resource.go index 698dfdcb6af9..647a6ddc205c 100644 --- a/internal/services/monitor/monitor_data_collection_endpoint_resource.go +++ b/internal/services/monitor/monitor_data_collection_endpoint_resource.go @@ -244,7 +244,6 @@ func (r DataCollectionEndpointResource) Update() sdk.ResourceFunc { return fmt.Errorf("updating %s: %+v", *id, err) } return nil - }, Timeout: 30 * time.Minute, } diff --git a/internal/services/monitor/monitor_data_collection_rule_resource.go b/internal/services/monitor/monitor_data_collection_rule_resource.go index d0fda2b62f38..166241a3b9b0 100644 --- a/internal/services/monitor/monitor_data_collection_rule_resource.go +++ b/internal/services/monitor/monitor_data_collection_rule_resource.go @@ -535,7 +535,6 @@ func (r DataCollectionRuleResource) Update() sdk.ResourceFunc { return fmt.Errorf("updating %s: %+v", *id, err) } return nil - }, Timeout: 30 * time.Minute, } @@ -616,7 +615,6 @@ func expandDataCollectionRuleDataSources(input []DataSource) (*datacollectionrul Syslog: expandDataCollectionRuleDataSourceSyslog(input[0].Syslog), WindowsEventLogs: expandDataCollectionRuleDataSourceWindowsEventLogs(input[0].WindowsEventLogs), }, nil - } func expandDataCollectionRuleDataSourceExtensions(input []Extension) (*[]datacollectionrules.ExtensionDataSource, error) { diff --git a/internal/services/monitor/monitor_diagnostic_categories_data_source.go b/internal/services/monitor/monitor_diagnostic_categories_data_source.go index 6bf806fa63f2..88f75bd52ad6 100644 --- a/internal/services/monitor/monitor_diagnostic_categories_data_source.go +++ b/internal/services/monitor/monitor_diagnostic_categories_data_source.go @@ -102,9 +102,7 @@ func dataSourceMonitorDiagnosticCategoriesRead(d *pluginsdk.ResourceData, meta i if category := v.Properties; category != nil { if category.CategoryGroups != nil { - for _, item := range *category.CategoryGroups { - categoryGroups = append(categoryGroups, item) - } + categoryGroups = append(categoryGroups, *category.CategoryGroups...) } if category.CategoryType != nil { switch *category.CategoryType { diff --git a/internal/services/monitor/monitor_log_profile_resource.go b/internal/services/monitor/monitor_log_profile_resource.go index 96fcdc657f2c..27a83fa98da0 100644 --- a/internal/services/monitor/monitor_log_profile_resource.go +++ b/internal/services/monitor/monitor_log_profile_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/monitor/monitor_metric_alert_resource.go b/internal/services/monitor/monitor_metric_alert_resource.go index 1d5ad29890b3..c8ccdf5af87e 100644 --- a/internal/services/monitor/monitor_metric_alert_resource.go +++ b/internal/services/monitor/monitor_metric_alert_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -171,7 +171,7 @@ func resourceMonitorMetricAlert() *pluginsdk.Resource { }, }, - //lintignore: S018 + // lintignore: S018 "dynamic_criteria": { Type: pluginsdk.TypeList, Optional: true, @@ -544,7 +544,7 @@ func resourceMonitorMetricAlertRead(d *pluginsdk.ResourceData, meta interface{}) } monitorMetricAlertCriteria := flattenMonitorMetricAlertCriteria(alert.Criteria) - //lintignore:R001 + // lintignore:R001 if err := d.Set(criteriaSchema, monitorMetricAlertCriteria); err != nil { return fmt.Errorf("failed setting `%s`: %+v", criteriaSchema, err) } diff --git a/internal/services/monitor/monitor_private_link_scope_resource.go b/internal/services/monitor/monitor_private_link_scope_resource.go index 62e59df2d9a5..63c42a5475bd 100644 --- a/internal/services/monitor/monitor_private_link_scope_resource.go +++ b/internal/services/monitor/monitor_private_link_scope_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_private_link_scoped_service_resource.go b/internal/services/monitor/monitor_private_link_scoped_service_resource.go index 0eccd9fcff6f..abd4331278c6 100644 --- a/internal/services/monitor/monitor_private_link_scoped_service_resource.go +++ b/internal/services/monitor/monitor_private_link_scoped_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionendpoints" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go index de0dadf962dc..4e734fae79c1 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go index e72ed9b6f05a..4135e6bb5e19 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go index 855635a12d32..0238caeab15d 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go @@ -437,19 +437,9 @@ func (r ScheduledQueryRulesAlertV2Resource) Create() sdk.ResourceFunc { Tags: &model.Tags, } - actionsValue, err := expandScheduledQueryRulesAlertV2ActionsModel(model.Actions) - if err != nil { - return err - } - - properties.Properties.Actions = actionsValue - - criteriaValue, err := expandScheduledQueryRulesAlertV2CriteriaModel(model.Criteria) - if err != nil { - return err - } + properties.Properties.Actions = expandScheduledQueryRulesAlertV2ActionsModel(model.Actions) - properties.Properties.Criteria = criteriaValue + properties.Properties.Criteria = expandScheduledQueryRulesAlertV2CriteriaModel(model.Criteria) if model.Description != "" { properties.Properties.Description = &model.Description @@ -515,12 +505,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("action") { - actionsValue, err := expandScheduledQueryRulesAlertV2ActionsModel(resourceModel.Actions) - if err != nil { - return err - } - - model.Properties.Actions = actionsValue + model.Properties.Actions = expandScheduledQueryRulesAlertV2ActionsModel(resourceModel.Actions) } if metadata.ResourceData.HasChange("auto_mitigation_enabled") { @@ -532,12 +517,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("criteria") { - criteriaValue, err := expandScheduledQueryRulesAlertV2CriteriaModel(resourceModel.Criteria) - if err != nil { - return err - } - - model.Properties.Criteria = criteriaValue + model.Properties.Criteria = expandScheduledQueryRulesAlertV2CriteriaModel(resourceModel.Criteria) } if metadata.ResourceData.HasChange("description") { @@ -646,12 +626,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Read() sdk.ResourceFunc { } properties := &model.Properties - actionsValue, err := flattenScheduledQueryRulesAlertV2ActionsModel(properties.Actions) - if err != nil { - return err - } - - state.Actions = actionsValue + state.Actions = flattenScheduledQueryRulesAlertV2ActionsModel(properties.Actions) if properties.AutoMitigate != nil { state.AutoMitigate = *properties.AutoMitigate @@ -665,12 +640,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Read() sdk.ResourceFunc { state.CreatedWithApiVersion = *properties.CreatedWithApiVersion } - criteriaValue, err := flattenScheduledQueryRulesAlertV2CriteriaModel(properties.Criteria) - if err != nil { - return err - } - - state.Criteria = criteriaValue + state.Criteria = flattenScheduledQueryRulesAlertV2CriteriaModel(properties.Criteria) if properties.Description != nil { state.Description = *properties.Description @@ -752,9 +722,9 @@ func (r ScheduledQueryRulesAlertV2Resource) Delete() sdk.ResourceFunc { } } -func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRulesAlertV2ActionsModel) (*scheduledqueryrules.Actions, error) { +func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRulesAlertV2ActionsModel) *scheduledqueryrules.Actions { if len(inputList) == 0 { - return nil, nil + return nil } input := &inputList[0] @@ -763,10 +733,10 @@ func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRule CustomProperties: &input.CustomProperties, } - return &output, nil + return &output } -func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRulesAlertV2CriteriaModel) (*scheduledqueryrules.ScheduledQueryRuleCriteria, error) { +func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRulesAlertV2CriteriaModel) *scheduledqueryrules.ScheduledQueryRuleCriteria { output := scheduledqueryrules.ScheduledQueryRuleCriteria{} var outputList []scheduledqueryrules.Condition for _, v := range inputList { @@ -777,19 +747,8 @@ func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRul TimeAggregation: &input.TimeAggregation, } - dimensionsValue, err := expandScheduledQueryRulesAlertV2DimensionModel(input.Dimensions) - if err != nil { - return nil, err - } - - condition.Dimensions = dimensionsValue - - failingPeriodsValue, err := expandScheduledQueryRulesAlertV2FailingPeriodsModel(input.FailingPeriods) - if err != nil { - return nil, err - } - - condition.FailingPeriods = failingPeriodsValue + condition.Dimensions = expandScheduledQueryRulesAlertV2DimensionModel(input.Dimensions) + condition.FailingPeriods = expandScheduledQueryRulesAlertV2FailingPeriodsModel(input.FailingPeriods) if input.MetricMeasureColumn != "" { condition.MetricMeasureColumn = &input.MetricMeasureColumn @@ -806,10 +765,10 @@ func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRul outputList = append(outputList, condition) } output.AllOf = &outputList - return &output, nil + return &output } -func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRulesAlertV2DimensionModel) (*[]scheduledqueryrules.Dimension, error) { +func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRulesAlertV2DimensionModel) *[]scheduledqueryrules.Dimension { var outputList []scheduledqueryrules.Dimension for _, v := range inputList { input := v @@ -822,12 +781,12 @@ func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRu outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQueryRulesAlertV2FailingPeriodsModel) (*scheduledqueryrules.ConditionFailingPeriods, error) { +func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQueryRulesAlertV2FailingPeriodsModel) *scheduledqueryrules.ConditionFailingPeriods { if len(inputList) == 0 { - return nil, nil + return nil } input := &inputList[0] @@ -836,13 +795,13 @@ func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQu NumberOfEvaluationPeriods: &input.NumberOfEvaluationPeriods, } - return &output, nil + return &output } -func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Actions) ([]ScheduledQueryRulesAlertV2ActionsModel, error) { +func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Actions) []ScheduledQueryRulesAlertV2ActionsModel { var outputList []ScheduledQueryRulesAlertV2ActionsModel if input == nil { - return outputList, nil + return outputList } output := ScheduledQueryRulesAlertV2ActionsModel{} @@ -855,36 +814,25 @@ func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Ac output.CustomProperties = *input.CustomProperties } - return append(outputList, output), nil + return append(outputList, output) } -func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.ScheduledQueryRuleCriteria) ([]ScheduledQueryRulesAlertV2CriteriaModel, error) { +func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.ScheduledQueryRuleCriteria) []ScheduledQueryRulesAlertV2CriteriaModel { var outputList []ScheduledQueryRulesAlertV2CriteriaModel if input == nil { - return outputList, nil + return outputList } inputList := input.AllOf if inputList == nil { - return outputList, nil + return outputList } for _, v := range *inputList { output := ScheduledQueryRulesAlertV2CriteriaModel{} - dimensionsValue, err := flattenScheduledQueryRulesAlertV2DimensionModel(v.Dimensions) - if err != nil { - return nil, err - } - - output.Dimensions = dimensionsValue - - failingPeriodsValue, err := flattenScheduledQueryRulesAlertV2FailingPeriodsModel(v.FailingPeriods) - if err != nil { - return nil, err - } - - output.FailingPeriods = failingPeriodsValue + output.Dimensions = flattenScheduledQueryRulesAlertV2DimensionModel(v.Dimensions) + output.FailingPeriods = flattenScheduledQueryRulesAlertV2FailingPeriodsModel(v.FailingPeriods) if v.MetricMeasureColumn != nil { output.MetricMeasureColumn = *v.MetricMeasureColumn @@ -913,13 +861,13 @@ func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.S outputList = append(outputList, output) } - return outputList, nil + return outputList } -func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledqueryrules.Dimension) ([]ScheduledQueryRulesAlertV2DimensionModel, error) { +func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledqueryrules.Dimension) []ScheduledQueryRulesAlertV2DimensionModel { var outputList []ScheduledQueryRulesAlertV2DimensionModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -932,13 +880,13 @@ func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledquery outputList = append(outputList, output) } - return outputList, nil + return outputList } -func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryrules.ConditionFailingPeriods) ([]ScheduledQueryRulesAlertV2FailingPeriodsModel, error) { +func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryrules.ConditionFailingPeriods) []ScheduledQueryRulesAlertV2FailingPeriodsModel { var outputList []ScheduledQueryRulesAlertV2FailingPeriodsModel if input == nil { - return outputList, nil + return outputList } output := ScheduledQueryRulesAlertV2FailingPeriodsModel{} @@ -951,5 +899,5 @@ func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryr output.NumberOfEvaluationPeriods = *input.NumberOfEvaluationPeriods } - return append(outputList, output), nil + return append(outputList, output) } diff --git a/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go b/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go index 09dd2c5fb2cc..1c1b0bf45087 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go index 67240b94520c..9dbbd742f5de 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go b/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go index 52e6f4ce9c27..8ddbce969979 100644 --- a/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go +++ b/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/validate/workspace_id.go b/internal/services/monitor/validate/workspace_id.go index 506a17f5562d..ad740b9cc6dc 100644 --- a/internal/services/monitor/validate/workspace_id.go +++ b/internal/services/monitor/validate/workspace_id.go @@ -24,7 +24,6 @@ func WorkspaceID(input interface{}, key string) (warnings []string, errors []err errors = append(errors, fmt.Errorf("expected the in %q to be a valid UUID, but got %q", key, segments[1])) return } - } else { errors = append(errors, fmt.Errorf("expected %q in the format { 0 { diff --git a/internal/services/network/network_connection_monitor_resource.go b/internal/services/network/network_connection_monitor_resource.go index 1ccb3652903d..866b7a7715fd 100644 --- a/internal/services/network/network_connection_monitor_resource.go +++ b/internal/services/network/network_connection_monitor_resource.go @@ -301,7 +301,7 @@ func resourceNetworkConnectionMonitorSchema() map[string]*pluginsdk.Schema { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "success_threshold": { Type: pluginsdk.TypeList, Optional: true, @@ -469,11 +469,7 @@ func resourceNetworkConnectionMonitorCreateUpdate(d *pluginsdk.ResourceData, met }, } - if v, err := expandNetworkConnectionMonitorEndpoint(d.Get("endpoint").(*pluginsdk.Set).List()); err == nil { - properties.ConnectionMonitorParameters.Endpoints = v - } else { - return err - } + properties.ConnectionMonitorParameters.Endpoints = expandNetworkConnectionMonitorEndpoint(d.Get("endpoint").(*pluginsdk.Set).List()) if notes, ok := d.GetOk("notes"); ok { properties.Notes = utils.String(notes.(string)) @@ -572,7 +568,7 @@ func resourceNetworkConnectionMonitorDelete(d *pluginsdk.ResourceData, meta inte return nil } -func expandNetworkConnectionMonitorEndpoint(input []interface{}) (*[]network.ConnectionMonitorEndpoint, error) { +func expandNetworkConnectionMonitorEndpoint(input []interface{}) *[]network.ConnectionMonitorEndpoint { results := make([]network.ConnectionMonitorEndpoint, 0) for _, item := range input { @@ -628,7 +624,7 @@ func expandNetworkConnectionMonitorEndpoint(input []interface{}) (*[]network.Con results = append(results, result) } - return &results, nil + return &results } func expandNetworkConnectionMonitorEndpointFilter(input []interface{}) *network.ConnectionMonitorEndpointFilter { diff --git a/internal/services/network/network_manager_resource.go b/internal/services/network/network_manager_resource.go index 6d2c05469408..3400d784ad3f 100644 --- a/internal/services/network/network_manager_resource.go +++ b/internal/services/network/network_manager_resource.go @@ -283,7 +283,6 @@ func (r ManagerResource) Update() sdk.ResourceFunc { return fmt.Errorf("updating %s: %+v", *id, err) } return nil - }, Timeout: 30 * time.Minute, } diff --git a/internal/services/network/network_manager_resource_test.go b/internal/services/network/network_manager_resource_test.go index 5d3ca97a87d5..b06536f1fe4a 100644 --- a/internal/services/network/network_manager_resource_test.go +++ b/internal/services/network/network_manager_resource_test.go @@ -163,7 +163,6 @@ resource "azurerm_network_manager" "import" { } func (r ManagerResource) complete(data acceptance.TestData) string { - return fmt.Sprintf(` %s resource "azurerm_network_manager" "test" { diff --git a/internal/services/network/private_endpoint_resource.go b/internal/services/network/private_endpoint_resource.go index 95e80f476bb3..b3d1cffaa102 100644 --- a/internal/services/network/private_endpoint_resource.go +++ b/internal/services/network/private_endpoint_resource.go @@ -642,7 +642,6 @@ func resourcePrivateEndpointRead(d *pluginsdk.ResourceData, meta interface{}) er customNicName = *props.CustomNetworkInterfaceName } d.Set("custom_network_interface_name", customNicName) - } privateDnsZoneConfigs := make([]interface{}, 0) diff --git a/internal/services/network/vpn_server_configuration_resource.go b/internal/services/network/vpn_server_configuration_resource.go index 162b5cf74daa..e3efacc04ef0 100644 --- a/internal/services/network/vpn_server_configuration_resource.go +++ b/internal/services/network/vpn_server_configuration_resource.go @@ -492,7 +492,6 @@ func resourceVPNServerConfigurationRead(d *pluginsdk.ResourceData, meta interfac if err := d.Set("radius", flattenedRadius); err != nil { return fmt.Errorf("setting `radius`: %+v", err) } - } vpnAuthenticationTypes := make([]interface{}, 0) diff --git a/internal/services/policy/assignment.go b/internal/services/policy/assignment.go index 0648938045ee..663eb2e9d05c 100644 --- a/internal/services/policy/assignment.go +++ b/internal/services/policy/assignment.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/policy/assignment_base_resource.go b/internal/services/policy/assignment_base_resource.go index e6e742e158ad..01b78168e913 100644 --- a/internal/services/policy/assignment_base_resource.go +++ b/internal/services/policy/assignment_base_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -155,7 +155,7 @@ func (br assignmentBaseResource) readFunc(scopeFieldName string) sdk.ResourceFun metadata.ResourceData.Set("name", id.Name) metadata.ResourceData.Set("location", location.NormalizeNilable(resp.Location)) - //lintignore:R001 + // lintignore:R001 metadata.ResourceData.Set(scopeFieldName, id.Scope) identity, _ := br.flattenIdentity(resp.Identity) diff --git a/internal/services/policy/assignment_data_source.go b/internal/services/policy/assignment_data_source.go index 31e87a7dd340..46cfa7ae4401 100644 --- a/internal/services/policy/assignment_data_source.go +++ b/internal/services/policy/assignment_data_source.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/policy/client/client.go b/internal/services/policy/client/client.go index 2d57570ae7f3..ee833cf4d09a 100644 --- a/internal/services/policy/client/client.go +++ b/internal/services/policy/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" - policyPreview "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck + policyPreview "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/policy/exemption_management_group.go b/internal/services/policy/exemption_management_group.go index bbe7ef0d8710..0c231ed96c4a 100644 --- a/internal/services/policy/exemption_management_group.go +++ b/internal/services/policy/exemption_management_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_resource.go b/internal/services/policy/exemption_resource.go index 56c4fabbd6f5..7cd8b37573d6 100644 --- a/internal/services/policy/exemption_resource.go +++ b/internal/services/policy/exemption_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_resource_group.go b/internal/services/policy/exemption_resource_group.go index 3408d76729db..98857bcb8518 100644 --- a/internal/services/policy/exemption_resource_group.go +++ b/internal/services/policy/exemption_resource_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_subscription.go b/internal/services/policy/exemption_subscription.go index ff3f22616e8a..a121caf43095 100644 --- a/internal/services/policy/exemption_subscription.go +++ b/internal/services/policy/exemption_subscription.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/policy/policy.go b/internal/services/policy/policy.go index de51556ac519..7fefa678e6f7 100644 --- a/internal/services/policy/policy.go +++ b/internal/services/policy/policy.go @@ -6,7 +6,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/policy/policy_definition_data_source.go b/internal/services/policy/policy_definition_data_source.go index 1fa9df6b6b0b..4cb9df72cbf5 100644 --- a/internal/services/policy/policy_definition_data_source.go +++ b/internal/services/policy/policy_definition_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/policy/policy_definition_resource.go b/internal/services/policy/policy_definition_resource.go index e5568a1b9983..fdd3e4c105d5 100644 --- a/internal/services/policy/policy_definition_resource.go +++ b/internal/services/policy/policy_definition_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_definition_resource_test.go b/internal/services/policy/policy_definition_resource_test.go index e9ac643a01ab..c40204f1e14d 100644 --- a/internal/services/policy/policy_definition_resource_test.go +++ b/internal/services/policy/policy_definition_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_set_definition_data_source.go b/internal/services/policy/policy_set_definition_data_source.go index 1f25723873d7..2ce680abe456 100644 --- a/internal/services/policy/policy_set_definition_data_source.go +++ b/internal/services/policy/policy_set_definition_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/policy/policy_set_definition_resource.go b/internal/services/policy/policy_set_definition_resource.go index fc35120b231f..55f7cdaa64c7 100644 --- a/internal/services/policy/policy_set_definition_resource.go +++ b/internal/services/policy/policy_set_definition_resource.go @@ -10,7 +10,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -99,7 +99,7 @@ func resourcePolicySetDefinitionSchema() map[string]*pluginsdk.Schema { DiffSuppressFunc: pluginsdk.SuppressJsonDiff, }, - //lintignore: S013 + // lintignore: S013 "policy_definition_reference": { Type: pluginsdk.TypeList, Required: true, diff --git a/internal/services/policy/policy_set_definition_resource_test.go b/internal/services/policy/policy_set_definition_resource_test.go index 8eef42d42554..b21f274068ad 100644 --- a/internal/services/policy/policy_set_definition_resource_test.go +++ b/internal/services/policy/policy_set_definition_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go b/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go index be259c34b355..5896e8b3271c 100644 --- a/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go +++ b/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" diff --git a/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go b/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go index 014a8fcf61fb..e871ce42eacb 100644 --- a/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go +++ b/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/policy/remediation_management_group.go b/internal/services/policy/remediation_management_group.go index 712934193d97..a555cf0169ff 100644 --- a/internal/services/policy/remediation_management_group.go +++ b/internal/services/policy/remediation_management_group.go @@ -208,7 +208,7 @@ func resourceArmManagementGroupPolicyRemediationDelete(d *pluginsdk.ResourceData return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtManagementGroup(ctx, *id) return err @@ -225,7 +225,6 @@ func resourceArmManagementGroupPolicyRemediationDelete(d *pluginsdk.ResourceData func managementGroupPolicyRemediationCancellationRefreshFunc(ctx context.Context, client *remediations.RemediationsClient, id remediations.Providers2RemediationId) pluginsdk.StateRefreshFunc { - return func() (interface{}, string, error) { resp, err := client.RemediationsGetAtManagementGroup(ctx, id) if err != nil { diff --git a/internal/services/policy/remediation_resource.go b/internal/services/policy/remediation_resource.go index 23444ff16a27..82b40c32e44a 100644 --- a/internal/services/policy/remediation_resource.go +++ b/internal/services/policy/remediation_resource.go @@ -201,7 +201,7 @@ func resourceArmResourcePolicyRemediationDelete(d *pluginsdk.ResourceData, meta return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), @@ -236,14 +236,13 @@ func resourcePolicyRemediationCancellationRefreshFunc(ctx context.Context, clien } } -// waitRemediationToDelete waits for the remediation to a status that allow to delete -func waitRemediationToDelete(ctx context.Context, +// waitForRemediationToDelete waits for the remediation to a status that allow to delete +func waitForRemediationToDelete(ctx context.Context, prop *remediations.RemediationProperties, id string, timeout time.Duration, cancelFunc func() error, refresh pluginsdk.StateRefreshFunc) error { - if prop == nil { return nil } diff --git a/internal/services/policy/remediation_resource_group.go b/internal/services/policy/remediation_resource_group.go index 17cd1dd3b3f6..5272b75e2550 100644 --- a/internal/services/policy/remediation_resource_group.go +++ b/internal/services/policy/remediation_resource_group.go @@ -207,14 +207,14 @@ func resourceArmResourceGroupPolicyRemediationDelete(d *pluginsdk.ResourceData, return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtResourceGroup(ctx, *id) return err }, resourceGroupPolicyRemediationCancellationRefreshFunc(ctx, client, *id), ); err != nil { - + return fmt.Errorf("waiting for remediation to delete %s: %+v", id, err) } _, err = client.RemediationsDeleteAtResourceGroup(ctx, *id) diff --git a/internal/services/policy/remediation_subscription.go b/internal/services/policy/remediation_subscription.go index 8c76fa7102e4..a78f5c7ca728 100644 --- a/internal/services/policy/remediation_subscription.go +++ b/internal/services/policy/remediation_subscription.go @@ -206,7 +206,7 @@ func resourceArmSubscriptionPolicyRemediationDelete(d *pluginsdk.ResourceData, m return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtSubscription(ctx, *id) return err diff --git a/internal/services/postgres/postgresql_aad_administrator_resource.go b/internal/services/postgres/postgresql_aad_administrator_resource.go index 906115bf4c7f..680faadcbda9 100644 --- a/internal/services/postgres/postgresql_aad_administrator_resource.go +++ b/internal/services/postgres/postgresql_aad_administrator_resource.go @@ -137,7 +137,6 @@ func resourcePostgreSQLAdministratorRead(d *pluginsdk.ResourceData, meta interfa d.Set("object_id", props.Sid) d.Set("tenant_id", props.TenantId) } - } return nil diff --git a/internal/services/postgres/postgresql_flexible_server_data_source.go b/internal/services/postgres/postgresql_flexible_server_data_source.go index d6b447f20304..d4afeab86b33 100644 --- a/internal/services/postgres/postgresql_flexible_server_data_source.go +++ b/internal/services/postgres/postgresql_flexible_server_data_source.go @@ -124,7 +124,6 @@ func dataSourceArmPostgresqlFlexibleServerRead(d *pluginsdk.ResourceData, meta i } d.Set("public_network_access_enabled", publicNetworkAccess) } - } sku, err := flattenFlexibleServerSku(model.Sku) diff --git a/internal/services/postgres/postgresql_flexible_server_resource.go b/internal/services/postgres/postgresql_flexible_server_resource.go index 76051cdf7f37..d6d585bea4d7 100644 --- a/internal/services/postgres/postgresql_flexible_server_resource.go +++ b/internal/services/postgres/postgresql_flexible_server_resource.go @@ -451,7 +451,6 @@ func resourcePostgresqlFlexibleServerRead(d *pluginsdk.ResourceData, meta interf d.Set("sku_name", sku) return tags.FlattenAndSet(d, model.Tags) - } return nil @@ -481,11 +480,9 @@ func resourcePostgresqlFlexibleServerUpdate(d *pluginsdk.ResourceData, meta inte props := resp.Model.Properties if d.HasChange("zone") { - if !d.HasChange("high_availability.0.standby_availability_zone") { return fmt.Errorf("`zone` can only be changed when exchanged with the zone specified in `high_availability.0.standby_availability_zone`") } else { - // zone can only be changed when it is swapped for an existing high_availability.0.standby_availability_zone - a failover is triggered to make it the new primary availability zone // compare current values of zone and high_availability.0.standby_availability_zone with new values and only allow update/failover if the values of zone and an existing high_availability.0.standby_availability_zone have been swapped var newZone, newHAStandbyZone string diff --git a/internal/services/postgres/postgresql_server_resource.go b/internal/services/postgres/postgresql_server_resource.go index 4b2559e7dcee..1ec21ce76bef 100644 --- a/internal/services/postgres/postgresql_server_resource.go +++ b/internal/services/postgres/postgresql_server_resource.go @@ -507,7 +507,6 @@ func resourcePostgreSQLServerCreate(d *pluginsdk.ResourceData, meta interface{}) if err = securityClient.CreateOrUpdateThenPoll(ctx, securityAlertId, *alert); err != nil { return fmt.Errorf("updataing security alert policy for %s: %v", id, err) } - } } diff --git a/internal/services/privatedns/private_dns_ptr_record_resource.go b/internal/services/privatedns/private_dns_ptr_record_resource.go index 8dcccb2dd7d1..d931a4f63f71 100644 --- a/internal/services/privatedns/private_dns_ptr_record_resource.go +++ b/internal/services/privatedns/private_dns_ptr_record_resource.go @@ -162,7 +162,6 @@ func resourcePrivateDnsPtrRecordRead(d *pluginsdk.ResourceData, meta interface{} } return tags.FlattenAndSet(d, props.Metadata) - } } diff --git a/internal/services/privatedns/private_dns_soa_record_data_source.go b/internal/services/privatedns/private_dns_soa_record_data_source.go index 614ae5258efa..c04519b9d0a5 100644 --- a/internal/services/privatedns/private_dns_soa_record_data_source.go +++ b/internal/services/privatedns/private_dns_soa_record_data_source.go @@ -122,7 +122,6 @@ func dataSourcePrivateDnsSoaRecordRead(d *pluginsdk.ResourceData, meta interface return tags.FlattenAndSet(d, props.Metadata) } - } return nil diff --git a/internal/services/privatedns/private_dns_txt_record_data_source.go b/internal/services/privatedns/private_dns_txt_record_data_source.go index e95913ac01ac..5cd3bcdad28b 100644 --- a/internal/services/privatedns/private_dns_txt_record_data_source.go +++ b/internal/services/privatedns/private_dns_txt_record_data_source.go @@ -94,7 +94,6 @@ func dataSourcePrivateDnsTxtRecordRead(d *pluginsdk.ResourceData, meta interface } return tags.FlattenAndSet(d, props.Metadata) - } } diff --git a/internal/services/privatedns/private_dns_zone_data_source.go b/internal/services/privatedns/private_dns_zone_data_source.go index 6e112d3b3ef9..a5b6e7bcf457 100644 --- a/internal/services/privatedns/private_dns_zone_data_source.go +++ b/internal/services/privatedns/private_dns_zone_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/privatednsresolver/client/client.go b/internal/services/privatednsresolver/client/client.go index b41bbe9b26d5..c1a5cf2a1d6a 100644 --- a/internal/services/privatednsresolver/client/client.go +++ b/internal/services/privatednsresolver/client/client.go @@ -20,7 +20,6 @@ type Client struct { } func NewClient(o *common.ClientOptions) *Client { - dnsForwardingRulesetsClient := dnsforwardingrulesets.NewDnsForwardingRulesetsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&dnsForwardingRulesetsClient.Client, o.ResourceManagerAuthorizer) diff --git a/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go b/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go index 938e7db70f94..6a04612c5603 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go @@ -96,10 +96,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Create() sdk.ResourceFun Tags: &model.Tags, } - dnsResolverOutboundEndpointsValue, err := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) - if err != nil { - return err - } + dnsResolverOutboundEndpointsValue := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) if dnsResolverOutboundEndpointsValue != nil { properties.Properties.DnsResolverOutboundEndpoints = *dnsResolverOutboundEndpointsValue @@ -142,10 +139,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Update() sdk.ResourceFun } if metadata.ResourceData.HasChange("dns_resolver_outbound_endpoints") { - dnsResolverOutboundEndpointsValue, err := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) - if err != nil { - return err - } + dnsResolverOutboundEndpointsValue := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) if dnsResolverOutboundEndpointsValue != nil { properties.Properties.DnsResolverOutboundEndpoints = *dnsResolverOutboundEndpointsValue @@ -199,12 +193,8 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Read() sdk.ResourceFunc } properties := &model.Properties - dnsResolverOutboundEndpointsValue, err := flattenDnsResolverOutboundEndpoints(&properties.DnsResolverOutboundEndpoints) - if err != nil { - return err - } - state.DnsResolverOutboundEndpoints = dnsResolverOutboundEndpointsValue + state.DnsResolverOutboundEndpoints = flattenDnsResolverOutboundEndpoints(&properties.DnsResolverOutboundEndpoints) if model.Tags != nil { state.Tags = *model.Tags @@ -235,7 +225,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Delete() sdk.ResourceFun } } -func expandDnsResolverOutboundEndpoints(inputList []string) (*[]dnsforwardingrulesets.SubResource, error) { +func expandDnsResolverOutboundEndpoints(inputList []string) *[]dnsforwardingrulesets.SubResource { var outputList []dnsforwardingrulesets.SubResource for _, v := range inputList { output := dnsforwardingrulesets.SubResource{ @@ -244,13 +234,13 @@ func expandDnsResolverOutboundEndpoints(inputList []string) (*[]dnsforwardingrul outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubResource) ([]string, error) { +func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubResource) []string { var outputList []string if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -258,5 +248,5 @@ func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubR outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go b/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go index b14f86fcd136..49451c049ef6 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go @@ -141,11 +141,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Create() sdk.ResourceFunc { }, } - targetDnsServersValue, err := expandTargetDnsServerModel(model.TargetDnsServers) - if err != nil { - return err - } - + targetDnsServersValue := expandTargetDnsServerModel(model.TargetDnsServers) if targetDnsServersValue != nil { properties.Properties.TargetDnsServers = *targetDnsServersValue } @@ -203,10 +199,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("target_dns_servers") { - targetDnsServersValue, err := expandTargetDnsServerModel(model.TargetDnsServers) - if err != nil { - return err - } + targetDnsServersValue := expandTargetDnsServerModel(model.TargetDnsServers) if targetDnsServersValue != nil { properties.Properties.TargetDnsServers = *targetDnsServersValue @@ -266,12 +259,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Read() sdk.ResourceFunc { state.Metadata = *properties.Metadata } - targetDnsServersValue, err := flattenTargetDnsServerModel(&properties.TargetDnsServers) - if err != nil { - return err - } - - state.TargetDnsServers = targetDnsServersValue + state.TargetDnsServers = flattenTargetDnsServerModel(&properties.TargetDnsServers) return metadata.Encode(&state) }, @@ -298,7 +286,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Delete() sdk.ResourceFunc { } } -func expandTargetDnsServerModel(inputList []TargetDnsServerModel) (*[]forwardingrules.TargetDnsServer, error) { +func expandTargetDnsServerModel(inputList []TargetDnsServerModel) *[]forwardingrules.TargetDnsServer { var outputList []forwardingrules.TargetDnsServer for _, v := range inputList { input := v @@ -310,13 +298,13 @@ func expandTargetDnsServerModel(inputList []TargetDnsServerModel) (*[]forwarding outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) ([]TargetDnsServerModel, error) { +func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) []TargetDnsServerModel { var outputList []TargetDnsServerModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -331,5 +319,5 @@ func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) ( outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go index 88112a74cd32..bc9b0bf77505 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go @@ -133,10 +133,7 @@ func (r PrivateDNSResolverInboundEndpointResource) Create() sdk.ResourceFunc { Tags: &model.Tags, } - iPConfigurationsValue, err := expandIPConfigurationModel(model.IPConfigurations) - if err != nil { - return err - } + iPConfigurationsValue := expandIPConfigurationModel(model.IPConfigurations) if iPConfigurationsValue != nil { properties.Properties.IPConfigurations = *iPConfigurationsValue @@ -179,10 +176,7 @@ func (r PrivateDNSResolverInboundEndpointResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("ip_configurations") { - iPConfigurationsValue, err := expandIPConfigurationModel(model.IPConfigurations) - if err != nil { - return err - } + iPConfigurationsValue := expandIPConfigurationModel(model.IPConfigurations) if iPConfigurationsValue != nil { properties.Properties.IPConfigurations = *iPConfigurationsValue @@ -236,12 +230,8 @@ func (r PrivateDNSResolverInboundEndpointResource) Read() sdk.ResourceFunc { } properties := &model.Properties - iPConfigurationsValue, err := flattenIPConfigurationModel(&properties.IPConfigurations) - if err != nil { - return err - } - state.IPConfigurations = iPConfigurationsValue + state.IPConfigurations = flattenIPConfigurationModel(&properties.IPConfigurations) if model.Tags != nil { state.Tags = *model.Tags } @@ -301,7 +291,7 @@ func dnsResolverInboundEndpointDeleteRefreshFunc(ctx context.Context, client *in } } -func expandIPConfigurationModel(inputList []IPConfigurationModel) (*[]inboundendpoints.IPConfiguration, error) { +func expandIPConfigurationModel(inputList []IPConfigurationModel) *[]inboundendpoints.IPConfiguration { var outputList []inboundendpoints.IPConfiguration for _, v := range inputList { input := v @@ -322,13 +312,13 @@ func expandIPConfigurationModel(inputList []IPConfigurationModel) (*[]inboundend outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) ([]IPConfigurationModel, error) { +func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) []IPConfigurationModel { var outputList []IPConfigurationModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -347,5 +337,5 @@ func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/purview/purview_account_resource.go b/internal/services/purview/purview_account_resource.go index 6fcdd2f9a9a9..a1b00dca6263 100644 --- a/internal/services/purview/purview_account_resource.go +++ b/internal/services/purview/purview_account_resource.go @@ -119,7 +119,6 @@ func resourcePurviewAccountRead(d *pluginsdk.ResourceData, meta interface{}) err d.Set("resource_group_name", id.ResourceGroupName) if model := resp.Model; model != nil { - d.Set("location", location.NormalizeNilable(model.Location)) flattenedIdentity, err := identity.FlattenSystemOrUserAssignedMap(model.Identity) diff --git a/internal/services/recoveryservices/backup_container_storage_account_resource.go b/internal/services/recoveryservices/backup_container_storage_account_resource.go index 4c8760c8c443..d8231357f3cc 100644 --- a/internal/services/recoveryservices/backup_container_storage_account_resource.go +++ b/internal/services/recoveryservices/backup_container_storage_account_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_file_share_resource.go b/internal/services/recoveryservices/backup_policy_file_share_resource.go index 0a43ccf5a6ee..45d41c7b9dbd 100644 --- a/internal/services/recoveryservices/backup_policy_file_share_resource.go +++ b/internal/services/recoveryservices/backup_policy_file_share_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_vm_resource.go b/internal/services/recoveryservices/backup_policy_vm_resource.go index b94552977544..0c4c370d13cf 100644 --- a/internal/services/recoveryservices/backup_policy_vm_resource.go +++ b/internal/services/recoveryservices/backup_policy_vm_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_vm_resource_test.go b/internal/services/recoveryservices/backup_policy_vm_resource_test.go index b8f13e6a10ad..56b7cde1f332 100644 --- a/internal/services/recoveryservices/backup_policy_vm_resource_test.go +++ b/internal/services/recoveryservices/backup_policy_vm_resource_test.go @@ -587,6 +587,7 @@ resource "azurerm_backup_policy_vm" "test" { `, r.template(data), data.RandomInteger) } +// nolint: unparam func (r BackupProtectionPolicyVMResource) basicHourly(data acceptance.TestData, policyType string) string { return fmt.Sprintf(` %s diff --git a/internal/services/recoveryservices/backup_policy_vm_workload_resource.go b/internal/services/recoveryservices/backup_policy_vm_workload_resource.go index abd9f4cca0f9..231dad90836f 100644 --- a/internal/services/recoveryservices/backup_policy_vm_workload_resource.go +++ b/internal/services/recoveryservices/backup_policy_vm_workload_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -632,19 +632,19 @@ func expandBackupProtectionPolicyVMWorkloadProtectionPolicies(input []Protection return nil, fmt.Errorf("`retention_daily` must be set when `backup.0.frequency` is `Daily`") } - if weekdays := backupBlock.Weekdays; weekdays != nil && len(weekdays) > 0 { + if weekdays := backupBlock.Weekdays; len(weekdays) > 0 { return nil, fmt.Errorf("`backup.0.weekdays` should be not set when `backup.0.frequency` is `Daily`") } case string(backup.ScheduleRunTypeWeekly): - if item.RetentionDaily != nil && len(item.RetentionDaily) > 0 { + if len(item.RetentionDaily) > 0 { return nil, fmt.Errorf("`retention_daily` must be not set when `backup.0.frequency` is `Weekly`") } - if item.PolicyType != string(backup.PolicyTypeLog) && (backupBlock.Weekdays == nil || len(backupBlock.Weekdays) == 0) { + if item.PolicyType != string(backup.PolicyTypeLog) && len(backupBlock.Weekdays) == 0 { return nil, fmt.Errorf("`backup.weekdays` must be set when `policy_type` is not `Log` and `backup.frequency` is `Weekly`") } - if item.PolicyType == string(backup.PolicyTypeFull) && (item.RetentionWeekly == nil || len(item.RetentionWeekly) == 0) { + if item.PolicyType == string(backup.PolicyTypeFull) && len(item.RetentionWeekly) == 0 { return nil, fmt.Errorf("`retention_weekly` must be set when `policy_type` is `Full` and `backup.frequency` is `Weekly`") } } @@ -723,11 +723,11 @@ func expandBackupProtectionPolicyVMWorkloadSchedulePolicy(input ProtectionPolicy schedule.ScheduleRunFrequency = backup.ScheduleRunType(backupBlock.Frequency) } - if times != nil && len(times) > 0 { + if len(times) > 0 { schedule.ScheduleRunTimes = × } - if v := backupBlock.Weekdays; v != nil && len(v) > 0 { + if v := backupBlock.Weekdays; len(v) > 0 { days := make([]backup.DayOfWeek, 0) for _, day := range v { days = append(days, backup.DayOfWeek(day)) @@ -803,7 +803,7 @@ func expandBackupProtectionPolicyVMWorkloadRetentionPolicy(input ProtectionPolic }, } - if v := retentionWeekly.Weekdays; v != nil && len(v) > 0 { + if v := retentionWeekly.Weekdays; len(v) > 0 { days := make([]backup.DayOfWeek, 0) for _, day := range v { days = append(days, backup.DayOfWeek(day)) @@ -1012,7 +1012,7 @@ func flattenBackupProtectionPolicyVMWorkloadSimpleRetention(input *backup.Retent } func expandBackupProtectionPolicyVMWorkloadRetentionDailyFormat(input []int) *backup.DailyRetentionFormat { - if input == nil || len(input) == 0 { + if len(input) == 0 { return nil } @@ -1038,13 +1038,13 @@ func expandBackupProtectionPolicyVMWorkloadRetentionDailyFormat(input []int) *ba } func expandBackupProtectionPolicyVMWorkloadRetentionWeeklyFormat(weekdays, weeks []string) *backup.WeeklyRetentionFormat { - if (weekdays == nil && weeks == nil) || (len(weekdays) == 0 && len(weeks) == 0) { + if len(weekdays) == 0 && len(weeks) == 0 { return nil } weekly := backup.WeeklyRetentionFormat{} - if weekdays != nil && len(weekdays) > 0 { + if len(weekdays) > 0 { weekdaysBlock := make([]backup.DayOfWeek, 0) for _, day := range weekdays { weekdaysBlock = append(weekdaysBlock, backup.DayOfWeek(day)) @@ -1052,7 +1052,7 @@ func expandBackupProtectionPolicyVMWorkloadRetentionWeeklyFormat(weekdays, weeks weekly.DaysOfTheWeek = &weekdaysBlock } - if weeks != nil && len(weeks) > 0 { + if len(weeks) > 0 { weeksBlock := make([]backup.WeekOfMonth, 0) for _, week := range weeks { weeksBlock = append(weeksBlock, backup.WeekOfMonth(week)) diff --git a/internal/services/recoveryservices/backup_protected_file_share_resource.go b/internal/services/recoveryservices/backup_protected_file_share_resource.go index b0454def6ca9..ca55510c3928 100644 --- a/internal/services/recoveryservices/backup_protected_file_share_resource.go +++ b/internal/services/recoveryservices/backup_protected_file_share_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_protected_vm_resource.go b/internal/services/recoveryservices/backup_protected_vm_resource.go index 94a869c680aa..72554fc599f9 100644 --- a/internal/services/recoveryservices/backup_protected_vm_resource.go +++ b/internal/services/recoveryservices/backup_protected_vm_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -109,7 +109,7 @@ func resourceRecoveryServicesBackupProtectedVMCreateUpdate(d *pluginsdk.Resource return fmt.Errorf("creating/updating Azure Backup Protected VM %q (Resource Group %q): %+v", protectedItemName, resourceGroup, err) } - resp, err := resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, policyId, d) + resp, err := resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, d) if err != nil { return err } @@ -196,13 +196,13 @@ func resourceRecoveryServicesBackupProtectedVMDelete(d *pluginsdk.ResourceData, return nil } -func resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, policyId string, d *pluginsdk.ResourceData) (backup.ProtectedItemResource, error) { +func resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, d *pluginsdk.ResourceData) (backup.ProtectedItemResource, error) { state := &pluginsdk.StateChangeConf{ MinTimeout: 30 * time.Second, Delay: 10 * time.Second, Pending: []string{"NotFound"}, Target: []string{"Found"}, - Refresh: resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, policyId, true), + Refresh: resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx, client, vaultName, resourceGroup, containerName, protectedItemName), } if d.IsNewResource() { @@ -258,7 +258,7 @@ func resourceRecoveryServicesBackupProtectedVMWaitForDeletion(ctx context.Contex return resp.(backup.ProtectedItemResource), nil } -func resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, policyId string, newResource bool) pluginsdk.StateRefreshFunc { +func resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.Get(ctx, vaultName, resourceGroup, "Azure", containerName, protectedItemName, "") if err != nil { diff --git a/internal/services/recoveryservices/client/client.go b/internal/services/recoveryservices/client/client.go index b6bd1f97be98..0b98f4716a2c 100644 --- a/internal/services/recoveryservices/client/client.go +++ b/internal/services/recoveryservices/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/recoveryservices/recovery_services_vault_resource.go b/internal/services/recoveryservices/recovery_services_vault_resource.go index 4f5767d2fa47..6a932d350a41 100644 --- a/internal/services/recoveryservices/recovery_services_vault_resource.go +++ b/internal/services/recoveryservices/recovery_services_vault_resource.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/recoveryservices/site_recovery_fabric_resource.go b/internal/services/recoveryservices/site_recovery_fabric_resource.go index 278a94c5334d..61add8ed2b94 100644 --- a/internal/services/recoveryservices/site_recovery_fabric_resource.go +++ b/internal/services/recoveryservices/site_recovery_fabric_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go index 326973bd3d99..77c54b080064 100644 --- a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go +++ b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go b/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go index b87e5335fbb6..fcdf0c7ad97a 100644 --- a/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go +++ b/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_protection_container_resource.go b/internal/services/recoveryservices/site_recovery_protection_container_resource.go index 0f165b80f035..18f511217e40 100644 --- a/internal/services/recoveryservices/site_recovery_protection_container_resource.go +++ b/internal/services/recoveryservices/site_recovery_protection_container_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go index 45702ad17928..7c966686b9c4 100644 --- a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go +++ b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/recoveryservices/site_recovery_replication_policy_resource.go b/internal/services/recoveryservices/site_recovery_replication_policy_resource.go index 016464b08249..d18ddaa2ece6 100644 --- a/internal/services/recoveryservices/site_recovery_replication_policy_resource.go +++ b/internal/services/recoveryservices/site_recovery_replication_policy_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redis/client/client.go b/internal/services/redis/client/client.go index 6b54aefaec61..c42dac3e290d 100644 --- a/internal/services/redis/client/client.go +++ b/internal/services/redis/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/redis/redis_cache_resource.go b/internal/services/redis/redis_cache_resource.go index 353ea3ab7502..1f42d86bc906 100644 --- a/internal/services/redis/redis_cache_resource.go +++ b/internal/services/redis/redis_cache_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/redis/redis_cache_resource_test.go b/internal/services/redis/redis_cache_resource_test.go index f77f76f76cb8..0a105e3ceb29 100644 --- a/internal/services/redis/redis_cache_resource_test.go +++ b/internal/services/redis/redis_cache_resource_test.go @@ -1285,7 +1285,6 @@ resource "azurerm_redis_cache" "test" { } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) - } func (RedisCacheResource) userAssignedIdentity(data acceptance.TestData) string { diff --git a/internal/services/redis/redis_firewall_rule_resource.go b/internal/services/redis/redis_firewall_rule_resource.go index 0465f508ff10..fe989a7d7997 100644 --- a/internal/services/redis/redis_firewall_rule_resource.go +++ b/internal/services/redis/redis_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redis/redis_linked_server_resource.go b/internal/services/redis/redis_linked_server_resource.go index aa96c6b2495d..04fec875173f 100644 --- a/internal/services/redis/redis_linked_server_resource.go +++ b/internal/services/redis/redis_linked_server_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go b/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go index eafa7610ed38..4bbfe8238852 100644 --- a/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go +++ b/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/redisenterprise/mgmt/2021-03-01/redisenterprise" + "github.com/Azure/azure-sdk-for-go/services/redisenterprise/mgmt/2021-03-01/redisenterprise" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" ) diff --git a/internal/services/resource/client/client.go b/internal/services/resource/client/client.go index 7724c0e38eaf..029cb5a48a13 100644 --- a/internal/services/resource/client/client.go +++ b/internal/services/resource/client/client.go @@ -2,10 +2,10 @@ package client import ( providers "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/resource/management_group_template_deployment_resource.go b/internal/services/resource/management_group_template_deployment_resource.go index c454cb2e325e..d48851b240c3 100644 --- a/internal/services/resource/management_group_template_deployment_resource.go +++ b/internal/services/resource/management_group_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -42,7 +42,7 @@ func managementGroupTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/management_lock_resource.go b/internal/services/resource/management_lock_resource.go index afe8b72286a8..7273fd7d37c6 100644 --- a/internal/services/resource/management_lock_resource.go +++ b/internal/services/resource/management_lock_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/parse" diff --git a/internal/services/resource/resource_group_resource.go b/internal/services/resource/resource_group_resource.go index 4eba2f54ff89..a778cb212f33 100644 --- a/internal/services/resource/resource_group_resource.go +++ b/internal/services/resource/resource_group_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/resource/resource_group_template_deployment_resource.go b/internal/services/resource/resource_group_template_deployment_resource.go index 62329b28f524..8b9584eed38e 100644 --- a/internal/services/resource/resource_group_template_deployment_resource.go +++ b/internal/services/resource/resource_group_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -39,7 +39,7 @@ func resourceGroupTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/resource_provider_registration_resource.go b/internal/services/resource/resource_provider_registration_resource.go index fd08d113d79b..bcc056982fc6 100644 --- a/internal/services/resource/resource_provider_registration_resource.go +++ b/internal/services/resource/resource_provider_registration_resource.go @@ -8,7 +8,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/resourceproviders" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/resource/resources_data_source.go b/internal/services/resource/resources_data_source.go index c9f58bb6939e..75d24b8a931b 100644 --- a/internal/services/resource/resources_data_source.go +++ b/internal/services/resource/resources_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/resource/subscription_template_deployment_resource.go b/internal/services/resource/subscription_template_deployment_resource.go index 3ea6e1605614..b07890f2e130 100644 --- a/internal/services/resource/subscription_template_deployment_resource.go +++ b/internal/services/resource/subscription_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -40,7 +40,7 @@ func subscriptionTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/template_deployment_common.go b/internal/services/resource/template_deployment_common.go index 55cc7a6ade48..2b5ea1e82b39 100644 --- a/internal/services/resource/template_deployment_common.go +++ b/internal/services/resource/template_deployment_common.go @@ -11,7 +11,7 @@ import ( "time" providers "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client" diff --git a/internal/services/resource/template_deployment_resource.go b/internal/services/resource/template_deployment_resource.go index 86667c46c981..967e8dad7686 100644 --- a/internal/services/resource/template_deployment_resource.go +++ b/internal/services/resource/template_deployment_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/resource/tenant_template_deployment_resource.go b/internal/services/resource/tenant_template_deployment_resource.go index 2a5c4fe74904..28864bfec459 100644 --- a/internal/services/resource/tenant_template_deployment_resource.go +++ b/internal/services/resource/tenant_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -40,7 +40,7 @@ func tenantTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/search/search_service_data_source.go b/internal/services/search/search_service_data_source.go index dc7c6db6762f..cca0f2a3ebd7 100644 --- a/internal/services/search/search_service_data_source.go +++ b/internal/services/search/search_service_data_source.go @@ -151,7 +151,6 @@ func dataSourceSearchServiceRead(d *pluginsdk.ResourceData, meta interface{}) er if err == nil { if model := queryKeysResp.Model; model != nil { d.Set("query_keys", flattenSearchQueryKeys(*model)) - } } diff --git a/internal/services/search/search_service_resource.go b/internal/services/search/search_service_resource.go index 851a5861a240..04e6d1b16435 100644 --- a/internal/services/search/search_service_resource.go +++ b/internal/services/search/search_service_resource.go @@ -289,7 +289,6 @@ func resourceSearchServiceRead(d *pluginsdk.ResourceData, meta interface{}) erro if err == nil { if model := queryKeysResp.Model; model != nil { d.Set("query_keys", flattenSearchQueryKeys(*model)) - } } diff --git a/internal/services/securitycenter/advanced_threat_protection_resource.go b/internal/services/securitycenter/advanced_threat_protection_resource.go index 380bdceddaff..508f434520d4 100644 --- a/internal/services/securitycenter/advanced_threat_protection_resource.go +++ b/internal/services/securitycenter/advanced_threat_protection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/advanced_threat_protection_resource_test.go b/internal/services/securitycenter/advanced_threat_protection_resource_test.go index 82232ac4dae9..5b08aa8b0756 100644 --- a/internal/services/securitycenter/advanced_threat_protection_resource_test.go +++ b/internal/services/securitycenter/advanced_threat_protection_resource_test.go @@ -40,16 +40,15 @@ func TestAccAdvancedThreatProtection_storageAccount(t *testing.T) { } func TestAccAdvancedThreatProtection_cosmosAccount(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_advanced_threat_protection", "test") - - // nolint unused - r := AdvancedThreatProtectionResource{} - // the API errors on deleting the cosmos DB account some of the time so lets skip this test for now // TODO: remove once this is fixed: https://github.com/Azure/azure-sdk-for-go/issues/6310 // run it multiple times in a row as it only fails 50% of the time t.Skip() + data := acceptance.BuildTestData(t, "azurerm_advanced_threat_protection", "test") + + r := AdvancedThreatProtectionResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.cosmosAccount(data, true, true), diff --git a/internal/services/securitycenter/azuresdkhacks/security_center_contact.go b/internal/services/securitycenter/azuresdkhacks/security_center_contact.go index 4e28a2834ec1..79f575d3c7cf 100644 --- a/internal/services/securitycenter/azuresdkhacks/security_center_contact.go +++ b/internal/services/securitycenter/azuresdkhacks/security_center_contact.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" diff --git a/internal/services/securitycenter/azuresdkhacks/security_center_setting.go b/internal/services/securitycenter/azuresdkhacks/security_center_setting.go index ec5bf848cd64..ac80f1f771ee 100644 --- a/internal/services/securitycenter/azuresdkhacks/security_center_setting.go +++ b/internal/services/securitycenter/azuresdkhacks/security_center_setting.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" ) diff --git a/internal/services/securitycenter/client/client.go b/internal/services/securitycenter/client/client.go index 40208c7c4a7a..59b9c87acf70 100644 --- a/internal/services/securitycenter/client/client.go +++ b/internal/services/securitycenter/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/securitycenter/iot_security_device_group_resource.go b/internal/services/securitycenter/iot_security_device_group_resource.go index 11fbda4a2f96..e90cf8a476ed 100644 --- a/internal/services/securitycenter/iot_security_device_group_resource.go +++ b/internal/services/securitycenter/iot_security_device_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/iot_security_solution_resource.go b/internal/services/securitycenter/iot_security_solution_resource.go index 8386fe8da445..59b3d3c555fd 100644 --- a/internal/services/securitycenter/iot_security_solution_resource.go +++ b/internal/services/securitycenter/iot_security_solution_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/securitycenter/security_center_assessment_policy_resource.go b/internal/services/securitycenter/security_center_assessment_policy_resource.go index 8cfd7303c825..16c76f1f41cc 100644 --- a/internal/services/securitycenter/security_center_assessment_policy_resource.go +++ b/internal/services/securitycenter/security_center_assessment_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_assessment_resource.go b/internal/services/securitycenter/security_center_assessment_resource.go index 5124c3c45f40..659ce53cd778 100644 --- a/internal/services/securitycenter/security_center_assessment_resource.go +++ b/internal/services/securitycenter/security_center_assessment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_auto_provisioning_resource.go b/internal/services/securitycenter/security_center_auto_provisioning_resource.go index 64e0d3db1c0b..27ad2c7517a8 100644 --- a/internal/services/securitycenter/security_center_auto_provisioning_resource.go +++ b/internal/services/securitycenter/security_center_auto_provisioning_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/parse" diff --git a/internal/services/securitycenter/security_center_automation_resource.go b/internal/services/securitycenter/security_center_automation_resource.go index b089a2321711..5baa0e0dff68 100644 --- a/internal/services/securitycenter/security_center_automation_resource.go +++ b/internal/services/securitycenter/security_center_automation_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/securitycenter/security_center_contact_resource.go b/internal/services/securitycenter/security_center_contact_resource.go index 3fdcba24ed23..0c90b681668f 100644 --- a/internal/services/securitycenter/security_center_contact_resource.go +++ b/internal/services/securitycenter/security_center_contact_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" diff --git a/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go b/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go index e435b11ea828..f52d923f8149 100644 --- a/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go +++ b/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go b/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go index e61b260c0d14..dafdee6ea31f 100644 --- a/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go +++ b/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" computeParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" @@ -144,7 +144,6 @@ func resourceServerVulnerabilityAssessmentVirtualMachineDelete(d *pluginsdk.Reso func serverVulnerabilityAssessmentVirtualMachineStateRefreshFunc(ctx context.Context, client *security.ServerVulnerabilityAssessmentClient, resourceGroup, name string) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - resp, err := client.Get(ctx, resourceGroup, computeProvider, vmType, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { diff --git a/internal/services/securitycenter/security_center_setting_resource.go b/internal/services/securitycenter/security_center_setting_resource.go index 9c449e565af3..6461ec28e053 100644 --- a/internal/services/securitycenter/security_center_setting_resource.go +++ b/internal/services/securitycenter/security_center_setting_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/azuresdkhacks" diff --git a/internal/services/securitycenter/security_center_setting_resource_test.go b/internal/services/securitycenter/security_center_setting_resource_test.go index 24ca4bfddc8d..5b1e9bef373d 100644 --- a/internal/services/securitycenter/security_center_setting_resource_test.go +++ b/internal/services/securitycenter/security_center_setting_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -31,7 +31,7 @@ func testAccSecurityCenterSetting_update(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_security_center_setting", "test") r := SecurityCenterSettingResource{} - //lintignore:AT001 + // lintignore:AT001 data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.cfg("MCAS", true), diff --git a/internal/services/securitycenter/security_center_subscription_pricing_resource.go b/internal/services/securitycenter/security_center_subscription_pricing_resource.go index 92ba0946b247..216bc130c09f 100644 --- a/internal/services/securitycenter/security_center_subscription_pricing_resource.go +++ b/internal/services/securitycenter/security_center_subscription_pricing_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go b/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go index d7809a1be2bb..d7388cda380e 100644 --- a/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go +++ b/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go @@ -45,7 +45,6 @@ func TestAccServerVulnerabilityAssessment(t *testing.T) { Config: SecurityCenterSubscriptionPricingResource{}.tier("Free", "VirtualMachines"), }, }) - } func TestAccSecurityCenterSubscriptionPricing_update(t *testing.T) { @@ -119,7 +118,7 @@ resource "azurerm_security_center_subscription_pricing" "test" { } func (SecurityCenterSubscriptionPricingResource) storageAccountSubplan() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -129,5 +128,5 @@ resource "azurerm_security_center_subscription_pricing" "test" { resource_type = "StorageAccounts" subplan = "PerStorageAccount" } -`) +` } diff --git a/internal/services/securitycenter/security_center_workspace_resource.go b/internal/services/securitycenter/security_center_workspace_resource.go index f61c9cd77aaf..3debad6a6fea 100644 --- a/internal/services/securitycenter/security_center_workspace_resource.go +++ b/internal/services/securitycenter/security_center_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sentinel/client/client.go b/internal/services/sentinel/client/client.go index 01ad9e868b81..bd0511cba523 100644 --- a/internal/services/sentinel/client/client.go +++ b/internal/services/sentinel/client/client.go @@ -1,7 +1,7 @@ package client import ( - alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" + alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights" ) diff --git a/internal/services/sentinel/sentinel_alert_rule_template_data_source.go b/internal/services/sentinel/sentinel_alert_rule_template_data_source.go index c40ee6602b63..5ca7f4df3369 100644 --- a/internal/services/sentinel/sentinel_alert_rule_template_data_source.go +++ b/internal/services/sentinel/sentinel_alert_rule_template_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/migration" @@ -173,9 +173,9 @@ func dataSourceSentinelAlertRuleTemplateRead(d *pluginsdk.ResourceData, meta int switch template := resp.(type) { case securityinsight.MLBehaviorAnalyticsAlertRuleTemplate: - err = setForMLBehaviorAnalyticsAlertRuleTemplate(d, id, &template) + setForMLBehaviorAnalyticsAlertRuleTemplate(d, id, &template) case securityinsight.FusionAlertRuleTemplate: - err = setForFusionAlertRuleTemplate(d, id, &template) + setForFusionAlertRuleTemplate(d, id, &template) case securityinsight.MicrosoftSecurityIncidentCreationAlertRuleTemplate: err = setForMsSecurityIncidentAlertRuleTemplate(d, id, &template) case securityinsight.ScheduledAlertRuleTemplate: @@ -267,18 +267,16 @@ func setForMsSecurityIncidentAlertRuleTemplate(d *pluginsdk.ResourceData, id par return d.Set("security_incident_template", flattenMsSecurityIncidentAlertRuleTemplate(template.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties)) } -func setForFusionAlertRuleTemplate(d *pluginsdk.ResourceData, id parse.SentinelAlertRuleTemplateId, template *securityinsight.FusionAlertRuleTemplate) error { +func setForFusionAlertRuleTemplate(d *pluginsdk.ResourceData, id parse.SentinelAlertRuleTemplateId, template *securityinsight.FusionAlertRuleTemplate) { d.SetId(id.ID()) d.Set("name", template.Name) d.Set("display_name", template.DisplayName) - return nil } -func setForMLBehaviorAnalyticsAlertRuleTemplate(d *pluginsdk.ResourceData, id parse.SentinelAlertRuleTemplateId, template *securityinsight.MLBehaviorAnalyticsAlertRuleTemplate) error { +func setForMLBehaviorAnalyticsAlertRuleTemplate(d *pluginsdk.ResourceData, id parse.SentinelAlertRuleTemplateId, template *securityinsight.MLBehaviorAnalyticsAlertRuleTemplate) { d.SetId(id.ID()) d.Set("name", template.Name) d.Set("display_name", template.DisplayName) - return nil } func flattenScheduledAlertRuleTemplate(input *securityinsight.ScheduledAlertRuleTemplateProperties) []interface{} { diff --git a/internal/services/sentinel/sentinel_automation_rule_resource.go b/internal/services/sentinel/sentinel_automation_rule_resource.go index 2a16ffc7e905..55df65aaea9b 100644 --- a/internal/services/sentinel/sentinel_automation_rule_resource.go +++ b/internal/services/sentinel/sentinel_automation_rule_resource.go @@ -433,7 +433,6 @@ func expandAutomationRuleConditions(input []interface{}) *[]securityinsight.Basi }, ConditionType: securityinsight.ConditionTypeBasicAutomationRuleConditionConditionTypeProperty, }) - } return &out } diff --git a/internal/services/servicebus/migration/namespace_auth_rule.go b/internal/services/servicebus/migration/namespace_auth_rule.go index 2395be459743..6570b264bff8 100644 --- a/internal/services/servicebus/migration/namespace_auth_rule.go +++ b/internal/services/servicebus/migration/namespace_auth_rule.go @@ -84,7 +84,6 @@ func (ServicebusNamespaceAuthRuleV0ToV1) Schema() map[string]*pluginsdk.Schema { func (ServicebusNamespaceAuthRuleV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { - oldID := rawState["id"].(string) id, err := namespacesauthorizationrule.ParseAuthorizationRuleIDInsensitively(oldID) diff --git a/internal/services/servicebus/migration/namespace_network_rule_set.go b/internal/services/servicebus/migration/namespace_network_rule_set.go index 25ea9d3adf93..23899222acef 100644 --- a/internal/services/servicebus/migration/namespace_network_rule_set.go +++ b/internal/services/servicebus/migration/namespace_network_rule_set.go @@ -65,10 +65,7 @@ func (NamespaceNetworkRuleSetV0ToV1) Schema() map[string]*pluginsdk.Schema { func (NamespaceNetworkRuleSetV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { // removing the constant URI suffix from the id since it isn't needed - oldId := rawState["id"].(string) - if strings.HasSuffix(oldId, "/networkrulesets/default") { - oldId = strings.TrimSuffix(oldId, "/networkrulesets/default") - } + oldId := strings.TrimSuffix(rawState["id"].(string), "/networkrulesets/default") id, err := namespaces.ParseNamespaceID(oldId) if err != nil { diff --git a/internal/services/servicebus/migration/subscription.go b/internal/services/servicebus/migration/subscription.go index 2931abf633a5..904cd710c481 100644 --- a/internal/services/servicebus/migration/subscription.go +++ b/internal/services/servicebus/migration/subscription.go @@ -89,7 +89,6 @@ func (ServiceBusSubscriptionV0ToV1) Schema() map[string]*pluginsdk.Schema { func (ServiceBusSubscriptionV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { - oldId := rawState["id"].(string) id, err := subscriptions.ParseSubscriptions2ID(oldId) if err != nil { diff --git a/internal/services/servicebus/servicebus_namespace_resource.go b/internal/services/servicebus/servicebus_namespace_resource.go index e2b30daa6ec5..dc94e22091b6 100644 --- a/internal/services/servicebus/servicebus_namespace_resource.go +++ b/internal/services/servicebus/servicebus_namespace_resource.go @@ -317,30 +317,29 @@ func resourceServiceBusNamespaceRead(d *pluginsdk.ResourceData, meta interface{} } d.Set("sku", skuName) d.Set("capacity", sku.Capacity) - } - if props := model.Properties; model != nil { - d.Set("zone_redundant", props.ZoneRedundant) - if customerManagedKey, err := flattenServiceBusNamespaceEncryption(props.Encryption); err == nil { - d.Set("customer_managed_key", customerManagedKey) - } - localAuthEnabled := true - if props.DisableLocalAuth != nil { - localAuthEnabled = !*props.DisableLocalAuth - } - d.Set("local_auth_enabled", localAuthEnabled) + if props := model.Properties; props != nil { + d.Set("zone_redundant", props.ZoneRedundant) + if customerManagedKey, err := flattenServiceBusNamespaceEncryption(props.Encryption); err == nil { + d.Set("customer_managed_key", customerManagedKey) + } + localAuthEnabled := true + if props.DisableLocalAuth != nil { + localAuthEnabled = !*props.DisableLocalAuth + } + d.Set("local_auth_enabled", localAuthEnabled) - publicNetworkAccess := true - if props.PublicNetworkAccess != nil && *props.PublicNetworkAccess == namespaces.PublicNetworkAccessDisabled { - publicNetworkAccess = false - } - d.Set("public_network_access_enabled", publicNetworkAccess) + publicNetworkAccess := true + if props.PublicNetworkAccess != nil && *props.PublicNetworkAccess == namespaces.PublicNetworkAccessDisabled { + publicNetworkAccess = false + } + d.Set("public_network_access_enabled", publicNetworkAccess) - if props.MinimumTlsVersion != nil { - d.Set("minimum_tls_version", *props.MinimumTlsVersion) + if props.MinimumTlsVersion != nil { + d.Set("minimum_tls_version", *props.MinimumTlsVersion) + } } } - } authRuleId := namespacesauthorizationrule.NewAuthorizationRuleID(id.SubscriptionId, id.ResourceGroupName, id.NamespaceName, serviceBusNamespaceDefaultAuthorizationRule) diff --git a/internal/services/servicebus/servicebus_subscription_resource.go b/internal/services/servicebus/servicebus_subscription_resource.go index 70d9a755b86d..3479f4da96b2 100644 --- a/internal/services/servicebus/servicebus_subscription_resource.go +++ b/internal/services/servicebus/servicebus_subscription_resource.go @@ -306,7 +306,6 @@ func resourceServiceBusSubscriptionRead(d *pluginsdk.ResourceData, meta interfac clientScopedEnabled = true } d.Set("client_scoped_subscription", flattenServiceBusNamespaceClientScopedSubscription(props.ClientAffineProperties)) - } } diff --git a/internal/services/servicebus/servicebus_topic_resource.go b/internal/services/servicebus/servicebus_topic_resource.go index cafc1bdac87a..59e2fddfc990 100644 --- a/internal/services/servicebus/servicebus_topic_resource.go +++ b/internal/services/servicebus/servicebus_topic_resource.go @@ -205,7 +205,6 @@ func resourceServiceBusTopicCreateUpdate(d *pluginsdk.ResourceData, meta interfa } parameters.Properties.MaxMessageSizeInKilobytes = utils.Int64(int64(v.(int))) } - } if _, err := client.CreateOrUpdate(ctx, id, parameters); err != nil { diff --git a/internal/services/serviceconnector/service_connector_spring_cloud_resource.go b/internal/services/serviceconnector/service_connector_spring_cloud_resource.go index 3fa1dec2a3b1..4818728664c2 100644 --- a/internal/services/serviceconnector/service_connector_spring_cloud_resource.go +++ b/internal/services/serviceconnector/service_connector_spring_cloud_resource.go @@ -201,7 +201,6 @@ func (r SpringCloudConnectorResource) Read() sdk.ResourceFunc { if props.ClientType != nil { state.ClientType = string(*props.ClientType) - } if props.VNetSolution != nil && props.VNetSolution.Type != nil { diff --git a/internal/services/servicefabric/client/client.go b/internal/services/servicefabric/client/client.go index 166faeb3280d..b3716b370253 100644 --- a/internal/services/servicefabric/client/client.go +++ b/internal/services/servicefabric/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" + "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/servicefabric/service_fabric_cluster_resource.go b/internal/services/servicefabric/service_fabric_cluster_resource.go index f9d94b2a8291..11621e93e8ae 100644 --- a/internal/services/servicefabric/service_fabric_cluster_resource.go +++ b/internal/services/servicefabric/service_fabric_cluster_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" + "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/sql/client/client.go b/internal/services/sql/client/client.go index 67c0344d4bdf..9dde9084bf99 100644 --- a/internal/services/sql/client/client.go +++ b/internal/services/sql/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" - msi "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" - sqlv5 "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck + msi "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" // nolint: staticcheck + sqlv5 "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/sql/sql_administrator_resource.go b/internal/services/sql/sql_administrator_resource.go index 64eb6890a393..6f28a6015194 100644 --- a/internal/services/sql/sql_administrator_resource.go +++ b/internal/services/sql/sql_administrator_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_database_data_source.go b/internal/services/sql/sql_database_data_source.go index 16f5dde74472..77abcde6af0e 100644 --- a/internal/services/sql/sql_database_data_source.go +++ b/internal/services/sql/sql_database_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/sql/sql_database_resource.go b/internal/services/sql/sql_database_resource.go index ea35317ac584..858f598da3d7 100644 --- a/internal/services/sql/sql_database_resource.go +++ b/internal/services/sql/sql_database_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/sql/sql_elasticpool_resource.go b/internal/services/sql/sql_elasticpool_resource.go index 8e3710401b19..c03aec37bd09 100644 --- a/internal/services/sql/sql_elasticpool_resource.go +++ b/internal/services/sql/sql_elasticpool_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_failover_group_resource.go b/internal/services/sql/sql_failover_group_resource.go index fcf6c2dded68..1c2cfbecc368 100644 --- a/internal/services/sql/sql_failover_group_resource.go +++ b/internal/services/sql/sql_failover_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_firewall_rule_resource.go b/internal/services/sql/sql_firewall_rule_resource.go index 20cacee7d7f7..980813ba7c31 100644 --- a/internal/services/sql/sql_firewall_rule_resource.go +++ b/internal/services/sql/sql_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/sql/sql_managed_database_resource.go b/internal/services/sql/sql_managed_database_resource.go index 4c62651cc7c7..0cf657547d2d 100644 --- a/internal/services/sql/sql_managed_database_resource.go +++ b/internal/services/sql/sql_managed_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_managed_instance_administrator_resource.go b/internal/services/sql/sql_managed_instance_administrator_resource.go index b25babed66ef..3de7c393e7e4 100644 --- a/internal/services/sql/sql_managed_instance_administrator_resource.go +++ b/internal/services/sql/sql_managed_instance_administrator_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_managed_instance_failover_group_resource.go b/internal/services/sql/sql_managed_instance_failover_group_resource.go index 11ee87af7e29..4d48478f5c57 100644 --- a/internal/services/sql/sql_managed_instance_failover_group_resource.go +++ b/internal/services/sql/sql_managed_instance_failover_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_managed_instance_resource.go b/internal/services/sql/sql_managed_instance_resource.go index a13476939a91..70daaa2d6d73 100644 --- a/internal/services/sql/sql_managed_instance_resource.go +++ b/internal/services/sql/sql_managed_instance_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/sql/sql_server_resource.go b/internal/services/sql/sql_server_resource.go index 2448a6201a0e..c701c9a1b080 100644 --- a/internal/services/sql/sql_server_resource.go +++ b/internal/services/sql/sql_server_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/sql/sql_virtual_network_rule_resource.go b/internal/services/sql/sql_virtual_network_rule_resource.go index 7667add65c98..b8214bdb5886 100644 --- a/internal/services/sql/sql_virtual_network_rule_resource.go +++ b/internal/services/sql/sql_virtual_network_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/client/client.go b/internal/services/storage/client/client.go index bc8fba59d889..a606a357c2c5 100644 --- a/internal/services/storage/client/client.go +++ b/internal/services/storage/client/client.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" storage_v2022_05_01 "github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-05-01" diff --git a/internal/services/storage/client/helpers.go b/internal/services/storage/client/helpers.go index b5e71616a125..fd35f8248343 100644 --- a/internal/services/storage/client/helpers.go +++ b/internal/services/storage/client/helpers.go @@ -6,7 +6,7 @@ import ( "log" "sync" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" ) diff --git a/internal/services/storage/storage_account_customer_managed_key_resource.go b/internal/services/storage/storage_account_customer_managed_key_resource.go index 62463023a3e1..73ac73f7c27e 100644 --- a/internal/services/storage/storage_account_customer_managed_key_resource.go +++ b/internal/services/storage/storage_account_customer_managed_key_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_account_customer_managed_key_resource_test.go b/internal/services/storage/storage_account_customer_managed_key_resource_test.go index 3d81e9ee8dfc..ffcda2be2509 100644 --- a/internal/services/storage/storage_account_customer_managed_key_resource_test.go +++ b/internal/services/storage/storage_account_customer_managed_key_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_account_data_source.go b/internal/services/storage/storage_account_data_source.go index de41fc0786f6..3cb4e6b385b8 100644 --- a/internal/services/storage/storage_account_data_source.go +++ b/internal/services/storage/storage_account_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck azautorest "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/storage/storage_account_network_rules_resource.go b/internal/services/storage/storage_account_network_rules_resource.go index 7703062e8531..d6a75172c349 100644 --- a/internal/services/storage/storage_account_network_rules_resource.go +++ b/internal/services/storage/storage_account_network_rules_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -44,7 +44,7 @@ func resourceStorageAccountNetworkRules() *pluginsdk.Resource { func resourceStorageAccountNetworkRulesSchema() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ - //lintignore: S013 + // lintignore: S013 "storage_account_id": { Type: pluginsdk.TypeString, Required: true, diff --git a/internal/services/storage/storage_account_resource.go b/internal/services/storage/storage_account_resource.go index 025f5772d1fd..c8c821b03629 100644 --- a/internal/services/storage/storage_account_resource.go +++ b/internal/services/storage/storage_account_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck azautorest "github.com/Azure/go-autorest/autorest" autorestAzure "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/lang/response" @@ -1353,11 +1353,9 @@ func resourceStorageAccountCreate(d *pluginsdk.ResourceData, meta interface{}) e // The API complains if any multichannel info is sent on non premium fileshares. Even if multichannel is set to false if accountTier != string(storage.SkuTierPremium) && shareProperties.FileServicePropertiesProperties != nil && shareProperties.FileServicePropertiesProperties.ProtocolSettings != nil { - // Error if the user has tried to enable multichannel on a standard tier storage account smb := shareProperties.FileServicePropertiesProperties.ProtocolSettings.Smb if smb != nil && smb.Multichannel != nil { - if smb.Multichannel.Enabled != nil { if *shareProperties.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel.Enabled { return fmt.Errorf("`multichannel_enabled` isn't supported for Standard tier Storage accounts") @@ -1568,7 +1566,6 @@ func resourceStorageAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) e if _, err := client.Update(ctx, id.ResourceGroup, id.Name, opts); err != nil { return fmt.Errorf("updating %s Customer Managed Key: %+v", *id, err) } - } if d.HasChange("sftp_enabled") { @@ -1822,7 +1819,6 @@ func resourceStorageAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) e shareProperties := expandShareProperties(d.Get("share_properties").([]interface{})) // The API complains if any multichannel info is sent on non premium fileshares. Even if multichannel is set to false if accountTier != string(storage.SkuTierPremium) { - // Error if the user has tried to enable multichannel on a standard tier storage account if shareProperties.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel != nil && shareProperties.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel.Enabled != nil { if *shareProperties.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel.Enabled { @@ -2384,7 +2380,6 @@ func flattenStorageAccountImmutabilityPolicy(policy *storage.ImmutableStorageAcc "allow_protected_append_writes": policy.ImmutabilityPolicy.AllowProtectedAppendWrites, }, } - } func flattenStorageAccountCustomerManagedKey(storageAccountId *parse.StorageAccountId, input *storage.Encryption) ([]interface{}, error) { diff --git a/internal/services/storage/storage_account_resource_test.go b/internal/services/storage/storage_account_resource_test.go index e2b4fa2525d5..c657e0b15898 100644 --- a/internal/services/storage/storage_account_resource_test.go +++ b/internal/services/storage/storage_account_resource_test.go @@ -1683,33 +1683,6 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString, tlsVersion) } -func (r *StorageAccountResource) controlAllowNestedItemsToBePublic(data acceptance.TestData, allowFlag bool) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-storage-%d" - location = "%s" -} - -resource "azurerm_storage_account" "test" { - name = "unlikely23exst2acct%s" - resource_group_name = azurerm_resource_group.test.name - - location = azurerm_resource_group.test.location - account_tier = "Standard" - account_replication_type = "LRS" - allow_nested_items_to_be_public = %t - - tags = { - environment = "production" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomString, allowFlag) -} - func (r StorageAccountResource) isHnsEnabledTrue(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/storage/storage_blob_inventory_policy_resource.go b/internal/services/storage/storage_blob_inventory_policy_resource.go index 941587176560..c500e934cd2d 100644 --- a/internal/services/storage/storage_blob_inventory_policy_resource.go +++ b/internal/services/storage/storage_blob_inventory_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_encryption_scope_resource.go b/internal/services/storage/storage_encryption_scope_resource.go index e6438a84e589..c8277fdc8528 100644 --- a/internal/services/storage/storage_encryption_scope_resource.go +++ b/internal/services/storage/storage_encryption_scope_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" diff --git a/internal/services/storage/storage_encryption_scope_resource_test.go b/internal/services/storage/storage_encryption_scope_resource_test.go index 54ad7877c013..e6067ecd3a33 100644 --- a/internal/services/storage/storage_encryption_scope_resource_test.go +++ b/internal/services/storage/storage_encryption_scope_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_management_policy_resource.go b/internal/services/storage/storage_management_policy_resource.go index 212985137d80..e6bfc8a2af9e 100644 --- a/internal/services/storage/storage_management_policy_resource.go +++ b/internal/services/storage/storage_management_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" @@ -111,14 +111,14 @@ func resourceStorageManagementPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "actions": { Type: pluginsdk.TypeList, Required: true, MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "base_blob": { Type: pluginsdk.TypeList, Optional: true, @@ -188,7 +188,7 @@ func resourceStorageManagementPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "snapshot": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/storage/storage_sync_cloud_endpoint_resource.go b/internal/services/storage/storage_sync_cloud_endpoint_resource.go index a6c7063e0c82..7b646c263fca 100644 --- a/internal/services/storage/storage_sync_cloud_endpoint_resource.go +++ b/internal/services/storage/storage_sync_cloud_endpoint_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_sync_group_resource.go b/internal/services/storage/storage_sync_group_resource.go index 8071d615ce32..b045fa05ada9 100644 --- a/internal/services/storage/storage_sync_group_resource.go +++ b/internal/services/storage/storage_sync_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_sync_resource.go b/internal/services/storage/storage_sync_resource.go index 91e28391fa39..1f2c23f89bc2 100644 --- a/internal/services/storage/storage_sync_resource.go +++ b/internal/services/storage/storage_sync_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go index 5f22d3781fc3..13d134e279bf 100644 --- a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go +++ b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go @@ -388,30 +388,6 @@ resource "azurerm_stream_analytics_output_servicebus_topic" "import" { `, template) } -func (r StreamAnalyticsOutputServiceBusTopicResource) authenticationMode(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -%s - -resource "azurerm_stream_analytics_output_servicebus_topic" "test" { - name = "acctestoutput-%d" - stream_analytics_job_name = azurerm_stream_analytics_job.test.name - resource_group_name = azurerm_stream_analytics_job.test.resource_group_name - topic_name = azurerm_servicebus_topic.test.name - servicebus_namespace = azurerm_servicebus_namespace.test.name - shared_access_policy_key = azurerm_servicebus_namespace.test.default_primary_key - shared_access_policy_name = "RootManageSharedAccessKey" - authentication_mode = "Msi" - - serialization { - type = "Json" - encoding = "UTF8" - format = "LineSeparated" - } -} -`, template, data.RandomInteger) -} - func (r StreamAnalyticsOutputServiceBusTopicResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go b/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go index b5133e14e26b..118d940ccd64 100644 --- a/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go @@ -205,7 +205,6 @@ func resourceStreamAnalyticsOutputSynapseRead(d *pluginsdk.ResourceData, meta in user = *v } d.Set("user", user) - } } return nil diff --git a/internal/services/streamanalytics/stream_analytics_output_table_resource.go b/internal/services/streamanalytics/stream_analytics_output_table_resource.go index b9ff1c6623d0..671227e26d3f 100644 --- a/internal/services/streamanalytics/stream_analytics_output_table_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_table_resource.go @@ -149,7 +149,7 @@ func (r OutputTableResource) Create() sdk.ResourceFunc { BatchSize: utils.Int64(model.BatchSize), } - if v := model.ColumnsToRemove; v != nil && len(v) > 0 { + if v := model.ColumnsToRemove; len(v) > 0 { tableOutputProps.ColumnsToRemove = &v } diff --git a/internal/services/streamanalytics/stream_analytics_reference_input.go b/internal/services/streamanalytics/stream_analytics_reference_input.go index a523c27285de..89607db469b6 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input.go @@ -24,10 +24,11 @@ func importStreamAnalyticsReferenceInput(expectType string) pluginsdk.ImporterFu if model := resp.Model; model != nil { if props := model.Properties; props != nil { - input, ok := props.(inputs.InputProperties) + input, ok := props.(inputs.InputProperties) // nolint: gosimple if !ok { return nil, fmt.Errorf("failed to convert to Input") } + reference, ok := input.(inputs.ReferenceInputProperties) if !ok { return nil, fmt.Errorf("failed to convert to Reference Input") @@ -45,7 +46,6 @@ func importStreamAnalyticsReferenceInput(expectType string) pluginsdk.ImporterFu if actualType != expectType { return nil, fmt.Errorf("stream analytics reference input has mismatched type, expected: %q, got %q", expectType, actualType) } - } } return []*pluginsdk.ResourceData{d}, nil diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go b/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go index 2f0e0c844b87..460289896d6c 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go @@ -243,7 +243,7 @@ func resourceStreamAnalyticsReferenceInputBlobRead(d *pluginsdk.ResourceData, me if model := resp.Model; model != nil { if props := model.Properties; props != nil { - input, ok := props.(inputs.InputProperties) + input, ok := props.(inputs.InputProperties) // nolint: gosimple if !ok { return fmt.Errorf("converting %s to an Input", *id) } diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go index b609ba27d55e..66a3d8990eb4 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go @@ -220,7 +220,7 @@ func resourceStreamAnalyticsReferenceInputMsSqlRead(d *pluginsdk.ResourceData, m if model := resp.Model; model != nil { if props := model.Properties; props != nil { - input, ok := props.(inputs.InputProperties) + input, ok := props.(inputs.InputProperties) // nolint: gosimple if !ok { return fmt.Errorf("converting %s to an Input", *id) } diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go index b2a0d4b5ec41..deb5b66a363c 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go @@ -153,32 +153,6 @@ QUERY `, template, data.RandomInteger) } -func (r StreamAnalyticsReferenceInputMsSqlResource) complete(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -%s - -resource "azurerm_analytics_reference_input_mssql" "test" { - name = "acctestinput-%d" - stream_analytics_job_name = azurerm_stream_analytics_job.test.name - resource_group_name = azurerm_stream_analytics_job.test.resource_group_name - server = azurerm_mssql_server.test.fully_qualified_domain_name - database = azurerm_mssql_database.test.name - username = "maurice" - password = "ludicrousdisplay" - refresh_type = "RefreshPeriodicallyWithFull" - refresh_interval_duration = "00:10:00" - table = "exampletable" - full_snapshot_query = < subscriptionId := meta.(*clients.Client).Account.SubscriptionId" - echo " > id := parse.NewMyResourceId(subscriptionId, resourceGroup, name)" - echo "" - echo "This means that the 'SetID' function can change from:" - echo " > d.SetId(\"*read.ID\")" - echo "to:" - echo " > d.SetId(id.ID())" - echo "" - echo "In addition when parsing the Resource ID during a Read, Update or Delete method" - echo "the generated Resource ID Parser can be used via:" - echo " > id, err := parse.MyResourceID(d.Id())" - echo " > if err != nil {" - echo " > return err" - echo " > }" - echo "" - echo "New Resources should be using Resource ID Formatters/Parsers by default" - echo "however existing (unmodified) resources can continue to use the Azure ID" - echo "for the moment - but over time these will be switched across." - exit 1 - } + echo "The Feature Flag for 'ShouldResourcesBeImported' will be deprecated in the future" + echo "and shouldn't be used in new resources - please remove new usages of the" + echo "'ShouldResourcesBeImported' function from these changes - since this is now enabled" + echo "by default." + echo "" + echo "In the future this function will be marked as Deprecated - however it's not for" + echo "the moment to not conflict with open Pull Requests." + exit 1 + } - # check for new combined CreateUpdate methods - line=$(grep -H -n "Create:.*CreateUpdate," "$f" -m1) - if [ "$line" != "" ]; - then - git diff --diff-filter=AMRC origin/main -U0 "$f" | grep -q "+.*Create:.*CreateUpdate," && { - echo "$line" - echo "New Resources should no longer use combined CreateUpdate methods, please" - echo "split these into two separate Create and Update methods." - echo "" - echo "Existing resources can continue to use combined CreateUpdate methods" - echo "for the moment - but over time these will be split into separate Create and" - echo "Update methods." - exit 1 + # using Resource ID Formatters/Parsers + grep -H -n "d\.SetId(\\*" "$f" && { + echo "Due to the Azure API returning the Resource ID's inconsistently - Terraform" + echo "now manages it's own Resource ID's, all new resources should use a generated" + echo "Resource ID Formatter and Parser." + echo "" + echo "A Resource ID Formatter and Parser can be generated by adding a 'resourceids.go'" + echo "file to the service package (for example" + echo "./internal/services/myservice/resourceids.go) - with the line:" + echo + echo "//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Server" + echo "-id={the value of the Resource ID}" + echo "" + echo "At which point running 'make generate' will generate a Resource ID Formatter, Parser" + echo "and Validator." + echo "" + echo "This allows a Resource ID to be defined in-line via:" + echo " > subscriptionId := meta.(*clients.Client).Account.SubscriptionId" + echo " > id := parse.NewMyResourceId(subscriptionId, resourceGroup, name)" + echo "" + echo "This means that the 'SetID' function can change from:" + echo " > d.SetId(\"*read.ID\")" + echo "to:" + echo " > d.SetId(id.ID())" + echo "" + echo "In addition when parsing the Resource ID during a Read, Update or Delete method" + echo "the generated Resource ID Parser can be used via:" + echo " > id, err := parse.MyResourceID(d.Id())" + echo " > if err != nil {" + echo " > return err" + echo " > }" + echo "" + echo "New Resources should be using Resource ID Formatters/Parsers by default" + echo "however existing (unmodified) resources can continue to use the Azure ID" + echo "for the moment - but over time these will be switched across." + exit 1 } - fi - # check for d.Get inside Delete - deleteFuncName=$(grep -o "Delete: .*," "$f" -m1 | grep -o " .*Delete"| tr -d " ") - if [ "$deleteFuncName" != "" ]; - then - deleteMethod=$(cat -n $f | sed -n -e "/func $deleteFuncName.*$/,/[[:digit:]]*\treturn nil/{ /func $deleteFuncName$/d; /[[:digit:]]*\treturn nil/d; p; }") - foundGet=$(echo "$deleteMethod" | grep "d\.Get(.*)" -m1) - if [ "$foundGet" != "" ]; + # check for new combined CreateUpdate methods + line=$(grep -H -n "Create:.*CreateUpdate," "$f" -m1) + if [ "$line" != "" ]; then - echo "$f $foundGet" - echo "Please do not use 'd.Get' within the Delete function as this does not work as expected in Delete" - exit 1 + git diff --diff-filter=AMRC origin/main -U0 "$f" | grep -q "+.*Create:.*CreateUpdate," && { + echo "$line" + echo "New Resources should no longer use combined CreateUpdate methods, please" + echo "split these into two separate Create and Update methods." + echo "" + echo "Existing resources can continue to use combined CreateUpdate methods" + echo "for the moment - but over time these will be split into separate Create and" + echo "Update methods." + exit 1 + } fi - else - # check for Get in typed resource - deleteFuncName=" Delete() sdk.ResourceFunc " - deleteMethod=$(cat -n $f | sed -n -e "/$deleteFuncName.*$/,/[[:digit:]]*\t\t\treturn nil/{ /$deleteFuncName.*$/d; /[[:digit:]]*\t\t\treturn nil/d; p; }") - foundGet=$(echo "$deleteMethod" | grep "metadata.ResourceData.Get" -m1) - if [ "$foundGet" != "" ]; + + # check for d.Get inside Delete + deleteFuncName=$(grep -o "Delete: .*," "$f" -m1 | grep -o " .*Delete"| tr -d " ") + if [ "$deleteFuncName" != "" ]; then - echo "$f $foundGet" - echo "Please do not use 'metadata.ResourceData.Get' within the Delete function as this does not work as expected in Delete" - exit 1 + deleteMethod=$(cat -n $f | sed -n -e "/func $deleteFuncName.*$/,/[[:digit:]]*\treturn nil/{ /func $deleteFuncName$/d; /[[:digit:]]*\treturn nil/d; p; }") + foundGet=$(echo "$deleteMethod" | grep "d\.Get(.*)" -m1) + if [ "$foundGet" != "" ]; + then + echo "$f $foundGet" + echo "Please do not use 'd.Get' within the Delete function as this does not work as expected in Delete" + exit 1 + fi + else + # check for Get in typed resource + deleteFuncName=" Delete() sdk.ResourceFunc " + deleteMethod=$(cat -n $f | sed -n -e "/$deleteFuncName.*$/,/[[:digit:]]*\t\t\treturn nil/{ /$deleteFuncName.*$/d; /[[:digit:]]*\t\t\treturn nil/d; p; }") + foundGet=$(echo "$deleteMethod" | grep "metadata.ResourceData.Get" -m1) + if [ "$foundGet" != "" ]; + then + echo "$f $foundGet" + echo "Please do not use 'metadata.ResourceData.Get' within the Delete function as this does not work as expected in Delete" + exit 1 + fi fi - fi -done + done } function checkForUnclearErrorMessages { diff --git a/scripts/run-tflint.sh b/scripts/run-tflint.sh index 29a5346504be..a87f1bd90364 100755 --- a/scripts/run-tflint.sh +++ b/scripts/run-tflint.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + function runTests { echo "==> Checking source code against terraform provider linters..." tfproviderlint \