-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (30 loc) · 889 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"context"
"flag"
"log"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/rgl/terraform-provider-sushy-vbmc/vbmc"
)
func main() {
var debug bool
// NB You should use the Visual Studio Code Debugger UI to launch this in debug mode.
// see the .vscode/launch.json file.
// see https://www.terraform.io/docs/extend/debugging.html#enabling-debugging-in-a-provider
flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()
opts := &plugin.ServeOpts{
ProviderFunc: func() *schema.Provider {
return vbmc.Provider()
},
}
if debug {
err := plugin.Debug(context.Background(), "registry.terraform.io/rgl/sushy-vbmc", opts)
if err != nil {
log.Fatal(err.Error())
}
return
}
plugin.Serve(opts)
}