From 4243c3ae42cf46697fab572084b3ba702217447b Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 27 Mar 2019 08:54:56 -0400 Subject: [PATCH] Move internal/ to sdk/ (#5568) * Move internal/ to sdk/ * Add a readme to the SDK folder --- agent/agent_endpoint_test.go | 2 +- agent/agent_test.go | 4 ++-- agent/cache-types/connect_ca_leaf_test.go | 2 +- agent/catalog_endpoint_test.go | 2 +- agent/checks/alias_test.go | 2 +- agent/checks/check_test.go | 2 +- agent/config/runtime_test.go | 2 +- agent/config/segment_oss_test.go | 2 +- agent/consul/acl_endpoint_test.go | 2 +- agent/consul/acl_replication_legacy_test.go | 2 +- agent/consul/acl_replication_test.go | 2 +- agent/consul/acl_test.go | 2 +- agent/consul/autopilot_test.go | 2 +- agent/consul/catalog_endpoint_test.go | 2 +- agent/consul/client_test.go | 6 +++--- agent/consul/connect_ca_endpoint_test.go | 2 +- agent/consul/coordinate_endpoint_test.go | 2 +- agent/consul/helper_test.go | 2 +- agent/consul/leader_test.go | 2 +- agent/consul/operator_autopilot_endpoint_test.go | 2 +- agent/consul/operator_raft_endpoint_test.go | 2 +- agent/consul/prepared_query_endpoint_test.go | 2 +- agent/consul/rpc_test.go | 2 +- agent/consul/server_test.go | 6 +++--- agent/consul/session_ttl_test.go | 2 +- agent/consul/snapshot_endpoint_test.go | 2 +- agent/dns_test.go | 2 +- agent/event_endpoint_test.go | 2 +- agent/health_endpoint_test.go | 2 +- agent/http_test.go | 2 +- agent/keyring_test.go | 2 +- agent/local/state_test.go | 2 +- agent/operator_endpoint_test.go | 2 +- agent/proxyprocess/daemon_test.go | 2 +- agent/proxyprocess/manager_test.go | 2 +- agent/remote_exec_test.go | 2 +- agent/session_endpoint_test.go | 2 +- agent/testagent.go | 4 ++-- agent/ui_endpoint_test.go | 2 +- agent/user_event_test.go | 2 +- agent/util_test.go | 2 +- api/acl_test.go | 2 +- api/agent_test.go | 4 ++-- api/api_test.go | 2 +- api/catalog_test.go | 4 ++-- api/connect_ca_test.go | 4 ++-- api/coordinate_test.go | 2 +- api/debug_test.go | 2 +- api/event_test.go | 2 +- api/go.mod | 4 ++-- api/health_test.go | 4 ++-- api/lock_test.go | 2 +- api/operator_autopilot_test.go | 4 ++-- api/operator_keyring_test.go | 2 +- api/prepared_query_test.go | 2 +- command/acl/agenttokens/agent_tokens_test.go | 2 +- command/acl/bootstrap/bootstrap_test.go | 2 +- command/acl/policy/create/policy_create_test.go | 2 +- command/acl/policy/delete/policy_delete_test.go | 2 +- command/acl/policy/list/policy_list_test.go | 2 +- command/acl/policy/read/policy_read_test.go | 2 +- command/acl/policy/update/policy_update_test.go | 2 +- command/acl/rules/translate_test.go | 2 +- command/acl/token/clone/token_clone_test.go | 2 +- command/acl/token/create/token_create_test.go | 2 +- command/acl/token/delete/token_delete_test.go | 2 +- command/acl/token/list/token_list_test.go | 2 +- command/acl/token/read/token_read_test.go | 2 +- command/acl/token/update/token_update_test.go | 4 ++-- command/agent/agent_test.go | 4 ++-- command/connect/proxy/register_test.go | 2 +- command/debug/debug_test.go | 2 +- command/exec/exec_test.go | 2 +- command/forceleave/forceleave_test.go | 2 +- command/intention/create/create_test.go | 2 +- command/kv/put/kv_put_test.go | 2 +- command/rtt/rtt_test.go | 2 +- command/services/deregister/deregister_test.go | 2 +- command/services/register/register_test.go | 2 +- command/snapshot/inspect/snapshot_inspect_test.go | 2 +- command/snapshot/restore/snapshot_restore_test.go | 2 +- command/snapshot/save/snapshot_save_test.go | 2 +- command/tls/ca/create/tls_ca_create_test.go | 2 +- command/tls/cert/create/tls_cert_create_test.go | 2 +- command/validate/validate_test.go | 2 +- connect/proxy/listener_test.go | 2 +- connect/proxy/proxy_test.go | 4 ++-- connect/proxy/testing.go | 2 +- connect/service_test.go | 2 +- connect/testing.go | 2 +- go.mod | 4 ++-- go.sum | 1 + logger/logfile_test.go | 2 +- sdk/README.md | 7 +++++++ {internal => sdk}/freeport/freeport.go | 0 {internal => sdk}/go.mod | 2 +- {internal => sdk}/go.sum | 0 {internal => sdk}/testutil/README.md | 2 +- {internal => sdk}/testutil/io.go | 0 {internal => sdk}/testutil/retry/retry.go | 0 {internal => sdk}/testutil/retry/retry_test.go | 0 {internal => sdk}/testutil/server.go | 4 ++-- {internal => sdk}/testutil/server_methods.go | 0 {internal => sdk}/testutil/server_wrapper.go | 0 {internal => sdk}/testutil/testlog.go | 0 snapshot/snapshot_test.go | 2 +- testrpc/wait.go | 2 +- .../hashicorp/consul/internal/testutil/server.go | 4 ++-- 108 files changed, 124 insertions(+), 116 deletions(-) create mode 100644 sdk/README.md rename {internal => sdk}/freeport/freeport.go (100%) rename {internal => sdk}/go.mod (80%) rename {internal => sdk}/go.sum (100%) rename {internal => sdk}/testutil/README.md (97%) rename {internal => sdk}/testutil/io.go (100%) rename {internal => sdk}/testutil/retry/retry.go (100%) rename {internal => sdk}/testutil/retry/retry_test.go (100%) rename {internal => sdk}/testutil/server.go (99%) rename {internal => sdk}/testutil/server_methods.go (100%) rename {internal => sdk}/testutil/server_wrapper.go (100%) rename {internal => sdk}/testutil/testlog.go (100%) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index f13211292d..ce91ad9736 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -28,7 +28,7 @@ import ( "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" "github.com/hashicorp/go-uuid" "github.com/hashicorp/serf/serf" diff --git a/agent/agent_test.go b/agent/agent_test.go index d4cbac0865..17726d8474 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" uuid "github.com/hashicorp/go-uuid" "github.com/pascaldekloe/goe/verify" diff --git a/agent/cache-types/connect_ca_leaf_test.go b/agent/cache-types/connect_ca_leaf_test.go index 351ef8c6e6..e88ee7498c 100644 --- a/agent/cache-types/connect_ca_leaf_test.go +++ b/agent/cache-types/connect_ca_leaf_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/agent/cache" "github.com/hashicorp/consul/agent/connect" diff --git a/agent/catalog_endpoint_test.go b/agent/catalog_endpoint_test.go index 8e5d8d39fd..74f2219dd5 100644 --- a/agent/catalog_endpoint_test.go +++ b/agent/catalog_endpoint_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/agent/checks/alias_test.go b/agent/checks/alias_test.go index ab358bff9f..9f557f4caf 100644 --- a/agent/checks/alias_test.go +++ b/agent/checks/alias_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent/mock" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" //"github.com/stretchr/testify/require" ) diff --git a/agent/checks/check_test.go b/agent/checks/check_test.go index d14f606dba..3597bc70bd 100644 --- a/agent/checks/check_test.go +++ b/agent/checks/check_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/consul/agent/mock" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" uuid "github.com/hashicorp/go-uuid" ) diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index a7de25c81e..329abfb6a7 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/lib" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/types" "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/require" diff --git a/agent/config/segment_oss_test.go b/agent/config/segment_oss_test.go index 375eedb408..66d32f22f1 100644 --- a/agent/config/segment_oss_test.go +++ b/agent/config/segment_oss_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" ) func TestSegments(t *testing.T) { diff --git a/agent/consul/acl_endpoint_test.go b/agent/consul/acl_endpoint_test.go index 24403df673..7b79067aaa 100644 --- a/agent/consul/acl_endpoint_test.go +++ b/agent/consul/acl_endpoint_test.go @@ -16,7 +16,7 @@ import ( tokenStore "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" uuid "github.com/hashicorp/go-uuid" msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/stretchr/testify/require" diff --git a/agent/consul/acl_replication_legacy_test.go b/agent/consul/acl_replication_legacy_test.go index 1f87dc2feb..ed36865564 100644 --- a/agent/consul/acl_replication_legacy_test.go +++ b/agent/consul/acl_replication_legacy_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/consul/agent/structs" tokenStore "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestACLReplication_Sorter(t *testing.T) { diff --git a/agent/consul/acl_replication_test.go b/agent/consul/acl_replication_test.go index 2ad686956e..7a9744801d 100644 --- a/agent/consul/acl_replication_test.go +++ b/agent/consul/acl_replication_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent/structs" tokenStore "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/agent/consul/acl_test.go b/agent/consul/acl_test.go index d749e602db..38b723cbdb 100644 --- a/agent/consul/acl_test.go +++ b/agent/consul/acl_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/agent/consul/autopilot_test.go b/agent/consul/autopilot_test.go index be7fc27449..232cf720de 100644 --- a/agent/consul/autopilot_test.go +++ b/agent/consul/autopilot_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/raft" "github.com/hashicorp/serf/serf" ) diff --git a/agent/consul/catalog_endpoint_test.go b/agent/consul/catalog_endpoint_test.go index 5b73fb3640..421ddf7003 100644 --- a/agent/consul/catalog_endpoint_test.go +++ b/agent/consul/catalog_endpoint_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/stretchr/testify/assert" diff --git a/agent/consul/client_test.go b/agent/consul/client_test.go index 0c9292bdaa..784ec1ef2b 100644 --- a/agent/consul/client_test.go +++ b/agent/consul/client_test.go @@ -9,10 +9,10 @@ import ( "time" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/serf/serf" "github.com/stretchr/testify/require" diff --git a/agent/consul/connect_ca_endpoint_test.go b/agent/consul/connect_ca_endpoint_test.go index 1a0992cd34..1e98a7c464 100644 --- a/agent/consul/connect_ca_endpoint_test.go +++ b/agent/consul/connect_ca_endpoint_test.go @@ -15,7 +15,7 @@ import ( ca "github.com/hashicorp/consul/agent/connect/ca" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/stretchr/testify/assert" ) diff --git a/agent/consul/coordinate_endpoint_test.go b/agent/consul/coordinate_endpoint_test.go index 29f27e67be..ead5481339 100644 --- a/agent/consul/coordinate_endpoint_test.go +++ b/agent/consul/coordinate_endpoint_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/serf/coordinate" "github.com/pascaldekloe/goe/verify" diff --git a/agent/consul/helper_test.go b/agent/consul/helper_test.go index 86ec55ceda..f130860e6e 100644 --- a/agent/consul/helper_test.go +++ b/agent/consul/helper_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/raft" "github.com/hashicorp/serf/serf" "github.com/stretchr/testify/require" diff --git a/agent/consul/leader_test.go b/agent/consul/leader_test.go index 84037737e5..556e37798b 100644 --- a/agent/consul/leader_test.go +++ b/agent/consul/leader_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/serf/serf" "github.com/stretchr/testify/require" diff --git a/agent/consul/operator_autopilot_endpoint_test.go b/agent/consul/operator_autopilot_endpoint_test.go index aa534b141c..2ce91bf629 100644 --- a/agent/consul/operator_autopilot_endpoint_test.go +++ b/agent/consul/operator_autopilot_endpoint_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent/consul/autopilot" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/raft" ) diff --git a/agent/consul/operator_raft_endpoint_test.go b/agent/consul/operator_raft_endpoint_test.go index 65c8c14a9b..23b1da7924 100644 --- a/agent/consul/operator_raft_endpoint_test.go +++ b/agent/consul/operator_raft_endpoint_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/testrpc" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/raft" diff --git a/agent/consul/prepared_query_endpoint_test.go b/agent/consul/prepared_query_endpoint_test.go index c5136b286b..90532c4af1 100644 --- a/agent/consul/prepared_query_endpoint_test.go +++ b/agent/consul/prepared_query_endpoint_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/serf/coordinate" diff --git a/agent/consul/rpc_test.go b/agent/consul/rpc_test.go index 777883323a..186e08d204 100644 --- a/agent/consul/rpc_test.go +++ b/agent/consul/rpc_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent/consul/state" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-memdb" "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/stretchr/testify/assert" diff --git a/agent/consul/server_test.go b/agent/consul/server_test.go index dddd3942ca..9aa48ad785 100644 --- a/agent/consul/server_test.go +++ b/agent/consul/server_test.go @@ -14,10 +14,10 @@ import ( "github.com/hashicorp/consul/agent/metadata" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/token" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/tlsutil" "github.com/hashicorp/consul/types" "github.com/hashicorp/go-uuid" diff --git a/agent/consul/session_ttl_test.go b/agent/consul/session_ttl_test.go index e0f0adfd6a..fe668a0a05 100644 --- a/agent/consul/session_ttl_test.go +++ b/agent/consul/session_ttl_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-uuid" "github.com/hashicorp/net-rpc-msgpackrpc" ) diff --git a/agent/consul/snapshot_endpoint_test.go b/agent/consul/snapshot_endpoint_test.go index 201c65ae68..892c94dd04 100644 --- a/agent/consul/snapshot_endpoint_test.go +++ b/agent/consul/snapshot_endpoint_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/net-rpc-msgpackrpc" ) diff --git a/agent/dns_test.go b/agent/dns_test.go index fddbd222ff..4c1316f977 100644 --- a/agent/dns_test.go +++ b/agent/dns_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" "github.com/miekg/dns" "github.com/pascaldekloe/goe/verify" diff --git a/agent/event_endpoint_test.go b/agent/event_endpoint_test.go index 04b36944dd..971fbe737f 100644 --- a/agent/event_endpoint_test.go +++ b/agent/event_endpoint_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestEventFire(t *testing.T) { diff --git a/agent/health_endpoint_test.go b/agent/health_endpoint_test.go index a9a21ed228..231123528b 100644 --- a/agent/health_endpoint_test.go +++ b/agent/health_endpoint_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/agent/http_test.go b/agent/http_test.go index b84ab24ae7..9fe7238361 100644 --- a/agent/http_test.go +++ b/agent/http_test.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/consul/agent/structs" tokenStore "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/testrpc" cleanhttp "github.com/hashicorp/go-cleanhttp" "github.com/stretchr/testify/assert" diff --git a/agent/keyring_test.go b/agent/keyring_test.go index 6ad35b03ac..9812577944 100644 --- a/agent/keyring_test.go +++ b/agent/keyring_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/memberlist" ) diff --git a/agent/local/state_test.go b/agent/local/state_test.go index 7013ea1f4a..bc5ebc390c 100644 --- a/agent/local/state_test.go +++ b/agent/local/state_test.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/types" "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/assert" diff --git a/agent/operator_endpoint_test.go b/agent/operator_endpoint_test.go index 8504cffb47..a05d8de3da 100644 --- a/agent/operator_endpoint_test.go +++ b/agent/operator_endpoint_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/agent/consul/autopilot" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestOperator_RaftConfiguration(t *testing.T) { diff --git a/agent/proxyprocess/daemon_test.go b/agent/proxyprocess/daemon_test.go index 79183c4440..a8f9c7bc2c 100644 --- a/agent/proxyprocess/daemon_test.go +++ b/agent/proxyprocess/daemon_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-uuid" "github.com/stretchr/testify/require" ) diff --git a/agent/proxyprocess/manager_test.go b/agent/proxyprocess/manager_test.go index 6f2314bb04..59221b11d2 100644 --- a/agent/proxyprocess/manager_test.go +++ b/agent/proxyprocess/manager_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/consul/agent/local" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/agent/remote_exec_test.go b/agent/remote_exec_test.go index 3be394af79..0b3dfbb348 100644 --- a/agent/remote_exec_test.go +++ b/agent/remote_exec_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-uuid" ) diff --git a/agent/session_endpoint_test.go b/agent/session_endpoint_test.go index 33321d64f4..2b2c691830 100644 --- a/agent/session_endpoint_test.go +++ b/agent/session_endpoint_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/testrpc" "github.com/hashicorp/consul/types" "github.com/pascaldekloe/goe/verify" diff --git a/agent/testagent.go b/agent/testagent.go index a6a37450f3..bc74aad3ee 100644 --- a/agent/testagent.go +++ b/agent/testagent.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/consul/agent/consul" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/logger" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/agent/ui_endpoint_test.go b/agent/ui_endpoint_test.go index b4fca77818..976e5c417a 100644 --- a/agent/ui_endpoint_test.go +++ b/agent/ui_endpoint_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" cleanhttp "github.com/hashicorp/go-cleanhttp" ) diff --git a/agent/user_event_test.go b/agent/user_event_test.go index 4cbf9f9e47..2e3a445eb3 100644 --- a/agent/user_event_test.go +++ b/agent/user_event_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestValidateUserEventParams(t *testing.T) { diff --git a/agent/util_test.go b/agent/util_test.go index 7951442319..ae57fdea16 100644 --- a/agent/util_test.go +++ b/agent/util_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/pascaldekloe/goe/verify" ) diff --git a/api/acl_test.go b/api/acl_test.go index fff7a4c891..17b193214d 100644 --- a/api/acl_test.go +++ b/api/acl_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/api/agent_test.go b/api/agent_test.go index 2d7606c1ea..4bb48d8595 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/serf" "github.com/stretchr/testify/require" ) diff --git a/api/api_test.go b/api/api_test.go index 47cc260e53..ac0b845dac 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/api/catalog_test.go b/api/catalog_test.go index 2b4f1ed72a..0a24d89435 100644 --- a/api/catalog_test.go +++ b/api/catalog_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/require" ) diff --git a/api/connect_ca_test.go b/api/connect_ca_test.go index 0b7f005def..b852a375d3 100644 --- a/api/connect_ca_test.go +++ b/api/connect_ca_test.go @@ -6,8 +6,8 @@ import ( "github.com/pascaldekloe/goe/verify" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/api/coordinate_test.go b/api/coordinate_test.go index ef851b5cb6..b9328c82af 100644 --- a/api/coordinate_test.go +++ b/api/coordinate_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" "github.com/pascaldekloe/goe/verify" ) diff --git a/api/debug_test.go b/api/debug_test.go index d0dd8e999b..86a10e71bb 100644 --- a/api/debug_test.go +++ b/api/debug_test.go @@ -3,7 +3,7 @@ package api import ( "testing" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" ) func TestAPI_DebugHeap(t *testing.T) { diff --git a/api/event_test.go b/api/event_test.go index d426ff2ab2..84e40a04a7 100644 --- a/api/event_test.go +++ b/api/event_test.go @@ -3,7 +3,7 @@ package api import ( "testing" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestAPI_EventFireList(t *testing.T) { diff --git a/api/go.mod b/api/go.mod index 0c8a7503ec..e786ec14cf 100644 --- a/api/go.mod +++ b/api/go.mod @@ -2,10 +2,10 @@ module github.com/hashicorp/consul/api go 1.12 -replace github.com/hashicorp/consul/internal => ../internal +replace github.com/hashicorp/consul/sdk => ../sdk require ( - github.com/hashicorp/consul/internal v0.1.0 + github.com/hashicorp/consul/sdk v0.0.0-00010101000000-000000000000 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-rootcerts v1.0.0 github.com/hashicorp/go-uuid v1.0.1 diff --git a/api/health_test.go b/api/health_test.go index da38b9eec4..6ae089c2df 100644 --- a/api/health_test.go +++ b/api/health_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/require" ) diff --git a/api/lock_test.go b/api/lock_test.go index 2ec9e6314e..a0d9776725 100644 --- a/api/lock_test.go +++ b/api/lock_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func createTestLock(t *testing.T, c *Client, key string) (*Lock, *Session) { diff --git a/api/operator_autopilot_test.go b/api/operator_autopilot_test.go index dccdfd5750..531e3e9d91 100644 --- a/api/operator_autopilot_test.go +++ b/api/operator_autopilot_test.go @@ -3,8 +3,8 @@ package api import ( "testing" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestAPI_OperatorAutopilotGetSetConfiguration(t *testing.T) { diff --git a/api/operator_keyring_test.go b/api/operator_keyring_test.go index 3358d7c94f..85f0d19aa3 100644 --- a/api/operator_keyring_test.go +++ b/api/operator_keyring_test.go @@ -3,7 +3,7 @@ package api import ( "testing" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" ) func TestAPI_OperatorKeyringInstallListPutRemove(t *testing.T) { diff --git a/api/prepared_query_test.go b/api/prepared_query_test.go index f3c8c7dea6..7fe727c6c5 100644 --- a/api/prepared_query_test.go +++ b/api/prepared_query_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) func TestAPI_PreparedQuery(t *testing.T) { diff --git a/command/acl/agenttokens/agent_tokens_test.go b/command/acl/agenttokens/agent_tokens_test.go index 972599b9a9..62c8223217 100644 --- a/command/acl/agenttokens/agent_tokens_test.go +++ b/command/acl/agenttokens/agent_tokens_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/bootstrap/bootstrap_test.go b/command/acl/bootstrap/bootstrap_test.go index 0465c271bf..0023ba08f9 100644 --- a/command/acl/bootstrap/bootstrap_test.go +++ b/command/acl/bootstrap/bootstrap_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/policy/create/policy_create_test.go b/command/acl/policy/create/policy_create_test.go index 0815d0f43b..d898f6156e 100644 --- a/command/acl/policy/create/policy_create_test.go +++ b/command/acl/policy/create/policy_create_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/policy/delete/policy_delete_test.go b/command/acl/policy/delete/policy_delete_test.go index b78c120abc..5066f9015e 100644 --- a/command/acl/policy/delete/policy_delete_test.go +++ b/command/acl/policy/delete/policy_delete_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/policy/list/policy_list_test.go b/command/acl/policy/list/policy_list_test.go index 5c94a44b62..446f2b7094 100644 --- a/command/acl/policy/list/policy_list_test.go +++ b/command/acl/policy/list/policy_list_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/policy/read/policy_read_test.go b/command/acl/policy/read/policy_read_test.go index ae5568906f..45febad6f2 100644 --- a/command/acl/policy/read/policy_read_test.go +++ b/command/acl/policy/read/policy_read_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/policy/update/policy_update_test.go b/command/acl/policy/update/policy_update_test.go index 468882b27a..e329228657 100644 --- a/command/acl/policy/update/policy_update_test.go +++ b/command/acl/policy/update/policy_update_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/rules/translate_test.go b/command/acl/rules/translate_test.go index d37d696a1e..162a49b5f4 100644 --- a/command/acl/rules/translate_test.go +++ b/command/acl/rules/translate_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/token/clone/token_clone_test.go b/command/acl/token/clone/token_clone_test.go index 3c1dbb9a81..10b2cfe98b 100644 --- a/command/acl/token/clone/token_clone_test.go +++ b/command/acl/token/clone/token_clone_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) diff --git a/command/acl/token/create/token_create_test.go b/command/acl/token/create/token_create_test.go index 0b650e5445..001a058ed4 100644 --- a/command/acl/token/create/token_create_test.go +++ b/command/acl/token/create/token_create_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/token/delete/token_delete_test.go b/command/acl/token/delete/token_delete_test.go index 6dc1be8ef6..a6bf61f3c9 100644 --- a/command/acl/token/delete/token_delete_test.go +++ b/command/acl/token/delete/token_delete_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/token/list/token_list_test.go b/command/acl/token/list/token_list_test.go index 0bf0048be2..64693cae8b 100644 --- a/command/acl/token/list/token_list_test.go +++ b/command/acl/token/list/token_list_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/token/read/token_read_test.go b/command/acl/token/read/token_read_test.go index 59399c6750..9d4629c14d 100644 --- a/command/acl/token/read/token_read_test.go +++ b/command/acl/token/read/token_read_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/acl/token/update/token_update_test.go b/command/acl/token/update/token_update_test.go index 761e92d5d9..bd4ec07821 100644 --- a/command/acl/token/update/token_update_test.go +++ b/command/acl/token/update/token_update_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" ) diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 06e7174f6c..e7b936e04a 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/consul/testrpc" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/version" "github.com/mitchellh/cli" ) diff --git a/command/connect/proxy/register_test.go b/command/connect/proxy/register_test.go index b1b079a84b..d94b7ac9c8 100644 --- a/command/connect/proxy/register_test.go +++ b/command/connect/proxy/register_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/command/debug/debug_test.go b/command/debug/debug_test.go index 7f010dfc6f..fdf66be1a9 100644 --- a/command/debug/debug_test.go +++ b/command/debug/debug_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" ) diff --git a/command/exec/exec_test.go b/command/exec/exec_test.go index dc17787e0d..70777d8ae5 100644 --- a/command/exec/exec_test.go +++ b/command/exec/exec_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent" consulapi "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/mitchellh/cli" ) diff --git a/command/forceleave/forceleave_test.go b/command/forceleave/forceleave_test.go index fab8fb19de..89018a2b2f 100644 --- a/command/forceleave/forceleave_test.go +++ b/command/forceleave/forceleave_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/serf" "github.com/mitchellh/cli" ) diff --git a/command/intention/create/create_test.go b/command/intention/create/create_test.go index a51388b875..a456ddacbf 100644 --- a/command/intention/create/create_test.go +++ b/command/intention/create/create_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) diff --git a/command/kv/put/kv_put_test.go b/command/kv/put/kv_put_test.go index a8e210bd97..86d4cb2257 100644 --- a/command/kv/put/kv_put_test.go +++ b/command/kv/put/kv_put_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" ) diff --git a/command/rtt/rtt_test.go b/command/rtt/rtt_test.go index 434e45a1d9..36bb2bf927 100644 --- a/command/rtt/rtt_test.go +++ b/command/rtt/rtt_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" "github.com/mitchellh/cli" ) diff --git a/command/services/deregister/deregister_test.go b/command/services/deregister/deregister_test.go index 1c75800cf9..474367b53e 100644 --- a/command/services/deregister/deregister_test.go +++ b/command/services/deregister/deregister_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) diff --git a/command/services/register/register_test.go b/command/services/register/register_test.go index f8d0fba5ec..4b1eb5b831 100644 --- a/command/services/register/register_test.go +++ b/command/services/register/register_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) diff --git a/command/snapshot/inspect/snapshot_inspect_test.go b/command/snapshot/inspect/snapshot_inspect_test.go index e57d146c26..3fb5ad8eaf 100644 --- a/command/snapshot/inspect/snapshot_inspect_test.go +++ b/command/snapshot/inspect/snapshot_inspect_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" ) diff --git a/command/snapshot/restore/snapshot_restore_test.go b/command/snapshot/restore/snapshot_restore_test.go index 4ade024341..9d79647348 100644 --- a/command/snapshot/restore/snapshot_restore_test.go +++ b/command/snapshot/restore/snapshot_restore_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" ) diff --git a/command/snapshot/save/snapshot_save_test.go b/command/snapshot/save/snapshot_save_test.go index 924696e881..79fc386210 100644 --- a/command/snapshot/save/snapshot_save_test.go +++ b/command/snapshot/save/snapshot_save_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/hashicorp/consul/agent" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" ) diff --git a/command/tls/ca/create/tls_ca_create_test.go b/command/tls/ca/create/tls_ca_create_test.go index 0119652c90..6f6066d1ca 100644 --- a/command/tls/ca/create/tls_ca_create_test.go +++ b/command/tls/ca/create/tls_ca_create_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/consul/agent/connect" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) diff --git a/command/tls/cert/create/tls_cert_create_test.go b/command/tls/cert/create/tls_cert_create_test.go index 0cfec24a47..180c164493 100644 --- a/command/tls/cert/create/tls_cert_create_test.go +++ b/command/tls/cert/create/tls_cert_create_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/hashicorp/consul/agent/connect" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" diff --git a/command/validate/validate_test.go b/command/validate/validate_test.go index 62ac4e1e19..cb37cdb370 100644 --- a/command/validate/validate_test.go +++ b/command/validate/validate_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/mitchellh/cli" require "github.com/stretchr/testify/require" ) diff --git a/connect/proxy/listener_test.go b/connect/proxy/listener_test.go index d947f06f87..f893a0575a 100644 --- a/connect/proxy/listener_test.go +++ b/connect/proxy/listener_test.go @@ -16,7 +16,7 @@ import ( agConnect "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/connect" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" ) func testSetupMetrics(t *testing.T) *metrics.InmemSink { diff --git a/connect/proxy/proxy_test.go b/connect/proxy/proxy_test.go index 60c6e1bca3..339f935d54 100644 --- a/connect/proxy/proxy_test.go +++ b/connect/proxy/proxy_test.go @@ -13,8 +13,8 @@ import ( agConnect "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/connect" - "github.com/hashicorp/consul/internal/freeport" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/connect/proxy/testing.go b/connect/proxy/testing.go index 4ed53cfc9a..6dc6838edb 100644 --- a/connect/proxy/testing.go +++ b/connect/proxy/testing.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/consul/connect" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" "github.com/mitchellh/go-testing-interface" "github.com/stretchr/testify/require" ) diff --git a/connect/service_test.go b/connect/service_test.go index c898ae4ef1..392e74bd89 100644 --- a/connect/service_test.go +++ b/connect/service_test.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/testrpc" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" ) diff --git a/connect/testing.go b/connect/testing.go index 8b92b14781..78fc6d2c8b 100644 --- a/connect/testing.go +++ b/connect/testing.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/freeport" + "github.com/hashicorp/consul/sdk/freeport" testing "github.com/mitchellh/go-testing-interface" ) diff --git a/go.mod b/go.mod index ec9bc95927..dd97390456 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.12 replace github.com/hashicorp/consul/api => ./api -replace github.com/hashicorp/consul/internal => ./internal +replace github.com/hashicorp/consul/sdk => ./sdk require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect @@ -52,7 +52,7 @@ require ( github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect github.com/hashicorp/consul/api v1.0.0 - github.com/hashicorp/consul/internal v0.1.0 + github.com/hashicorp/consul/sdk v0.0.0-00010101000000-000000000000 github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-discover v0.0.0-20190319153616-61771d82ff54 diff --git a/go.sum b/go.sum index e29d048523..874619d1a6 100644 --- a/go.sum +++ b/go.sum @@ -136,6 +136,7 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWet github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/hashicorp/consul/internal v0.1.0/go.mod h1:zi9bMZYbiPHyAjgBWo7kCUcy5l2NrTdrkVupCc7Oo6c= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= diff --git a/logger/logfile_test.go b/logger/logfile_test.go index 2e5af91f66..328ec70a70 100644 --- a/logger/logfile_test.go +++ b/logger/logfile_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" ) const ( diff --git a/sdk/README.md b/sdk/README.md new file mode 100644 index 0000000000..e5c61bab07 --- /dev/null +++ b/sdk/README.md @@ -0,0 +1,7 @@ +## Internal SDK + +Please note that this folder, while public, is not meant for new consumers of +these libraries; this should currently be considered an internal, not external, +SDK. It is public due to existing needs from other HashiCorp software. The tags +in this folder will stay at the 0.x.y level; accordingly users should expect +that things can move around, disappear, or change API at any time. diff --git a/internal/freeport/freeport.go b/sdk/freeport/freeport.go similarity index 100% rename from internal/freeport/freeport.go rename to sdk/freeport/freeport.go diff --git a/internal/go.mod b/sdk/go.mod similarity index 80% rename from internal/go.mod rename to sdk/go.mod index 784fb06d15..88df49214a 100644 --- a/internal/go.mod +++ b/sdk/go.mod @@ -1,4 +1,4 @@ -module github.com/hashicorp/consul/internal +module github.com/hashicorp/consul/sdk go 1.12 diff --git a/internal/go.sum b/sdk/go.sum similarity index 100% rename from internal/go.sum rename to sdk/go.sum diff --git a/internal/testutil/README.md b/sdk/testutil/README.md similarity index 97% rename from internal/testutil/README.md rename to sdk/testutil/README.md index 303ae24a9c..2462d55dfb 100644 --- a/internal/testutil/README.md +++ b/sdk/testutil/README.md @@ -22,7 +22,7 @@ import ( "testing" "github.com/hashicorp/consul/consul/structs" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" ) func TestFoo_bar(t *testing.T) { diff --git a/internal/testutil/io.go b/sdk/testutil/io.go similarity index 100% rename from internal/testutil/io.go rename to sdk/testutil/io.go diff --git a/internal/testutil/retry/retry.go b/sdk/testutil/retry/retry.go similarity index 100% rename from internal/testutil/retry/retry.go rename to sdk/testutil/retry/retry.go diff --git a/internal/testutil/retry/retry_test.go b/sdk/testutil/retry/retry_test.go similarity index 100% rename from internal/testutil/retry/retry_test.go rename to sdk/testutil/retry/retry_test.go diff --git a/internal/testutil/server.go b/sdk/testutil/server.go similarity index 99% rename from internal/testutil/server.go rename to sdk/testutil/server.go index ef8bef429f..4005eea49e 100644 --- a/internal/testutil/server.go +++ b/sdk/testutil/server.go @@ -28,8 +28,8 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/freeport" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-uuid" "github.com/pkg/errors" diff --git a/internal/testutil/server_methods.go b/sdk/testutil/server_methods.go similarity index 100% rename from internal/testutil/server_methods.go rename to sdk/testutil/server_methods.go diff --git a/internal/testutil/server_wrapper.go b/sdk/testutil/server_wrapper.go similarity index 100% rename from internal/testutil/server_wrapper.go rename to sdk/testutil/server_wrapper.go diff --git a/internal/testutil/testlog.go b/sdk/testutil/testlog.go similarity index 100% rename from internal/testutil/testlog.go rename to sdk/testutil/testlog.go diff --git a/snapshot/snapshot_test.go b/snapshot/snapshot_test.go index 1a9f795b84..ccb708511c 100644 --- a/snapshot/snapshot_test.go +++ b/snapshot/snapshot_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/testutil" + "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/go-msgpack/codec" "github.com/hashicorp/raft" ) diff --git a/testrpc/wait.go b/testrpc/wait.go index 375c6a9166..f8a31cb476 100644 --- a/testrpc/wait.go +++ b/testrpc/wait.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/testutil/retry" ) type rpcFn func(string, interface{}, interface{}) error diff --git a/vendor/github.com/hashicorp/consul/internal/testutil/server.go b/vendor/github.com/hashicorp/consul/internal/testutil/server.go index ef8bef429f..4005eea49e 100644 --- a/vendor/github.com/hashicorp/consul/internal/testutil/server.go +++ b/vendor/github.com/hashicorp/consul/internal/testutil/server.go @@ -28,8 +28,8 @@ import ( "testing" "time" - "github.com/hashicorp/consul/internal/freeport" - "github.com/hashicorp/consul/internal/testutil/retry" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-uuid" "github.com/pkg/errors"