Skip to content

Commit

Permalink
Make ProviderFunc return func() *schema.Provider as per migration gui…
Browse files Browse the repository at this point in the history
…delines

- Terraform Plugin SDK v2 Upgrade Guide: Removal of the terraform.ResourceProvider Interface
https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html#removal-of-the-terraform-resourceprovider-interface
  • Loading branch information
dikhan committed Dec 17, 2020
1 parent 7bdf374 commit 3f1f448
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ func main() {
log.Fatalf("[ERROR] There was an error initialising the terraform provider: %s", err)
}

plugin.Serve(
&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
return provider
},
})
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() *schema.Provider {
return provider
}})
}

func getProviderName(binaryName string) (string, error) {
Expand Down

0 comments on commit 3f1f448

Please sign in to comment.