mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-20 22:59:42 -05:00
* chore: runs v2 upgrade cmd * chore: moves all files into the internal provider dir * feat: migrates main and provider * fix: migrates tests to provider factories * fix: replace import state passthrough ctx func * chore: bump tf-sdk to v2.4.4 * fix: acc test by adding stop grace period * fix: move to validate diag functions * test: switch from ctx TODO to Background * feat: add state upgrade for restart_policy and auth Co-authored-by: Shunsuke Suzuki <suzuki-shunsuke@users.noreply.github.com>
38 lines
851 B
Go
38 lines
851 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
|
|
"github.com/terraform-providers/terraform-provider-docker/internal/provider"
|
|
)
|
|
|
|
var (
|
|
// these will be set by the goreleaser configuration
|
|
// to appropriate values for the compiled binary
|
|
version string = "dev"
|
|
|
|
// goreleaser can also pass the specific commit if you want
|
|
// commit string = ""
|
|
)
|
|
|
|
func main() {
|
|
var debugMode bool
|
|
|
|
flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
|
|
flag.Parse()
|
|
|
|
opts := &plugin.ServeOpts{ProviderFunc: provider.New(version)}
|
|
|
|
if debugMode {
|
|
err := plugin.Debug(context.Background(), "registry.terraform.io/kreuzwerker/terraform-provider-docker", opts)
|
|
if err != nil {
|
|
log.Fatal(err.Error())
|
|
}
|
|
return
|
|
}
|
|
|
|
plugin.Serve(opts)
|
|
}
|