mirror of
https://github.com/hashicorp/terraform-provider-helm.git
synced 2025-12-18 23:26:08 -05:00
Co-authored-by: Mauricio Alvarez Leon <65101411+BBBmau@users.noreply.github.com> Co-authored-by: John Houston <jhouston@hashicorp.com> Co-authored-by: Brandy Jackson <90709515+iBrandyJackson@users.noreply.github.com>
45 lines
974 B
Go
45 lines
974 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/hashicorp/terraform-plugin-framework/providerserver"
|
|
"github.com/hashicorp/terraform-provider-helm/helm"
|
|
"k8s.io/klog"
|
|
)
|
|
|
|
// Example version string that can be overwritten by a release process
|
|
var Version string = "dev"
|
|
|
|
func main() {
|
|
var debug bool
|
|
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)
|
|
}
|
|
|
|
opts := providerserver.ServeOpts{
|
|
Address: "registry.terraform.io/hashicorp/helm",
|
|
Debug: debug,
|
|
ProtocolVersion: 6,
|
|
}
|
|
|
|
if *debugFlag {
|
|
opts.Debug = true
|
|
}
|
|
|
|
serveErr := providerserver.Serve(context.Background(), helm.New(Version), opts)
|
|
if serveErr != nil {
|
|
log.Fatal(serveErr.Error())
|
|
}
|
|
}
|