Skip to content

Commit

Permalink
Pass the version to the provider
Browse files Browse the repository at this point in the history
Not used for now, but can be used later on in the user-agent string
  • Loading branch information
mvantellingen committed Jun 7, 2022
1 parent 6aa3368 commit 4ef70c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ import (
"github.com/labd/contentstack-go-sdk/management"
)


func New() tfsdk.Provider {
return &provider{}
func New(version string) func() tfsdk.Provider {
return func() tfsdk.Provider {
return &provider{version: version}
}
}

type provider struct {
configured bool
stack *management.StackInstance
client *management.Client
stack *management.StackInstance
client *management.Client
version string
}

// GetSchema
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()

providerserver.Serve(context.Background(), provider.New, providerserver.ServeOpts{
providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{
Address: "registry.terraform.io/labd/contentstack",
Debug: debugMode,
})
Expand Down

0 comments on commit 4ef70c8

Please sign in to comment.