From ec85fb196063fead1d3aab34810a10f91081f1fc Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 17 May 2021 10:00:12 -0700 Subject: [PATCH] Move communicator/ to internal/communicator/ 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. --- .../builtin/provisioners/file/resource_provisioner.go | 2 +- .../provisioners/remote-exec/resource_provisioner.go | 4 ++-- .../provisioners/remote-exec/resource_provisioner_test.go | 4 ++-- {communicator => internal/communicator}/communicator.go | 8 ++++---- .../communicator}/communicator_mock.go | 2 +- .../communicator}/communicator_test.go | 0 {communicator => internal/communicator}/remote/command.go | 0 .../communicator}/remote/command_test.go | 0 {communicator => internal/communicator}/shared/shared.go | 0 .../communicator}/shared/shared_test.go | 0 .../communicator}/ssh/communicator.go | 2 +- .../communicator}/ssh/communicator_test.go | 2 +- {communicator => internal/communicator}/ssh/password.go | 0 .../communicator}/ssh/password_test.go | 0 .../communicator}/ssh/provisioner.go | 2 +- .../communicator}/ssh/provisioner_test.go | 0 {communicator => internal/communicator}/ssh/ssh_test.go | 0 .../communicator}/winrm/communicator.go | 2 +- .../communicator}/winrm/communicator_test.go | 4 ++-- .../communicator}/winrm/provisioner.go | 2 +- .../communicator}/winrm/provisioner_test.go | 0 internal/grpcwrap/provisioner.go | 2 +- 22 files changed, 18 insertions(+), 18 deletions(-) rename {communicator => internal/communicator}/communicator.go (93%) rename {communicator => internal/communicator}/communicator_mock.go (97%) rename {communicator => internal/communicator}/communicator_test.go (100%) rename {communicator => internal/communicator}/remote/command.go (100%) rename {communicator => internal/communicator}/remote/command_test.go (100%) rename {communicator => internal/communicator}/shared/shared.go (100%) rename {communicator => internal/communicator}/shared/shared_test.go (100%) rename {communicator => internal/communicator}/ssh/communicator.go (99%) rename {communicator => internal/communicator}/ssh/communicator_test.go (99%) rename {communicator => internal/communicator}/ssh/password.go (100%) rename {communicator => internal/communicator}/ssh/password_test.go (100%) rename {communicator => internal/communicator}/ssh/provisioner.go (99%) rename {communicator => internal/communicator}/ssh/provisioner_test.go (100%) rename {communicator => internal/communicator}/ssh/ssh_test.go (100%) rename {communicator => internal/communicator}/winrm/communicator.go (98%) rename {communicator => internal/communicator}/winrm/communicator_test.go (97%) rename {communicator => internal/communicator}/winrm/provisioner.go (98%) rename {communicator => internal/communicator}/winrm/provisioner_test.go (100%) diff --git a/internal/builtin/provisioners/file/resource_provisioner.go b/internal/builtin/provisioners/file/resource_provisioner.go index 29ed858754..7f35114ee1 100644 --- a/internal/builtin/provisioners/file/resource_provisioner.go +++ b/internal/builtin/provisioners/file/resource_provisioner.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "os" - "github.com/hashicorp/terraform/communicator" "github.com/hashicorp/terraform/configs/configschema" + "github.com/hashicorp/terraform/internal/communicator" "github.com/hashicorp/terraform/provisioners" "github.com/mitchellh/go-homedir" "github.com/zclconf/go-cty/cty" diff --git a/internal/builtin/provisioners/remote-exec/resource_provisioner.go b/internal/builtin/provisioners/remote-exec/resource_provisioner.go index 1abc562e6d..4ea765e0ed 100644 --- a/internal/builtin/provisioners/remote-exec/resource_provisioner.go +++ b/internal/builtin/provisioners/remote-exec/resource_provisioner.go @@ -11,9 +11,9 @@ import ( "os" "strings" - "github.com/hashicorp/terraform/communicator" - "github.com/hashicorp/terraform/communicator/remote" "github.com/hashicorp/terraform/configs/configschema" + "github.com/hashicorp/terraform/internal/communicator" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/hashicorp/terraform/provisioners" "github.com/mitchellh/go-linereader" "github.com/zclconf/go-cty/cty" diff --git a/internal/builtin/provisioners/remote-exec/resource_provisioner_test.go b/internal/builtin/provisioners/remote-exec/resource_provisioner_test.go index eb9da611d5..2bebbebf4c 100644 --- a/internal/builtin/provisioners/remote-exec/resource_provisioner_test.go +++ b/internal/builtin/provisioners/remote-exec/resource_provisioner_test.go @@ -11,8 +11,8 @@ import ( "strings" - "github.com/hashicorp/terraform/communicator" - "github.com/hashicorp/terraform/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/hashicorp/terraform/provisioners" "github.com/mitchellh/cli" "github.com/zclconf/go-cty/cty" diff --git a/communicator/communicator.go b/internal/communicator/communicator.go similarity index 93% rename from communicator/communicator.go rename to internal/communicator/communicator.go index 27261421e8..80faa25435 100644 --- a/communicator/communicator.go +++ b/internal/communicator/communicator.go @@ -8,10 +8,10 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/terraform/communicator/remote" - "github.com/hashicorp/terraform/communicator/shared" - "github.com/hashicorp/terraform/communicator/ssh" - "github.com/hashicorp/terraform/communicator/winrm" + "github.com/hashicorp/terraform/internal/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/shared" + "github.com/hashicorp/terraform/internal/communicator/ssh" + "github.com/hashicorp/terraform/internal/communicator/winrm" "github.com/hashicorp/terraform/provisioners" "github.com/zclconf/go-cty/cty" ) diff --git a/communicator/communicator_mock.go b/internal/communicator/communicator_mock.go similarity index 97% rename from communicator/communicator_mock.go rename to internal/communicator/communicator_mock.go index b619560c0c..89fbaf7c93 100644 --- a/communicator/communicator_mock.go +++ b/internal/communicator/communicator_mock.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/hashicorp/terraform/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/hashicorp/terraform/provisioners" ) diff --git a/communicator/communicator_test.go b/internal/communicator/communicator_test.go similarity index 100% rename from communicator/communicator_test.go rename to internal/communicator/communicator_test.go diff --git a/communicator/remote/command.go b/internal/communicator/remote/command.go similarity index 100% rename from communicator/remote/command.go rename to internal/communicator/remote/command.go diff --git a/communicator/remote/command_test.go b/internal/communicator/remote/command_test.go similarity index 100% rename from communicator/remote/command_test.go rename to internal/communicator/remote/command_test.go diff --git a/communicator/shared/shared.go b/internal/communicator/shared/shared.go similarity index 100% rename from communicator/shared/shared.go rename to internal/communicator/shared/shared.go diff --git a/communicator/shared/shared_test.go b/internal/communicator/shared/shared_test.go similarity index 100% rename from communicator/shared/shared_test.go rename to internal/communicator/shared/shared_test.go diff --git a/communicator/ssh/communicator.go b/internal/communicator/ssh/communicator.go similarity index 99% rename from communicator/ssh/communicator.go rename to internal/communicator/ssh/communicator.go index afbe54945e..2cd1b56a79 100644 --- a/communicator/ssh/communicator.go +++ b/internal/communicator/ssh/communicator.go @@ -19,7 +19,7 @@ import ( "time" "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/hashicorp/terraform/provisioners" "github.com/zclconf/go-cty/cty" "golang.org/x/crypto/ssh" diff --git a/communicator/ssh/communicator_test.go b/internal/communicator/ssh/communicator_test.go similarity index 99% rename from communicator/ssh/communicator_test.go rename to internal/communicator/ssh/communicator_test.go index b553576f83..c0bbeba77c 100644 --- a/communicator/ssh/communicator_test.go +++ b/internal/communicator/ssh/communicator_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "github.com/hashicorp/terraform/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/zclconf/go-cty/cty" "golang.org/x/crypto/ssh" ) diff --git a/communicator/ssh/password.go b/internal/communicator/ssh/password.go similarity index 100% rename from communicator/ssh/password.go rename to internal/communicator/ssh/password.go diff --git a/communicator/ssh/password_test.go b/internal/communicator/ssh/password_test.go similarity index 100% rename from communicator/ssh/password_test.go rename to internal/communicator/ssh/password_test.go diff --git a/communicator/ssh/provisioner.go b/internal/communicator/ssh/provisioner.go similarity index 99% rename from communicator/ssh/provisioner.go rename to internal/communicator/ssh/provisioner.go index 666f8fbeaf..438ba93e24 100644 --- a/communicator/ssh/provisioner.go +++ b/internal/communicator/ssh/provisioner.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "github.com/hashicorp/terraform/communicator/shared" + "github.com/hashicorp/terraform/internal/communicator/shared" sshagent "github.com/xanzy/ssh-agent" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" diff --git a/communicator/ssh/provisioner_test.go b/internal/communicator/ssh/provisioner_test.go similarity index 100% rename from communicator/ssh/provisioner_test.go rename to internal/communicator/ssh/provisioner_test.go diff --git a/communicator/ssh/ssh_test.go b/internal/communicator/ssh/ssh_test.go similarity index 100% rename from communicator/ssh/ssh_test.go rename to internal/communicator/ssh/ssh_test.go diff --git a/communicator/winrm/communicator.go b/internal/communicator/winrm/communicator.go similarity index 98% rename from communicator/winrm/communicator.go rename to internal/communicator/winrm/communicator.go index d877e3065f..d9aa20160e 100644 --- a/communicator/winrm/communicator.go +++ b/internal/communicator/winrm/communicator.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/hashicorp/terraform/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/remote" "github.com/hashicorp/terraform/provisioners" "github.com/masterzen/winrm" "github.com/packer-community/winrmcp/winrmcp" diff --git a/communicator/winrm/communicator_test.go b/internal/communicator/winrm/communicator_test.go similarity index 97% rename from communicator/winrm/communicator_test.go rename to internal/communicator/winrm/communicator_test.go index bd8d2ecd54..bc1de8e309 100644 --- a/communicator/winrm/communicator_test.go +++ b/internal/communicator/winrm/communicator_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/dylanmei/winrmtest" - "github.com/hashicorp/terraform/communicator/remote" - "github.com/hashicorp/terraform/communicator/shared" + "github.com/hashicorp/terraform/internal/communicator/remote" + "github.com/hashicorp/terraform/internal/communicator/shared" "github.com/zclconf/go-cty/cty" ) diff --git a/communicator/winrm/provisioner.go b/internal/communicator/winrm/provisioner.go similarity index 98% rename from communicator/winrm/provisioner.go rename to internal/communicator/winrm/provisioner.go index f77918ec87..3843c9d00e 100644 --- a/communicator/winrm/provisioner.go +++ b/internal/communicator/winrm/provisioner.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/hashicorp/terraform/communicator/shared" + "github.com/hashicorp/terraform/internal/communicator/shared" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/communicator/winrm/provisioner_test.go b/internal/communicator/winrm/provisioner_test.go similarity index 100% rename from communicator/winrm/provisioner_test.go rename to internal/communicator/winrm/provisioner_test.go diff --git a/internal/grpcwrap/provisioner.go b/internal/grpcwrap/provisioner.go index 8213b50826..9e11d6f329 100644 --- a/internal/grpcwrap/provisioner.go +++ b/internal/grpcwrap/provisioner.go @@ -6,8 +6,8 @@ import ( "strings" "unicode/utf8" - "github.com/hashicorp/terraform/communicator/shared" "github.com/hashicorp/terraform/configs/configschema" + "github.com/hashicorp/terraform/internal/communicator/shared" "github.com/hashicorp/terraform/internal/tfplugin5" "github.com/hashicorp/terraform/plugin/convert" "github.com/hashicorp/terraform/provisioners"