Skip to content

Commit

Permalink
feat: Update go version to 1.17 and use the terraform plugin SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
FaHeymann committed Jan 23, 2022
1 parent 3a07bc6 commit 78f8d44
Show file tree
Hide file tree
Showing 23 changed files with 441 additions and 264 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14.2
- name: Set up Go 1.17.6
uses: actions/setup-go@v1
with:
go-version: 1.14.2
go-version: 1.17.6
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -33,10 +33,10 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Set up Go 1.14.2
- name: Set up Go 1.17.6
uses: actions/setup-go@v1
with:
go-version: 1.14.2
go-version: 1.17.6
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17
- name: Import GPG key
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0
Expand Down
5 changes: 2 additions & 3 deletions contentful/provider.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

// Provider returns the Terraform Provider as a scheme and makes resources reachable
func Provider() terraform.ResourceProvider {
func Provider() *schema.Provider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"cma_token": {
Expand Down
11 changes: 5 additions & 6 deletions contentful/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ package contentful
import (
"testing"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

var testAccProviders map[string]terraform.ResourceProvider
var testAccProviders map[string]*schema.Provider
var testAccProvider *schema.Provider

func init() {
testAccProvider = Provider().(*schema.Provider)
testAccProviders = map[string]terraform.ResourceProvider{
testAccProvider = Provider()
testAccProviders = map[string]*schema.Provider{
"contentful": testAccProvider,
}
}

func TestProvider(t *testing.T) {
if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
if err := Provider().InternalValidate(); err != nil {
t.Fatalf("err: %s", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_apikey.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
6 changes: 3 additions & 3 deletions contentful/resource_contentful_apikey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_asset.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_contenttype.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_contenttype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_entry.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_environment.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_locale.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_space.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_space_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
2 changes: 1 addition & 1 deletion contentful/resource_contentful_webhook.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package contentful

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
contentful "github.com/labd/contentful-go"
)

Expand Down
4 changes: 2 additions & 2 deletions contentful/resource_contentful_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
contentful "github.com/labd/contentful-go"
)

Expand Down
67 changes: 64 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,69 @@
module github.com/labd/terraform-provider-contentful

go 1.14
go 1.17

require github.com/labd/contentful-go v0.5.0

require (
github.com/hashicorp/terraform v0.12.24
github.com/labd/contentful-go v0.5.0
cloud.google.com/go v0.61.0 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-cidr v1.0.1 // indirect
github.com/apparentlymart/go-textseg v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.25.3 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-getter v1.5.0 // indirect
github.com/hashicorp/go-hclog v0.15.0 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/go-plugin v1.4.0 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/hashicorp/hcl/v2 v2.3.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.13.0 // indirect
github.com/hashicorp/terraform-json v0.8.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.2.1 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.2.1 // indirect
go.opencensus.io v0.22.4 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
google.golang.org/api v0.29.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
google.golang.org/grpc v1.32.0 // indirect
google.golang.org/protobuf v1.25.0 // indirect
moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e // indirect
)
Loading

0 comments on commit 78f8d44

Please sign in to comment.