Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use tfconv module #8

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ec/armada/converter.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package armada

import (
"github.com/nitrado/terraform-provider-ec/internal/terra"
"github.com/nitrado/tfconv"
"k8s.io/apimachinery/pkg/api/resource"
)

func converter() *terra.Converter {
c := terra.New()
func converter() *tfconv.Converter {
c := tfconv.New("json")
c.Register(resource.Quantity{}, expandQuantity, flattenQuantity)
return c
}
Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
module github.com/nitrado/terraform-provider-ec

go 1.21.1

toolchain go1.21.3
go 1.21.3

require (
github.com/ettle/strcase v0.1.1
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/nitrado/tfconv v1.0.0
github.com/stretchr/testify v1.8.4
gitlab.com/nitrado/b2b/ec/armada v0.1.8
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/oauth2 v0.13.0
k8s.io/apimachinery v0.28.2
)
Expand All @@ -28,6 +25,7 @@ require (
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -100,6 +98,7 @@ require (
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/nitrado/tfconv v1.0.0 h1:7RyeX8yY8NgHjVs5bwxv24BTLD4liXhKdpFgJ9hart0=
github.com/nitrado/tfconv v1.0.0/go.mod h1:ZMwx92uhhrCiBUKxk1xZtf8PMwIypTgA8tHkf7u+mok=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/schema-gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"text/template"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/nitrado/terraform-provider-ec/internal/terra/schemagen"
"github.com/nitrado/tfconv/schemagen"
)

// Generator is a struct Terraform schema generator. It converts structs
Expand Down
158 changes: 0 additions & 158 deletions internal/terra/expand.go

This file was deleted.

73 changes: 0 additions & 73 deletions internal/terra/expand_test.go

This file was deleted.

Loading
Loading