Skip to content

Commit afe2d5e

Browse files
chore: implement muxing for terraform sdk
1 parent 8b863b8 commit afe2d5e

File tree

5 files changed

+58
-828
lines changed

5 files changed

+58
-828
lines changed

cloudstack/provider.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import (
2626
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2727
)
2828

29-
// Provider returns a terraform.ResourceProvider.
30-
func Provider() *schema.Provider {
29+
func New() *schema.Provider {
3130
return &schema.Provider{
3231
Schema: map[string]*schema.Schema{
3332
"api_url": {

cloudstack/provider_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ var testAccProvider *schema.Provider
3232
var cloudStackTemplateURL = os.Getenv("CLOUDSTACK_TEMPLATE_URL")
3333

3434
func init() {
35-
testAccProvider = Provider()
35+
testAccProvider = New()
3636
testAccProviders = map[string]*schema.Provider{
3737
"cloudstack": testAccProvider,
3838
}
3939
}
4040

4141
func TestProvider(t *testing.T) {
42-
if err := Provider().InternalValidate(); err != nil {
42+
if err := New().InternalValidate(); err != nil {
4343
t.Fatalf("err: %s", err)
4444
}
4545
}
4646

4747
func TestProvider_impl(t *testing.T) {
48-
var _ *schema.Provider = Provider()
48+
var _ *schema.Provider = New()
4949
}
5050

5151
func testSetValueOnResourceData(t *testing.T) {

go.mod

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,60 @@ require (
44
github.com/apache/cloudstack-go/v2 v2.13.2
55
github.com/go-ini/ini v1.67.0
66
github.com/hashicorp/go-multierror v1.1.1
7-
github.com/hashicorp/terraform v0.12.0
7+
github.com/hashicorp/terraform-plugin-go v0.22.0
8+
github.com/hashicorp/terraform-plugin-mux v0.15.0
89
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
910
)
1011

1112
require (
12-
cloud.google.com/go v0.110.10 // indirect
13-
cloud.google.com/go/compute v1.23.3 // indirect
14-
cloud.google.com/go/compute/metadata v0.2.3 // indirect
15-
cloud.google.com/go/iam v1.1.5 // indirect
16-
cloud.google.com/go/storage v1.30.1 // indirect
17-
github.com/Masterminds/goutils v1.1.1 // indirect
18-
github.com/Masterminds/semver/v3 v3.2.0 // indirect
19-
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
2013
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect
2114
github.com/agext/levenshtein v1.2.2 // indirect
22-
github.com/apparentlymart/go-cidr v1.0.0 // indirect
23-
github.com/apparentlymart/go-textseg v1.0.0 // indirect
2415
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
25-
github.com/armon/go-radix v1.0.0 // indirect
26-
github.com/aws/aws-sdk-go v1.19.18 // indirect
27-
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
28-
github.com/bgentry/speakeasy v0.1.0 // indirect
29-
github.com/blang/semver v3.5.1+incompatible // indirect
3016
github.com/cloudflare/circl v1.3.7 // indirect
3117
github.com/fatih/color v1.16.0 // indirect
32-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3318
github.com/golang/mock v1.6.0 // indirect
3419
github.com/golang/protobuf v1.5.3 // indirect
3520
github.com/google/go-cmp v0.6.0 // indirect
36-
github.com/google/s2a-go v0.1.7 // indirect
37-
github.com/google/uuid v1.4.0 // indirect
38-
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
39-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
4021
github.com/hashicorp/errwrap v1.0.0 // indirect
4122
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
4223
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
4324
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
44-
github.com/hashicorp/go-getter v1.3.0 // indirect
4525
github.com/hashicorp/go-hclog v1.5.0 // indirect
4626
github.com/hashicorp/go-plugin v1.6.0 // indirect
47-
github.com/hashicorp/go-safetemp v1.0.0 // indirect
4827
github.com/hashicorp/go-uuid v1.0.3 // indirect
4928
github.com/hashicorp/go-version v1.6.0 // indirect
5029
github.com/hashicorp/hc-install v0.6.3 // indirect
51-
github.com/hashicorp/hcl v1.0.0 // indirect
5230
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
53-
github.com/hashicorp/hcl2 v0.0.0-20190515223218-4b22149b7cef // indirect
54-
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect
5531
github.com/hashicorp/logutils v1.0.0 // indirect
5632
github.com/hashicorp/terraform-exec v0.20.0 // indirect
5733
github.com/hashicorp/terraform-json v0.21.0 // indirect
58-
github.com/hashicorp/terraform-plugin-go v0.22.0 // indirect
5934
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
6035
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
6136
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
6237
github.com/hashicorp/yamux v0.1.1 // indirect
63-
github.com/huandu/xstrings v1.3.3 // indirect
64-
github.com/imdario/mergo v0.3.15 // indirect
65-
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
6638
github.com/kr/pretty v0.3.1 // indirect
6739
github.com/mattn/go-colorable v0.1.13 // indirect
6840
github.com/mattn/go-isatty v0.0.20 // indirect
69-
github.com/mitchellh/cli v1.1.5 // indirect
7041
github.com/mitchellh/copystructure v1.2.0 // indirect
71-
github.com/mitchellh/go-homedir v1.0.0 // indirect
7242
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
7343
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
74-
github.com/mitchellh/hashstructure v1.0.0 // indirect
7544
github.com/mitchellh/mapstructure v1.5.0 // indirect
7645
github.com/mitchellh/reflectwalk v1.0.2 // indirect
7746
github.com/oklog/run v1.0.0 // indirect
78-
github.com/posener/complete v1.2.3 // indirect
7947
github.com/rogpeppe/go-internal v1.11.0 // indirect
80-
github.com/shopspring/decimal v1.2.0 // indirect
81-
github.com/spf13/afero v1.9.2 // indirect
82-
github.com/spf13/cast v1.3.1 // indirect
8348
github.com/stretchr/testify v1.8.4 // indirect
84-
github.com/ulikunitz/xz v0.5.5 // indirect
8549
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
8650
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
8751
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
8852
github.com/zclconf/go-cty v1.14.2 // indirect
89-
go.opencensus.io v0.24.0 // indirect
9053
golang.org/x/crypto v0.19.0 // indirect
9154
golang.org/x/mod v0.15.0 // indirect
92-
golang.org/x/net v0.19.0 // indirect
93-
golang.org/x/oauth2 v0.14.0 // indirect
94-
golang.org/x/sync v0.5.0 // indirect
55+
golang.org/x/net v0.20.0 // indirect
9556
golang.org/x/sys v0.17.0 // indirect
9657
golang.org/x/text v0.14.0 // indirect
97-
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
98-
google.golang.org/api v0.149.0 // indirect
9958
google.golang.org/appengine v1.6.8 // indirect
100-
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
101-
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
102-
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
103-
google.golang.org/grpc v1.61.1 // indirect
59+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
60+
google.golang.org/grpc v1.62.0 // indirect
10461
google.golang.org/protobuf v1.32.0 // indirect
10562
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
10663
)

0 commit comments

Comments
 (0)