diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 044559d..716c4f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,26 +20,26 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow - run: git fetch --prune --unshallow + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.19 - name: Import GPG key id: import_gpg - uses: hashicorp/ghaction-import-gpg@v2.1.0 + uses: crazy-max/ghaction-import-gpg@v5.0.0 + with: env: # These secrets will need to be configured for the repository: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.PASSPHRASE }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v3 with: version: latest args: release --rm-dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc0ba37..7e12d34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,16 +15,16 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.46.2 + version: v1.49.0 check: runs-on: ubuntu-latest steps: - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.19 - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get dependencies run: go mod download diff --git a/README.md b/README.md index d8c4c2a..14732f8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ terraform { required_providers { looker = { source = "hirosassa/looker" - version = "0.3.0" + version = "0.8.7" } } } diff --git a/VERSION b/VERSION index 120f532..35864a9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.6 \ No newline at end of file +0.8.7 \ No newline at end of file diff --git a/go.mod b/go.mod index b1c777f..612cdbd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hirosassa/terraform-provider-looker -go 1.17 +go 1.19 require ( github.com/hashicorp/terraform-plugin-docs v0.7.0 diff --git a/go.sum b/go.sum index f7c1f0e..ae5cf00 100644 --- a/go.sum +++ b/go.sum @@ -57,7 +57,6 @@ github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= diff --git a/pkg/looker/provider_test.go b/pkg/looker/provider_test.go index 2b12f91..074fba9 100644 --- a/pkg/looker/provider_test.go +++ b/pkg/looker/provider_test.go @@ -7,8 +7,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -var testAccProviders map[string]*schema.Provider -var testAccProvider *schema.Provider +var ( + testAccProviders map[string]*schema.Provider + testAccProvider *schema.Provider +) func init() { testAccProvider = Provider() diff --git a/pkg/looker/resource_connection.go b/pkg/looker/resource_connection.go index 68550e8..f9d39df 100644 --- a/pkg/looker/resource_connection.go +++ b/pkg/looker/resource_connection.go @@ -326,7 +326,7 @@ func expandWriteDBConnection(d *schema.ResourceData) (*apiclient.WriteDBConnecti // optional values if v, ok := d.GetOk("port"); ok { - port := v.(string) // for api breaking change + port := v.(string) // for api breaking change writeDBConnection.Port = &port } if v, ok := d.GetOk("password"); ok { @@ -415,7 +415,7 @@ func expandWriteDBConnection(d *schema.ResourceData) (*apiclient.WriteDBConnecti writeDBConnection.DisableContextComment = &disable_context_comment } if v, ok := d.GetOk("oauth_application_id"); ok { - oauthApplicationId := v.(string) // for api breaking change + oauthApplicationId := v.(string) // for api breaking change writeDBConnection.OauthApplicationId = &oauthApplicationId } diff --git a/pkg/looker/resource_connection_test.go b/pkg/looker/resource_connection_test.go index 74fb04a..6fea1f2 100644 --- a/pkg/looker/resource_connection_test.go +++ b/pkg/looker/resource_connection_test.go @@ -50,13 +50,14 @@ func testAccCheckConnectionExists(n string) resource.TestCheckFunc { connectionName := rs.Primary.ID _, err := client.Connection(connectionName, "", nil) - if err !=nil { + if err != nil { return err } return nil } } + func testAccCheckConnectionDestroy(s *terraform.State) error { client := testAccProvider.Meta().(*apiclient.LookerSDK) diff --git a/pkg/looker/resource_group_test.go b/pkg/looker/resource_group_test.go index 4f53763..90945d0 100644 --- a/pkg/looker/resource_group_test.go +++ b/pkg/looker/resource_group_test.go @@ -65,7 +65,6 @@ func testAccCheckGroupDestroy(s *terraform.State) error { } return nil - } func groupConfig(name string) string { diff --git a/pkg/looker/resource_user.go b/pkg/looker/resource_user.go index 2981558..6f9e11a 100644 --- a/pkg/looker/resource_user.go +++ b/pkg/looker/resource_user.go @@ -68,7 +68,6 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface } return nil }) - if err != nil { return diag.FromErr(err) } diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go index 2735de6..f770edf 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/tools.go @@ -1,3 +1,4 @@ +//go:build tools // +build tools package tools