From b40a4fb7417861daed11fc1229fe19beaa240197 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 17 May 2021 12:35:22 -0700 Subject: [PATCH] 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. --- commands.go | 2 +- internal/command/cliconfig/credentials.go | 2 +- internal/command/e2etest/unmanaged_test.go | 2 +- internal/command/meta_providers.go | 4 ++-- internal/command/plugins.go | 4 ++-- internal/earlyconfig/config.go | 2 +- internal/grpcwrap/provider.go | 2 +- internal/grpcwrap/provider6.go | 2 +- internal/grpcwrap/provisioner.go | 2 +- internal/moduledeps/dependencies.go | 2 +- internal/moduledeps/module.go | 2 +- internal/moduledeps/module_test.go | 2 +- {plugin => internal/plugin}/convert/diagnostics.go | 0 {plugin => internal/plugin}/convert/diagnostics_test.go | 0 {plugin => internal/plugin}/convert/schema.go | 0 {plugin => internal/plugin}/convert/schema_test.go | 0 {plugin => internal/plugin}/discovery/find.go | 0 {plugin => internal/plugin}/discovery/find_test.go | 0 {plugin => internal/plugin}/discovery/get_cache.go | 0 {plugin => internal/plugin}/discovery/get_cache_test.go | 0 {plugin => internal/plugin}/discovery/meta.go | 0 {plugin => internal/plugin}/discovery/meta_set.go | 0 {plugin => internal/plugin}/discovery/meta_set_test.go | 0 {plugin => internal/plugin}/discovery/meta_test.go | 0 {plugin => internal/plugin}/discovery/requirements.go | 0 {plugin => internal/plugin}/discovery/requirements_test.go | 0 .../mockos_mockarch/terraform-foo-bar_v0.0.1 | 0 .../mockos_mockarch/terraform-foo-bar_v1.0.0.exe | 0 .../mockos_mockarch/terraform-foo-missing-version | 0 .../mockos_mockarch/terraform-notfoo-bar_v0.0.1 | 0 .../discovery/testdata/legacy-style-plugins/terraform-foo-bar | 0 .../discovery/testdata/legacy-style-plugins/terraform-foo-baz | 0 .../testdata/legacy-style-plugins/terraform-notfoo-bar | 0 {plugin => internal/plugin}/discovery/testdata/not-a-dir | 0 .../testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 | 0 {plugin => internal/plugin}/discovery/version.go | 0 {plugin => internal/plugin}/discovery/version_set.go | 0 {plugin => internal/plugin}/discovery/version_set_test.go | 0 {plugin => internal/plugin}/discovery/version_test.go | 0 {plugin => internal/plugin}/grpc_error.go | 0 {plugin => internal/plugin}/grpc_provider.go | 2 +- {plugin => internal/plugin}/grpc_provider_test.go | 2 +- {plugin => internal/plugin}/grpc_provisioner.go | 2 +- {plugin => internal/plugin}/grpc_provisioner_test.go | 2 +- {plugin => internal/plugin}/mock_proto/generate.go | 0 {plugin => internal/plugin}/mock_proto/mock.go | 0 {plugin => internal/plugin}/plugin.go | 2 +- {plugin => internal/plugin}/serve.go | 0 {plugin => internal/plugin}/ui_input.go | 0 {plugin => internal/plugin}/ui_input_test.go | 0 {plugin => internal/plugin}/ui_output.go | 0 {plugin => internal/plugin}/ui_output_test.go | 0 {plugin6 => internal/plugin6}/convert/diagnostics.go | 0 {plugin6 => internal/plugin6}/convert/diagnostics_test.go | 0 {plugin6 => internal/plugin6}/convert/schema.go | 0 {plugin6 => internal/plugin6}/convert/schema_test.go | 0 {plugin6 => internal/plugin6}/doc.go | 0 {plugin6 => internal/plugin6}/grpc_error.go | 0 {plugin6 => internal/plugin6}/grpc_provider.go | 2 +- {plugin6 => internal/plugin6}/grpc_provider_test.go | 2 +- {plugin6 => internal/plugin6}/mock_proto/generate.go | 0 {plugin6 => internal/plugin6}/mock_proto/mock.go | 0 {plugin6 => internal/plugin6}/serve.go | 0 internal/provider-simple-v6/main/main.go | 2 +- internal/provider-simple/main/main.go | 2 +- internal/provider-terraform/main/main.go | 2 +- internal/provisioner-local-exec/main/main.go | 2 +- tools/terraform-bundle/config.go | 2 +- tools/terraform-bundle/package.go | 2 +- 69 files changed, 27 insertions(+), 27 deletions(-) rename {plugin => internal/plugin}/convert/diagnostics.go (100%) rename {plugin => internal/plugin}/convert/diagnostics_test.go (100%) rename {plugin => internal/plugin}/convert/schema.go (100%) rename {plugin => internal/plugin}/convert/schema_test.go (100%) rename {plugin => internal/plugin}/discovery/find.go (100%) rename {plugin => internal/plugin}/discovery/find_test.go (100%) rename {plugin => internal/plugin}/discovery/get_cache.go (100%) rename {plugin => internal/plugin}/discovery/get_cache_test.go (100%) rename {plugin => internal/plugin}/discovery/meta.go (100%) rename {plugin => internal/plugin}/discovery/meta_set.go (100%) rename {plugin => internal/plugin}/discovery/meta_set_test.go (100%) rename {plugin => internal/plugin}/discovery/meta_test.go (100%) rename {plugin => internal/plugin}/discovery/requirements.go (100%) rename {plugin => internal/plugin}/discovery/requirements_test.go (100%) rename {plugin => internal/plugin}/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v0.0.1 (100%) rename {plugin => internal/plugin}/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v1.0.0.exe (100%) rename {plugin => internal/plugin}/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-missing-version (100%) rename {plugin => internal/plugin}/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-notfoo-bar_v0.0.1 (100%) rename {plugin => internal/plugin}/discovery/testdata/legacy-style-plugins/terraform-foo-bar (100%) rename {plugin => internal/plugin}/discovery/testdata/legacy-style-plugins/terraform-foo-baz (100%) rename {plugin => internal/plugin}/discovery/testdata/legacy-style-plugins/terraform-notfoo-bar (100%) rename {plugin => internal/plugin}/discovery/testdata/not-a-dir (100%) rename {plugin => internal/plugin}/discovery/testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 (100%) rename {plugin => internal/plugin}/discovery/version.go (100%) rename {plugin => internal/plugin}/discovery/version_set.go (100%) rename {plugin => internal/plugin}/discovery/version_set_test.go (100%) rename {plugin => internal/plugin}/discovery/version_test.go (100%) rename {plugin => internal/plugin}/grpc_error.go (100%) rename {plugin => internal/plugin}/grpc_provider.go (99%) rename {plugin => internal/plugin}/grpc_provider_test.go (99%) rename {plugin => internal/plugin}/grpc_provisioner.go (98%) rename {plugin => internal/plugin}/grpc_provisioner_test.go (97%) rename {plugin => internal/plugin}/mock_proto/generate.go (100%) rename {plugin => internal/plugin}/mock_proto/mock.go (100%) rename {plugin => internal/plugin}/plugin.go (89%) rename {plugin => internal/plugin}/serve.go (100%) rename {plugin => internal/plugin}/ui_input.go (100%) rename {plugin => internal/plugin}/ui_input_test.go (100%) rename {plugin => internal/plugin}/ui_output.go (100%) rename {plugin => internal/plugin}/ui_output_test.go (100%) rename {plugin6 => internal/plugin6}/convert/diagnostics.go (100%) rename {plugin6 => internal/plugin6}/convert/diagnostics_test.go (100%) rename {plugin6 => internal/plugin6}/convert/schema.go (100%) rename {plugin6 => internal/plugin6}/convert/schema_test.go (100%) rename {plugin6 => internal/plugin6}/doc.go (100%) rename {plugin6 => internal/plugin6}/grpc_error.go (100%) rename {plugin6 => internal/plugin6}/grpc_provider.go (99%) rename {plugin6 => internal/plugin6}/grpc_provider_test.go (99%) rename {plugin6 => internal/plugin6}/mock_proto/generate.go (100%) rename {plugin6 => internal/plugin6}/mock_proto/mock.go (100%) rename {plugin6 => internal/plugin6}/serve.go (100%) diff --git a/commands.go b/commands.go index db764a810..657739ab5 100644 --- a/commands.go +++ b/commands.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform/internal/command/views" "github.com/hashicorp/terraform/internal/command/webbrowser" "github.com/hashicorp/terraform/internal/getproviders" + pluginDiscovery "github.com/hashicorp/terraform/internal/plugin/discovery" "github.com/hashicorp/terraform/internal/terminal" - pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery" ) // runningInAutomationEnvName gives the name of an environment variable that diff --git a/internal/command/cliconfig/credentials.go b/internal/command/cliconfig/credentials.go index 7c5dcd320..967f719eb 100644 --- a/internal/command/cliconfig/credentials.go +++ b/internal/command/cliconfig/credentials.go @@ -15,8 +15,8 @@ import ( svchost "github.com/hashicorp/terraform-svchost" svcauth "github.com/hashicorp/terraform-svchost/auth" "github.com/hashicorp/terraform/internal/configs/hcl2shim" + pluginDiscovery "github.com/hashicorp/terraform/internal/plugin/discovery" "github.com/hashicorp/terraform/internal/replacefile" - pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery" ) // credentialsConfigFile returns the path for the special configuration file diff --git a/internal/command/e2etest/unmanaged_test.go b/internal/command/e2etest/unmanaged_test.go index 4d5c5130d..d202884e3 100644 --- a/internal/command/e2etest/unmanaged_test.go +++ b/internal/command/e2etest/unmanaged_test.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/internal/e2e" "github.com/hashicorp/terraform/internal/grpcwrap" + tfplugin "github.com/hashicorp/terraform/internal/plugin" simple "github.com/hashicorp/terraform/internal/provider-simple" 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 diff --git a/internal/command/meta_providers.go b/internal/command/meta_providers.go index d9a75fe40..74b786b06 100644 --- a/internal/command/meta_providers.go +++ b/internal/command/meta_providers.go @@ -16,11 +16,11 @@ import ( "github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/logging" "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/providers" "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 diff --git a/internal/command/plugins.go b/internal/command/plugins.go index c842ee63c..dba535137 100644 --- a/internal/command/plugins.go +++ b/internal/command/plugins.go @@ -17,9 +17,9 @@ import ( localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec" remoteexec "github.com/hashicorp/terraform/internal/builtin/provisioners/remote-exec" "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" - 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 diff --git a/internal/earlyconfig/config.go b/internal/earlyconfig/config.go index 4ca206603..5ad9f6666 100644 --- a/internal/earlyconfig/config.go +++ b/internal/earlyconfig/config.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/moduledeps" + "github.com/hashicorp/terraform/internal/plugin/discovery" "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. diff --git a/internal/grpcwrap/provider.go b/internal/grpcwrap/provider.go index 7e8675f9e..4671606c2 100644 --- a/internal/grpcwrap/provider.go +++ b/internal/grpcwrap/provider.go @@ -3,9 +3,9 @@ package grpcwrap import ( "context" + "github.com/hashicorp/terraform/internal/plugin/convert" "github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/tfplugin5" - "github.com/hashicorp/terraform/plugin/convert" "github.com/zclconf/go-cty/cty" ctyjson "github.com/zclconf/go-cty/cty/json" "github.com/zclconf/go-cty/cty/msgpack" diff --git a/internal/grpcwrap/provider6.go b/internal/grpcwrap/provider6.go index 28d463e56..dd82e0956 100644 --- a/internal/grpcwrap/provider6.go +++ b/internal/grpcwrap/provider6.go @@ -3,9 +3,9 @@ package grpcwrap import ( "context" + "github.com/hashicorp/terraform/internal/plugin6/convert" "github.com/hashicorp/terraform/internal/providers" "github.com/hashicorp/terraform/internal/tfplugin6" - "github.com/hashicorp/terraform/plugin6/convert" "github.com/zclconf/go-cty/cty" ctyjson "github.com/zclconf/go-cty/cty/json" "github.com/zclconf/go-cty/cty/msgpack" diff --git a/internal/grpcwrap/provisioner.go b/internal/grpcwrap/provisioner.go index c56120ec4..ef265248a 100644 --- a/internal/grpcwrap/provisioner.go +++ b/internal/grpcwrap/provisioner.go @@ -8,9 +8,9 @@ import ( "github.com/hashicorp/terraform/internal/communicator/shared" "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/tfplugin5" - "github.com/hashicorp/terraform/plugin/convert" ) // New wraps a provisioners.Interface to implement a grpc ProviderServer. diff --git a/internal/moduledeps/dependencies.go b/internal/moduledeps/dependencies.go index ef11e063a..6de7aff0b 100644 --- a/internal/moduledeps/dependencies.go +++ b/internal/moduledeps/dependencies.go @@ -2,7 +2,7 @@ package moduledeps import ( "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. diff --git a/internal/moduledeps/module.go b/internal/moduledeps/module.go index 4db9b3f20..e428a4ec4 100644 --- a/internal/moduledeps/module.go +++ b/internal/moduledeps/module.go @@ -4,7 +4,7 @@ import ( "sort" "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 diff --git a/internal/moduledeps/module_test.go b/internal/moduledeps/module_test.go index 6b50ffe1b..dfbc99d21 100644 --- a/internal/moduledeps/module_test.go +++ b/internal/moduledeps/module_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/terraform/internal/addrs" - "github.com/hashicorp/terraform/plugin/discovery" + "github.com/hashicorp/terraform/internal/plugin/discovery" ) func TestModuleWalkTree(t *testing.T) { diff --git a/plugin/convert/diagnostics.go b/internal/plugin/convert/diagnostics.go similarity index 100% rename from plugin/convert/diagnostics.go rename to internal/plugin/convert/diagnostics.go diff --git a/plugin/convert/diagnostics_test.go b/internal/plugin/convert/diagnostics_test.go similarity index 100% rename from plugin/convert/diagnostics_test.go rename to internal/plugin/convert/diagnostics_test.go diff --git a/plugin/convert/schema.go b/internal/plugin/convert/schema.go similarity index 100% rename from plugin/convert/schema.go rename to internal/plugin/convert/schema.go diff --git a/plugin/convert/schema_test.go b/internal/plugin/convert/schema_test.go similarity index 100% rename from plugin/convert/schema_test.go rename to internal/plugin/convert/schema_test.go diff --git a/plugin/discovery/find.go b/internal/plugin/discovery/find.go similarity index 100% rename from plugin/discovery/find.go rename to internal/plugin/discovery/find.go diff --git a/plugin/discovery/find_test.go b/internal/plugin/discovery/find_test.go similarity index 100% rename from plugin/discovery/find_test.go rename to internal/plugin/discovery/find_test.go diff --git a/plugin/discovery/get_cache.go b/internal/plugin/discovery/get_cache.go similarity index 100% rename from plugin/discovery/get_cache.go rename to internal/plugin/discovery/get_cache.go diff --git a/plugin/discovery/get_cache_test.go b/internal/plugin/discovery/get_cache_test.go similarity index 100% rename from plugin/discovery/get_cache_test.go rename to internal/plugin/discovery/get_cache_test.go diff --git a/plugin/discovery/meta.go b/internal/plugin/discovery/meta.go similarity index 100% rename from plugin/discovery/meta.go rename to internal/plugin/discovery/meta.go diff --git a/plugin/discovery/meta_set.go b/internal/plugin/discovery/meta_set.go similarity index 100% rename from plugin/discovery/meta_set.go rename to internal/plugin/discovery/meta_set.go diff --git a/plugin/discovery/meta_set_test.go b/internal/plugin/discovery/meta_set_test.go similarity index 100% rename from plugin/discovery/meta_set_test.go rename to internal/plugin/discovery/meta_set_test.go diff --git a/plugin/discovery/meta_test.go b/internal/plugin/discovery/meta_test.go similarity index 100% rename from plugin/discovery/meta_test.go rename to internal/plugin/discovery/meta_test.go diff --git a/plugin/discovery/requirements.go b/internal/plugin/discovery/requirements.go similarity index 100% rename from plugin/discovery/requirements.go rename to internal/plugin/discovery/requirements.go diff --git a/plugin/discovery/requirements_test.go b/internal/plugin/discovery/requirements_test.go similarity index 100% rename from plugin/discovery/requirements_test.go rename to internal/plugin/discovery/requirements_test.go diff --git a/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v0.0.1 b/internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v0.0.1 similarity index 100% rename from plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v0.0.1 rename to internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v0.0.1 diff --git a/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v1.0.0.exe b/internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v1.0.0.exe similarity index 100% rename from plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v1.0.0.exe rename to internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-bar_v1.0.0.exe diff --git a/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-missing-version b/internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-missing-version similarity index 100% rename from plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-missing-version rename to internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-foo-missing-version diff --git a/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-notfoo-bar_v0.0.1 b/internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-notfoo-bar_v0.0.1 similarity index 100% rename from plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-notfoo-bar_v0.0.1 rename to internal/plugin/discovery/testdata/current-style-plugins/mockos_mockarch/terraform-notfoo-bar_v0.0.1 diff --git a/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-bar b/internal/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-bar similarity index 100% rename from plugin/discovery/testdata/legacy-style-plugins/terraform-foo-bar rename to internal/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-bar diff --git a/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-baz b/internal/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-baz similarity index 100% rename from plugin/discovery/testdata/legacy-style-plugins/terraform-foo-baz rename to internal/plugin/discovery/testdata/legacy-style-plugins/terraform-foo-baz diff --git a/plugin/discovery/testdata/legacy-style-plugins/terraform-notfoo-bar b/internal/plugin/discovery/testdata/legacy-style-plugins/terraform-notfoo-bar similarity index 100% rename from plugin/discovery/testdata/legacy-style-plugins/terraform-notfoo-bar rename to internal/plugin/discovery/testdata/legacy-style-plugins/terraform-notfoo-bar diff --git a/plugin/discovery/testdata/not-a-dir b/internal/plugin/discovery/testdata/not-a-dir similarity index 100% rename from plugin/discovery/testdata/not-a-dir rename to internal/plugin/discovery/testdata/not-a-dir diff --git a/plugin/discovery/testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 b/internal/plugin/discovery/testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 similarity index 100% rename from plugin/discovery/testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 rename to internal/plugin/discovery/testdata/plugin-cache/terraform-provider-foo_v0.0.1_x4 diff --git a/plugin/discovery/version.go b/internal/plugin/discovery/version.go similarity index 100% rename from plugin/discovery/version.go rename to internal/plugin/discovery/version.go diff --git a/plugin/discovery/version_set.go b/internal/plugin/discovery/version_set.go similarity index 100% rename from plugin/discovery/version_set.go rename to internal/plugin/discovery/version_set.go diff --git a/plugin/discovery/version_set_test.go b/internal/plugin/discovery/version_set_test.go similarity index 100% rename from plugin/discovery/version_set_test.go rename to internal/plugin/discovery/version_set_test.go diff --git a/plugin/discovery/version_test.go b/internal/plugin/discovery/version_test.go similarity index 100% rename from plugin/discovery/version_test.go rename to internal/plugin/discovery/version_test.go diff --git a/plugin/grpc_error.go b/internal/plugin/grpc_error.go similarity index 100% rename from plugin/grpc_error.go rename to internal/plugin/grpc_error.go diff --git a/plugin/grpc_provider.go b/internal/plugin/grpc_provider.go similarity index 99% rename from plugin/grpc_provider.go rename to internal/plugin/grpc_provider.go index 7f1e89bfa..1d522c2d7 100644 --- a/plugin/grpc_provider.go +++ b/internal/plugin/grpc_provider.go @@ -9,9 +9,9 @@ import ( plugin "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/internal/logging" + "github.com/hashicorp/terraform/internal/plugin/convert" "github.com/hashicorp/terraform/internal/providers" proto "github.com/hashicorp/terraform/internal/tfplugin5" - "github.com/hashicorp/terraform/plugin/convert" ctyjson "github.com/zclconf/go-cty/cty/json" "github.com/zclconf/go-cty/cty/msgpack" "google.golang.org/grpc" diff --git a/plugin/grpc_provider_test.go b/internal/plugin/grpc_provider_test.go similarity index 99% rename from plugin/grpc_provider_test.go rename to internal/plugin/grpc_provider_test.go index fce587c2c..a78c6d318 100644 --- a/plugin/grpc_provider_test.go +++ b/internal/plugin/grpc_provider_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform/internal/tfdiags" "github.com/zclconf/go-cty/cty" + mockproto "github.com/hashicorp/terraform/internal/plugin/mock_proto" proto "github.com/hashicorp/terraform/internal/tfplugin5" - mockproto "github.com/hashicorp/terraform/plugin/mock_proto" ) var _ providers.Interface = (*GRPCProvider)(nil) diff --git a/plugin/grpc_provisioner.go b/internal/plugin/grpc_provisioner.go similarity index 98% rename from plugin/grpc_provisioner.go rename to internal/plugin/grpc_provisioner.go index ed5cb64c5..0a6ad8e63 100644 --- a/plugin/grpc_provisioner.go +++ b/internal/plugin/grpc_provisioner.go @@ -8,9 +8,9 @@ import ( plugin "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/internal/configs/configschema" + "github.com/hashicorp/terraform/internal/plugin/convert" "github.com/hashicorp/terraform/internal/provisioners" 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/msgpack" "google.golang.org/grpc" diff --git a/plugin/grpc_provisioner_test.go b/internal/plugin/grpc_provisioner_test.go similarity index 97% rename from plugin/grpc_provisioner_test.go rename to internal/plugin/grpc_provisioner_test.go index 775b449f2..ab775cdbd 100644 --- a/plugin/grpc_provisioner_test.go +++ b/internal/plugin/grpc_provisioner_test.go @@ -12,7 +12,7 @@ import ( proto "github.com/hashicorp/terraform/internal/tfplugin5" "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) diff --git a/plugin/mock_proto/generate.go b/internal/plugin/mock_proto/generate.go similarity index 100% rename from plugin/mock_proto/generate.go rename to internal/plugin/mock_proto/generate.go diff --git a/plugin/mock_proto/mock.go b/internal/plugin/mock_proto/mock.go similarity index 100% rename from plugin/mock_proto/mock.go rename to internal/plugin/mock_proto/mock.go diff --git a/plugin/plugin.go b/internal/plugin/plugin.go similarity index 89% rename from plugin/plugin.go rename to internal/plugin/plugin.go index 3f962f113..27df5ba0c 100644 --- a/plugin/plugin.go +++ b/internal/plugin/plugin.go @@ -2,7 +2,7 @@ package plugin import ( "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 diff --git a/plugin/serve.go b/internal/plugin/serve.go similarity index 100% rename from plugin/serve.go rename to internal/plugin/serve.go diff --git a/plugin/ui_input.go b/internal/plugin/ui_input.go similarity index 100% rename from plugin/ui_input.go rename to internal/plugin/ui_input.go diff --git a/plugin/ui_input_test.go b/internal/plugin/ui_input_test.go similarity index 100% rename from plugin/ui_input_test.go rename to internal/plugin/ui_input_test.go diff --git a/plugin/ui_output.go b/internal/plugin/ui_output.go similarity index 100% rename from plugin/ui_output.go rename to internal/plugin/ui_output.go diff --git a/plugin/ui_output_test.go b/internal/plugin/ui_output_test.go similarity index 100% rename from plugin/ui_output_test.go rename to internal/plugin/ui_output_test.go diff --git a/plugin6/convert/diagnostics.go b/internal/plugin6/convert/diagnostics.go similarity index 100% rename from plugin6/convert/diagnostics.go rename to internal/plugin6/convert/diagnostics.go diff --git a/plugin6/convert/diagnostics_test.go b/internal/plugin6/convert/diagnostics_test.go similarity index 100% rename from plugin6/convert/diagnostics_test.go rename to internal/plugin6/convert/diagnostics_test.go diff --git a/plugin6/convert/schema.go b/internal/plugin6/convert/schema.go similarity index 100% rename from plugin6/convert/schema.go rename to internal/plugin6/convert/schema.go diff --git a/plugin6/convert/schema_test.go b/internal/plugin6/convert/schema_test.go similarity index 100% rename from plugin6/convert/schema_test.go rename to internal/plugin6/convert/schema_test.go diff --git a/plugin6/doc.go b/internal/plugin6/doc.go similarity index 100% rename from plugin6/doc.go rename to internal/plugin6/doc.go diff --git a/plugin6/grpc_error.go b/internal/plugin6/grpc_error.go similarity index 100% rename from plugin6/grpc_error.go rename to internal/plugin6/grpc_error.go diff --git a/plugin6/grpc_provider.go b/internal/plugin6/grpc_provider.go similarity index 99% rename from plugin6/grpc_provider.go rename to internal/plugin6/grpc_provider.go index fa08034d9..3897a17fe 100644 --- a/plugin6/grpc_provider.go +++ b/internal/plugin6/grpc_provider.go @@ -9,9 +9,9 @@ import ( plugin "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/internal/logging" + "github.com/hashicorp/terraform/internal/plugin6/convert" "github.com/hashicorp/terraform/internal/providers" proto6 "github.com/hashicorp/terraform/internal/tfplugin6" - "github.com/hashicorp/terraform/plugin6/convert" ctyjson "github.com/zclconf/go-cty/cty/json" "github.com/zclconf/go-cty/cty/msgpack" "google.golang.org/grpc" diff --git a/plugin6/grpc_provider_test.go b/internal/plugin6/grpc_provider_test.go similarity index 99% rename from plugin6/grpc_provider_test.go rename to internal/plugin6/grpc_provider_test.go index 645dcf7a1..ee58f5779 100644 --- a/plugin6/grpc_provider_test.go +++ b/internal/plugin6/grpc_provider_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform/internal/tfdiags" "github.com/zclconf/go-cty/cty" + mockproto "github.com/hashicorp/terraform/internal/plugin6/mock_proto" proto "github.com/hashicorp/terraform/internal/tfplugin6" - mockproto "github.com/hashicorp/terraform/plugin6/mock_proto" ) var _ providers.Interface = (*GRPCProvider)(nil) diff --git a/plugin6/mock_proto/generate.go b/internal/plugin6/mock_proto/generate.go similarity index 100% rename from plugin6/mock_proto/generate.go rename to internal/plugin6/mock_proto/generate.go diff --git a/plugin6/mock_proto/mock.go b/internal/plugin6/mock_proto/mock.go similarity index 100% rename from plugin6/mock_proto/mock.go rename to internal/plugin6/mock_proto/mock.go diff --git a/plugin6/serve.go b/internal/plugin6/serve.go similarity index 100% rename from plugin6/serve.go rename to internal/plugin6/serve.go diff --git a/internal/provider-simple-v6/main/main.go b/internal/provider-simple-v6/main/main.go index e0acf496d..cc2bbc3c3 100644 --- a/internal/provider-simple-v6/main/main.go +++ b/internal/provider-simple-v6/main/main.go @@ -2,9 +2,9 @@ package main import ( "github.com/hashicorp/terraform/internal/grpcwrap" + plugin "github.com/hashicorp/terraform/internal/plugin6" simple "github.com/hashicorp/terraform/internal/provider-simple-v6" "github.com/hashicorp/terraform/internal/tfplugin6" - plugin "github.com/hashicorp/terraform/plugin6" ) func main() { diff --git a/internal/provider-simple/main/main.go b/internal/provider-simple/main/main.go index be0ad2ef4..8e8ceadff 100644 --- a/internal/provider-simple/main/main.go +++ b/internal/provider-simple/main/main.go @@ -2,9 +2,9 @@ package main import ( "github.com/hashicorp/terraform/internal/grpcwrap" + "github.com/hashicorp/terraform/internal/plugin" simple "github.com/hashicorp/terraform/internal/provider-simple" "github.com/hashicorp/terraform/internal/tfplugin5" - "github.com/hashicorp/terraform/plugin" ) func main() { diff --git a/internal/provider-terraform/main/main.go b/internal/provider-terraform/main/main.go index 51b463f4f..a50fef2d9 100644 --- a/internal/provider-terraform/main/main.go +++ b/internal/provider-terraform/main/main.go @@ -3,8 +3,8 @@ package main import ( "github.com/hashicorp/terraform/internal/builtin/providers/terraform" "github.com/hashicorp/terraform/internal/grpcwrap" + "github.com/hashicorp/terraform/internal/plugin" "github.com/hashicorp/terraform/internal/tfplugin5" - "github.com/hashicorp/terraform/plugin" ) func main() { diff --git a/internal/provisioner-local-exec/main/main.go b/internal/provisioner-local-exec/main/main.go index 9920136f8..78f14b37a 100644 --- a/internal/provisioner-local-exec/main/main.go +++ b/internal/provisioner-local-exec/main/main.go @@ -3,8 +3,8 @@ package main import ( localexec "github.com/hashicorp/terraform/internal/builtin/provisioners/local-exec" "github.com/hashicorp/terraform/internal/grpcwrap" + "github.com/hashicorp/terraform/internal/plugin" "github.com/hashicorp/terraform/internal/tfplugin5" - "github.com/hashicorp/terraform/plugin" ) func main() { diff --git a/tools/terraform-bundle/config.go b/tools/terraform-bundle/config.go index a9aa410d8..74bcad96c 100644 --- a/tools/terraform-bundle/config.go +++ b/tools/terraform-bundle/config.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/hcl" "github.com/hashicorp/terraform/internal/addrs" "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() diff --git a/tools/terraform-bundle/package.go b/tools/terraform-bundle/package.go index 78a6495fb..d2831c087 100644 --- a/tools/terraform-bundle/package.go +++ b/tools/terraform-bundle/package.go @@ -19,9 +19,9 @@ import ( "github.com/hashicorp/terraform/internal/depsfile" "github.com/hashicorp/terraform/internal/getproviders" "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/tfdiags" - discovery "github.com/hashicorp/terraform/plugin/discovery" "github.com/hashicorp/terraform/version" "github.com/mitchellh/cli" )