Skip to content

Commit 1aed712

Browse files
committed
add the option to debug the coder terraform provider
1 parent d90c181 commit 1aed712

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

main.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package main
22

33
import (
4+
"flag"
5+
46
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
57

68
"github.com/coder/terraform-provider-coder/v2/provider"
@@ -11,8 +13,15 @@ import (
1113
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
1214

1315
func main() {
14-
servePprof()
15-
plugin.Serve(&plugin.ServeOpts{
16+
debug := flag.Bool("debug", false, "Enable debug mode for the provider")
17+
flag.Parse()
18+
19+
opts := &plugin.ServeOpts{
20+
Debug: *debug,
21+
ProviderAddr: "registry.terraform.io/coder/coder",
1622
ProviderFunc: provider.New,
17-
})
23+
}
24+
25+
servePprof()
26+
plugin.Serve(opts)
1827
}

0 commit comments

Comments
 (0)