allow disabling AutoMTLS with env var
This commit is contained in:
parent
4e5a18c621
commit
dae1efe62a
|
@ -9,6 +9,11 @@ import (
|
||||||
"github.com/hashicorp/terraform/plugin/discovery"
|
"github.com/hashicorp/terraform/plugin/discovery"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// The TF_DISABLE_PLUGIN_TLS environment variable is intended only for use by
|
||||||
|
// the plugin SDK test framework. We do not recommend Terraform CLI end-users
|
||||||
|
// set this variable.
|
||||||
|
var enableAutoMTLS = os.Getenv("TF_DISABLE_PLUGIN_TLS") == ""
|
||||||
|
|
||||||
// ClientConfig returns a configuration object that can be used to instantiate
|
// ClientConfig returns a configuration object that can be used to instantiate
|
||||||
// a client for the plugin described by the given metadata.
|
// a client for the plugin described by the given metadata.
|
||||||
func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig {
|
func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig {
|
||||||
|
@ -25,7 +30,7 @@ func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig {
|
||||||
Managed: true,
|
Managed: true,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},
|
AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},
|
||||||
AutoMTLS: true,
|
AutoMTLS: enableAutoMTLS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue