Skip to content

Commit

Permalink
Migrate to terraform-plugin-sdk
Browse files Browse the repository at this point in the history
Also updates the null and random providers and removes the template provider
which can't be used with the plugin sdk, yet, in order to make tests pass.

See:
hashicorp/terraform-provider-template#75
  • Loading branch information
LorbusChris committed Jan 28, 2020
1 parent 6530518 commit 2fc191c
Show file tree
Hide file tree
Showing 132 changed files with 274 additions and 383 deletions.
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ require (
github.com/aws/aws-sdk-go v1.28.8 // indirect
github.com/davecgh/go-spew v1.1.1
github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 // indirect
github.com/hashicorp/terraform v0.12.20
github.com/hashicorp/terraform-plugin-sdk v1.5.0
github.com/mitchellh/copystructure v1.0.0
github.com/terraform-providers/terraform-provider-null v1.0.0
github.com/terraform-providers/terraform-provider-random v2.0.0+incompatible
github.com/terraform-providers/terraform-provider-template v1.0.0
github.com/terraform-providers/terraform-provider-null v1.0.1-0.20191204185112-e5c592237f62
github.com/terraform-providers/terraform-provider-random v1.3.2-0.20190925210718-83518d96ae4f
github.com/vmware/govmomi v0.22.1
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150 // indirect
)
245 changes: 70 additions & 175 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform-plugin-sdk/plugin"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere"
)

Expand Down
2 changes: 1 addition & 1 deletion scripts/errcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if ! which errcheck > /dev/null; then
fi

err_files=$(errcheck -ignoretests \
-ignore 'github.com/hashicorp/terraform/helper/schema:Set' \
-ignore 'github.com/hashicorp/terraform-plugin-sdk/helper/schema:Set' \
-ignore 'bytes:.*' \
-ignore 'io:Close|Write' \
$(go list ./...| grep -v /vendor/))
Expand Down
2 changes: 1 addition & 1 deletion vsphere/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/vmware/govmomi/vapi/rest"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/viapi"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/pbm"
Expand Down
2 changes: 1 addition & 1 deletion vsphere/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"testing"

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

func testAccClientPreCheck(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_compute_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/clustercomputeresource"
)

Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_compute_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereComputeCluster_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_custom_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/customattribute"
"github.com/vmware/govmomi/object"
)
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_custom_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

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

func TestAccDataSourceVSphereCustomAttribute_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

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

func dataSourceVSphereDatacenter() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datacenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

var testAccDataSourceVSphereDatacenterExpectedRegexp = regexp.MustCompile("^datacenter-")
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/datastore"
"github.com/vmware/govmomi/object"
)
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datastore_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

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

func dataSourceVSphereDatastoreCluster() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datastore_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereDatastoreCluster_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_datastore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereDatastore_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_distributed_virtual_switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/viapi"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereDistributedVirtualSwitch_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/folder"
)

Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_folder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

var testAccDataSourceVSphereFolderExpectedRegexp = regexp.MustCompile("^group-v")
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/hostsystem"
)

Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

func TestAccDataSourceVSphereHost_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/network"
"github.com/vmware/govmomi/object"
)
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereNetwork_dvsPortgroup(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_resource_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/resourcepool"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/viapi"
"github.com/vmware/govmomi/object"
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_resource_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

func TestAccDataSourceVSphereResourcePool_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_storage_policy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package vsphere

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/spbm"
)

Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_storage_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

func TestAccDataSourceVSphereStoragePolicy_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_tag.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vsphere

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

func dataSourceVSphereTag() *schema.Resource {
return &schema.Resource{
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_tag_category.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vsphere

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

func dataSourceVSphereTagCategory() *schema.Resource {
return &schema.Resource{
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_tag_category_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

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

func TestAccDataSourceVSphereTagCategory_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

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

func TestAccDataSourceVSphereTag_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_vapp_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/vappcontainer"
)

Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_vapp_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

func TestAccDataSourceVSphereVAppContainer_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/virtualmachine"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/virtualdevice"
"github.com/vmware/govmomi/object"
Expand Down
2 changes: 1 addition & 1 deletion vsphere/data_source_vsphere_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

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

func TestAccDataSourceVSphereVirtualMachine_basic(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions vsphere/data_source_vsphere_vmfs_disks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sort"
"time"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions vsphere/data_source_vsphere_vmfs_disks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"testing"

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

func TestAccDataSourceVSphereVmfsDisks_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vsphere/datastore_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vsphere
import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/datastore"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/folder"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/storagepod"
Expand Down
4 changes: 2 additions & 2 deletions vsphere/distributed_port_group_structure.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package vsphere

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/structure"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions vsphere/distributed_virtual_port_setting_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package vsphere
import (
"log"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/structure"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions vsphere/distributed_virtual_switch_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/structure"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions vsphere/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"testing"
"time"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/clustercomputeresource"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/datastore"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/dvportgroup"
Expand Down
Loading

0 comments on commit 2fc191c

Please sign in to comment.