Skip to content

Commit

Permalink
Switch to terraform plugin sdk v2
Browse files Browse the repository at this point in the history
  • Loading branch information
yann degat committed Aug 26, 2020
1 parent 8a7e73a commit 258874b
Show file tree
Hide file tree
Showing 403 changed files with 32,521 additions and 13,930 deletions.
8 changes: 1 addition & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
module github.com/terraform-providers/terraform-provider-ovh

require (
cloud.google.com/go v0.61.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 // indirect
github.com/hashicorp/go-plugin v1.3.0 // indirect
github.com/hashicorp/hcl/v2 v2.3.0 // indirect
github.com/hashicorp/terraform-exec v0.3.0 // indirect
github.com/hashicorp/terraform-plugin-sdk v1.15.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.1
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-testing-interface v1.0.4 // indirect
github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 // indirect
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
github.com/ulikunitz/xz v0.5.7 // indirect
gopkg.in/ini.v1 v1.42.0
)

Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFU
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/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
Expand Down Expand Up @@ -152,6 +153,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6K
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI=
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs=
github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw=
github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY=
github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8=
Expand Down Expand Up @@ -193,8 +196,12 @@ github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f
github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU=
github.com/hashicorp/terraform-plugin-sdk v1.15.0 h1:bmYnTT7MqNXlUHDc7pT8E6uKT2g/upjlRLypJFK1OQU=
github.com/hashicorp/terraform-plugin-sdk v1.15.0/go.mod h1:PuFTln8urDmRM6mV0II6apOTsyG/iHkxp+5W11eJE58=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.1 h1:qG6EdnW2UrftQI4mBdIsWP4YWqYJXynZtl0shQYuU78=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.1/go.mod h1:BRz6UtYmksQJU0eMfahQR8fcJf8tIe77gn7YVm6rGD4=
github.com/hashicorp/terraform-plugin-test v1.4.3 h1:HSOZZu2W7a9tx4QPYXhrT9oh7JptibaSkP7CK4C0OF0=
github.com/hashicorp/terraform-plugin-test v1.4.3/go.mod h1:UA7z/02pgqsRLut4DJIPm0Hjnj27uOvhi19c8kTqIfM=
github.com/hashicorp/terraform-plugin-test/v2 v2.0.0 h1:fYGV3nZvs8KFGKuY2NPAJDMNfVSDHo+U2FGFl3bPv1s=
github.com/hashicorp/terraform-plugin-test/v2 v2.0.0/go.mod h1:C6VALgUlvaif+PnHyRGKWPTdQkMJK4NQ20VJolxZLI0=
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg=
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
Expand Down
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-sdk/plugin"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/terraform-providers/terraform-provider-ovh/ovh"
)

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

cleanhttp "github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging"
"github.com/ovh/go-ovh/ovh"
)

Expand Down
4 changes: 2 additions & 2 deletions ovh/data_source_ovh_cloud_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"net/url"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers/hashcode"

"github.com/ovh/go-ovh/ovh"
)
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_cloud_region_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccCloudRegionDataSource_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_cloud_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"net/url"

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

func dataSourceCloudRegions() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_cloud_regions_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccCloudRegionsDataSource_basic(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions ovh/data_source_ovh_dedicated_ceph.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ovh

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

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers"
)

func dataSourceDedicatedCeph() *schema.Resource {
Expand Down Expand Up @@ -59,7 +61,7 @@ func dataSourceDedicatedCeph() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateDedicatedCephStatus(v.(string))
err := helpers.ValidateDedicatedCephStatus(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand Down
3 changes: 2 additions & 1 deletion ovh/data_source_ovh_dedicated_ceph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package ovh

import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"os"
"testing"

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

func TestAccDedicatedCephDatasource(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ovh/data_source_ovh_dedicated_installation_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"sort"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers/hashcode"
)

func dataSourceDedicatedInstallationTemplates() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ovh
import (
"testing"

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

func TestAccDedicatedInstallationTemplatesDataSource_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_dedicated_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"net/url"

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

func dataSourceDedicatedServer() *schema.Resource {
Expand Down
7 changes: 4 additions & 3 deletions ovh/data_source_ovh_dedicated_server_boots.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"sort"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers/hashcode"
)

func dataSourceDedicatedServerBoots() *schema.Resource {
Expand All @@ -25,7 +26,7 @@ func dataSourceDedicatedServerBoots() *schema.Resource {
Optional: true,
Description: "Filter the value of bootType property",
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateBootType(v.(string))
err := helpers.ValidateBootType(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_dedicated_server_boots_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccDedicatedServerBootsDataSource_basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_dedicated_server_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccDedicatedServerDataSource_basic(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ovh/data_source_ovh_dedicated_servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"sort"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers/hashcode"
)

func dataSourceDedicatedServers() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_dedicated_servers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ovh
import (
"testing"

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

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

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

func dataSourceDomainZone() *schema.Resource {
Expand Down
4 changes: 2 additions & 2 deletions ovh/data_source_ovh_domain_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strconv"
"testing"

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

func TestAccDomainZoneDataSource_basic(t *testing.T) {
Expand Down
15 changes: 8 additions & 7 deletions ovh/data_source_ovh_iploadbalancing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"
"log"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers/hashcode"
)

func dataSourceIpLoadbalancing() *schema.Resource {
Expand All @@ -17,7 +18,7 @@ func dataSourceIpLoadbalancing() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateIpV6(v.(string))
err := helpers.ValidateIpV6(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand All @@ -29,7 +30,7 @@ func dataSourceIpLoadbalancing() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateIpV4(v.(string))
err := helpers.ValidateIpV4(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand Down Expand Up @@ -60,7 +61,7 @@ func dataSourceIpLoadbalancing() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateIp(v.(string))
err := helpers.ValidateIp(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand All @@ -72,7 +73,7 @@ func dataSourceIpLoadbalancing() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateStringEnum(v.(string), []string{"blacklisted", "deleted", "free", "ok", "quarantined", "suspended"})
err := helpers.ValidateStringEnum(v.(string), []string{"blacklisted", "deleted", "free", "ok", "quarantined", "suspended"})
if err != nil {
errors = append(errors, err)
}
Expand Down Expand Up @@ -100,7 +101,7 @@ func dataSourceIpLoadbalancing() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateStringEnum(v.(string), []string{"intermediate", "modern"})
err := helpers.ValidateStringEnum(v.(string), []string{"intermediate", "modern"})
if err != nil {
errors = append(errors, err)
}
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_iploadbalancing_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

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

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

func dataSourceIpLoadbalancingVrackNetwork() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_iploadbalancing_vrack_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccIpLoadbalancingVrackNetworkDataSource_basic(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions ovh/data_source_ovh_iploadbalancing_vrack_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"net/url"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-ovh/ovh/helpers"
)

func dataSourceIpLoadbalancingVrackNetworks() *schema.Resource {
Expand All @@ -23,7 +24,7 @@ func dataSourceIpLoadbalancingVrackNetworks() *schema.Resource {
Description: "Filters on subnet",
Optional: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := validateIpBlock(v.(string))
err := helpers.ValidateIpBlock(v.(string))
if err != nil {
errors = append(errors, err)
}
Expand Down
2 changes: 1 addition & 1 deletion ovh/data_source_ovh_iploadbalancing_vrack_networks_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-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccIpLoadbalancingVrackNetworksDataSource_basic(t *testing.T) {
Expand Down
10 changes: 7 additions & 3 deletions ovh/data_source_ovh_me_installation_template.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ovh

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

func dataSourceMeInstallationTemplate() *schema.Resource {
Expand All @@ -23,7 +23,6 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
"customization": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"change_log": {
Expand Down Expand Up @@ -177,7 +176,7 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Description: "This template bit format (32 or 64)",
},
"category": {
Type: schema.TypeInt,
Type: schema.TypeString,
Computed: true,
Description: "Category of this template (informative only). (basic, customer, hosting, other, readyToUse, virtualisation)",
},
Expand Down Expand Up @@ -219,6 +218,11 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Computed: true,
Description: "Date of last modification of the base image",
},
"lvm_ready": {
Type: schema.TypeBool,
Computed: true,
Description: "This distribution supports Logical Volumes (Linux LVM)",
},
"supports_distribution_kernel": {
Type: schema.TypeBool,
Computed: true,
Expand Down
Loading

0 comments on commit 258874b

Please sign in to comment.