-
Notifications
You must be signed in to change notification settings - Fork 370
/
main.go
35 lines (30 loc) · 858 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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import (
"context"
"flag"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/hashicorp/terraform-provider-helm/helm"
"k8s.io/klog"
)
// Generate docs for website
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
func main() {
debugFlag := flag.Bool("debug", false, "Start provider in stand-alone debug mode.")
flag.Parse()
klogFlags := flag.NewFlagSet("klog", flag.ExitOnError)
klog.InitFlags(klogFlags)
err := klogFlags.Set("logtostderr", "false")
if err != nil {
panic(err)
}
serveOpts := &plugin.ServeOpts{
ProviderFunc: helm.Provider,
}
if debugFlag != nil && *debugFlag {
plugin.Debug(context.Background(), "registry.terraform.io/hashicorp/helm", serveOpts)
} else {
plugin.Serve(serveOpts)
}
}