Move plugin/ and plugin6/ to internal/plugin{,6}/

This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
This commit is contained in:
Martin Atkins 2021-05-17 12:35:22 -07:00
parent 034e944070
commit b40a4fb741
69 changed files with 27 additions and 27 deletions

View File

@ -16,8 +16,8 @@ import (
"github.com/hashicorp/terraform/internal/command/views" "github.com/hashicorp/terraform/internal/command/views"
"github.com/hashicorp/terraform/internal/command/webbrowser" "github.com/hashicorp/terraform/internal/command/webbrowser"
"github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/getproviders"
pluginDiscovery "github.com/hashicorp/terraform/internal/plugin/discovery"
"github.com/hashicorp/terraform/internal/terminal" "github.com/hashicorp/terraform/internal/terminal"
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
) )
// runningInAutomationEnvName gives the name of an environment variable that // runningInAutomationEnvName gives the name of an environment variable that

View File

@ -15,8 +15,8 @@ import (
svchost "github.com/hashicorp/terraform-svchost" svchost "github.com/hashicorp/terraform-svchost"
svcauth "github.com/hashicorp/terraform-svchost/auth" svcauth "github.com/hashicorp/terraform-svchost/auth"
"github.com/hashicorp/terraform/internal/configs/hcl2shim" "github.com/hashicorp/terraform/internal/configs/hcl2shim"
pluginDiscovery "github.com/hashicorp/terraform/internal/plugin/discovery"
"github.com/hashicorp/terraform/internal/replacefile" "github.com/hashicorp/terraform/internal/replacefile"
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
) )
// credentialsConfigFile returns the path for the special configuration file // credentialsConfigFile returns the path for the special configuration file

View File

@ -13,9 +13,9 @@ import (
"github.com/hashicorp/go-plugin" "github.com/hashicorp/go-plugin"
"github.com/hashicorp/terraform/internal/e2e" "github.com/hashicorp/terraform/internal/e2e"
"github.com/hashicorp/terraform/internal/grpcwrap" "github.com/hashicorp/terraform/internal/grpcwrap"
tfplugin "github.com/hashicorp/terraform/internal/plugin"
simple "github.com/hashicorp/terraform/internal/provider-simple" simple "github.com/hashicorp/terraform/internal/provider-simple"
proto "github.com/hashicorp/terraform/internal/tfplugin5" proto "github.com/hashicorp/terraform/internal/tfplugin5"
tfplugin "github.com/hashicorp/terraform/plugin"
) )
// The tests in this file are for the "unmanaged provider workflow", which // The tests in this file are for the "unmanaged provider workflow", which

View File

@ -16,11 +16,11 @@ import (
"github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/getproviders"
"github.com/hashicorp/terraform/internal/logging" "github.com/hashicorp/terraform/internal/logging"
"github.com/hashicorp/terraform/internal/moduletest" "github.com/hashicorp/terraform/internal/moduletest"
tfplugin "github.com/hashicorp/terraform/internal/plugin"
tfplugin6 "github.com/hashicorp/terraform/internal/plugin6"
"github.com/hashicorp/terraform/internal/providercache" "github.com/hashicorp/terraform/internal/providercache"
"github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/tfdiags" "github.com/hashicorp/terraform/internal/tfdiags"
tfplugin "github.com/hashicorp/terraform/plugin"
tfplugin6 "github.com/hashicorp/terraform/plugin6"
) )
// The TF_DISABLE_PLUGIN_TLS environment variable is intended only for use by // The TF_DISABLE_PLUGIN_TLS environment variable is intended only for use by

View File

@ -17,9 +17,9 @@ import (
localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec" localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec"
remoteexec "github.com/hashicorp/terraform/internal/builtin/provisioners/remote-exec" remoteexec "github.com/hashicorp/terraform/internal/builtin/provisioners/remote-exec"
"github.com/hashicorp/terraform/internal/logging" "github.com/hashicorp/terraform/internal/logging"
tfplugin "github.com/hashicorp/terraform/internal/plugin"
"github.com/hashicorp/terraform/internal/plugin/discovery"
"github.com/hashicorp/terraform/internal/provisioners" "github.com/hashicorp/terraform/internal/provisioners"
tfplugin "github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform/plugin/discovery"
) )
// NOTE WELL: The logic in this file is primarily about plugin types OTHER THAN // NOTE WELL: The logic in this file is primarily about plugin types OTHER THAN

View File

@ -9,8 +9,8 @@ import (
"github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/getproviders"
"github.com/hashicorp/terraform/internal/moduledeps" "github.com/hashicorp/terraform/internal/moduledeps"
"github.com/hashicorp/terraform/internal/plugin/discovery"
"github.com/hashicorp/terraform/internal/tfdiags" "github.com/hashicorp/terraform/internal/tfdiags"
"github.com/hashicorp/terraform/plugin/discovery"
) )
// A Config is a node in the tree of modules within a configuration. // A Config is a node in the tree of modules within a configuration.

View File

@ -3,9 +3,9 @@ package grpcwrap
import ( import (
"context" "context"
"github.com/hashicorp/terraform/internal/plugin/convert"
"github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin/convert"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
ctyjson "github.com/zclconf/go-cty/cty/json" ctyjson "github.com/zclconf/go-cty/cty/json"
"github.com/zclconf/go-cty/cty/msgpack" "github.com/zclconf/go-cty/cty/msgpack"

View File

@ -3,9 +3,9 @@ package grpcwrap
import ( import (
"context" "context"
"github.com/hashicorp/terraform/internal/plugin6/convert"
"github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/tfplugin6" "github.com/hashicorp/terraform/internal/tfplugin6"
"github.com/hashicorp/terraform/plugin6/convert"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
ctyjson "github.com/zclconf/go-cty/cty/json" ctyjson "github.com/zclconf/go-cty/cty/json"
"github.com/zclconf/go-cty/cty/msgpack" "github.com/zclconf/go-cty/cty/msgpack"

View File

@ -8,9 +8,9 @@ import (
"github.com/hashicorp/terraform/internal/communicator/shared" "github.com/hashicorp/terraform/internal/communicator/shared"
"github.com/hashicorp/terraform/internal/configs/configschema" "github.com/hashicorp/terraform/internal/configs/configschema"
"github.com/hashicorp/terraform/internal/plugin/convert"
"github.com/hashicorp/terraform/internal/provisioners" "github.com/hashicorp/terraform/internal/provisioners"
"github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin/convert"
) )
// New wraps a provisioners.Interface to implement a grpc ProviderServer. // New wraps a provisioners.Interface to implement a grpc ProviderServer.

View File

@ -2,7 +2,7 @@ package moduledeps
import ( import (
"github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/plugin/discovery" "github.com/hashicorp/terraform/internal/plugin/discovery"
) )
// Providers describes a set of provider dependencies for a given module. // Providers describes a set of provider dependencies for a given module.

View File

@ -4,7 +4,7 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/hashicorp/terraform/plugin/discovery" "github.com/hashicorp/terraform/internal/plugin/discovery"
) )
// Module represents the dependencies of a single module, as well being // Module represents the dependencies of a single module, as well being

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/plugin/discovery" "github.com/hashicorp/terraform/internal/plugin/discovery"
) )
func TestModuleWalkTree(t *testing.T) { func TestModuleWalkTree(t *testing.T) {

View File

@ -9,9 +9,9 @@ import (
plugin "github.com/hashicorp/go-plugin" plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/terraform/internal/logging" "github.com/hashicorp/terraform/internal/logging"
"github.com/hashicorp/terraform/internal/plugin/convert"
"github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/providers"
proto "github.com/hashicorp/terraform/internal/tfplugin5" proto "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin/convert"
ctyjson "github.com/zclconf/go-cty/cty/json" ctyjson "github.com/zclconf/go-cty/cty/json"
"github.com/zclconf/go-cty/cty/msgpack" "github.com/zclconf/go-cty/cty/msgpack"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -12,8 +12,8 @@ import (
"github.com/hashicorp/terraform/internal/tfdiags" "github.com/hashicorp/terraform/internal/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
mockproto "github.com/hashicorp/terraform/internal/plugin/mock_proto"
proto "github.com/hashicorp/terraform/internal/tfplugin5" proto "github.com/hashicorp/terraform/internal/tfplugin5"
mockproto "github.com/hashicorp/terraform/plugin/mock_proto"
) )
var _ providers.Interface = (*GRPCProvider)(nil) var _ providers.Interface = (*GRPCProvider)(nil)

View File

@ -8,9 +8,9 @@ import (
plugin "github.com/hashicorp/go-plugin" plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/terraform/internal/configs/configschema" "github.com/hashicorp/terraform/internal/configs/configschema"
"github.com/hashicorp/terraform/internal/plugin/convert"
"github.com/hashicorp/terraform/internal/provisioners" "github.com/hashicorp/terraform/internal/provisioners"
proto "github.com/hashicorp/terraform/internal/tfplugin5" proto "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin/convert"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/msgpack" "github.com/zclconf/go-cty/cty/msgpack"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -12,7 +12,7 @@ import (
proto "github.com/hashicorp/terraform/internal/tfplugin5" proto "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
mockproto "github.com/hashicorp/terraform/plugin/mock_proto" mockproto "github.com/hashicorp/terraform/internal/plugin/mock_proto"
) )
var _ provisioners.Interface = (*GRPCProvisioner)(nil) var _ provisioners.Interface = (*GRPCProvisioner)(nil)

View File

@ -2,7 +2,7 @@ package plugin
import ( import (
"github.com/hashicorp/go-plugin" "github.com/hashicorp/go-plugin"
"github.com/hashicorp/terraform/plugin6" "github.com/hashicorp/terraform/internal/plugin6"
) )
// VersionedPlugins includes both protocol 5 and 6 because this is the function // VersionedPlugins includes both protocol 5 and 6 because this is the function

View File

@ -9,9 +9,9 @@ import (
plugin "github.com/hashicorp/go-plugin" plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/terraform/internal/logging" "github.com/hashicorp/terraform/internal/logging"
"github.com/hashicorp/terraform/internal/plugin6/convert"
"github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/providers"
proto6 "github.com/hashicorp/terraform/internal/tfplugin6" proto6 "github.com/hashicorp/terraform/internal/tfplugin6"
"github.com/hashicorp/terraform/plugin6/convert"
ctyjson "github.com/zclconf/go-cty/cty/json" ctyjson "github.com/zclconf/go-cty/cty/json"
"github.com/zclconf/go-cty/cty/msgpack" "github.com/zclconf/go-cty/cty/msgpack"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -13,8 +13,8 @@ import (
"github.com/hashicorp/terraform/internal/tfdiags" "github.com/hashicorp/terraform/internal/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
mockproto "github.com/hashicorp/terraform/internal/plugin6/mock_proto"
proto "github.com/hashicorp/terraform/internal/tfplugin6" proto "github.com/hashicorp/terraform/internal/tfplugin6"
mockproto "github.com/hashicorp/terraform/plugin6/mock_proto"
) )
var _ providers.Interface = (*GRPCProvider)(nil) var _ providers.Interface = (*GRPCProvider)(nil)

View File

@ -2,9 +2,9 @@ package main
import ( import (
"github.com/hashicorp/terraform/internal/grpcwrap" "github.com/hashicorp/terraform/internal/grpcwrap"
plugin "github.com/hashicorp/terraform/internal/plugin6"
simple "github.com/hashicorp/terraform/internal/provider-simple-v6" simple "github.com/hashicorp/terraform/internal/provider-simple-v6"
"github.com/hashicorp/terraform/internal/tfplugin6" "github.com/hashicorp/terraform/internal/tfplugin6"
plugin "github.com/hashicorp/terraform/plugin6"
) )
func main() { func main() {

View File

@ -2,9 +2,9 @@ package main
import ( import (
"github.com/hashicorp/terraform/internal/grpcwrap" "github.com/hashicorp/terraform/internal/grpcwrap"
"github.com/hashicorp/terraform/internal/plugin"
simple "github.com/hashicorp/terraform/internal/provider-simple" simple "github.com/hashicorp/terraform/internal/provider-simple"
"github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin"
) )
func main() { func main() {

View File

@ -3,8 +3,8 @@ package main
import ( import (
"github.com/hashicorp/terraform/internal/builtin/providers/terraform" "github.com/hashicorp/terraform/internal/builtin/providers/terraform"
"github.com/hashicorp/terraform/internal/grpcwrap" "github.com/hashicorp/terraform/internal/grpcwrap"
"github.com/hashicorp/terraform/internal/plugin"
"github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin"
) )
func main() { func main() {

View File

@ -3,8 +3,8 @@ package main
import ( import (
localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec" localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec"
"github.com/hashicorp/terraform/internal/grpcwrap" "github.com/hashicorp/terraform/internal/grpcwrap"
"github.com/hashicorp/terraform/internal/plugin"
"github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/plugin"
) )
func main() { func main() {

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/hcl" "github.com/hashicorp/hcl"
"github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/getproviders"
"github.com/hashicorp/terraform/plugin/discovery" "github.com/hashicorp/terraform/internal/plugin/discovery"
) )
var zeroThirteen = discovery.ConstraintStr(">= 0.13.0").MustParse() var zeroThirteen = discovery.ConstraintStr(">= 0.13.0").MustParse()

View File

@ -19,9 +19,9 @@ import (
"github.com/hashicorp/terraform/internal/depsfile" "github.com/hashicorp/terraform/internal/depsfile"
"github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/getproviders"
"github.com/hashicorp/terraform/internal/httpclient" "github.com/hashicorp/terraform/internal/httpclient"
discovery "github.com/hashicorp/terraform/internal/plugin/discovery"
"github.com/hashicorp/terraform/internal/providercache" "github.com/hashicorp/terraform/internal/providercache"
"github.com/hashicorp/terraform/internal/tfdiags" "github.com/hashicorp/terraform/internal/tfdiags"
discovery "github.com/hashicorp/terraform/plugin/discovery"
"github.com/hashicorp/terraform/version" "github.com/hashicorp/terraform/version"
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
) )