From 37546f74ab460a41d645e5d245e8d7a5a39d4384 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 29 Jan 2018 10:00:20 -0800 Subject: [PATCH] *: move "version" to "internal/version" Signed-off-by: Gyuho Lee --- CHANGELOG-3.4.md | 1 + client/client.go | 2 +- client/client_test.go | 2 +- e2e/ctl_v3_test.go | 2 +- e2e/etcd_release_upgrade_test.go | 2 +- e2e/metrics_test.go | 2 +- etcdctl/ctlv2/ctl.go | 3 ++- etcdctl/ctlv3/command/version_command.go | 3 ++- etcdctl/ctlv3/help.go | 3 ++- etcdmain/config.go | 2 +- etcdmain/etcd.go | 2 +- etcdserver/api/capability.go | 3 ++- etcdserver/api/etcdhttp/base.go | 3 ++- etcdserver/api/etcdhttp/version_test.go | 2 +- etcdserver/api/v3rpc/maintenance.go | 2 +- etcdserver/cluster_util.go | 3 ++- etcdserver/cluster_util_test.go | 3 ++- etcdserver/membership/cluster.go | 2 +- etcdserver/metrics.go | 3 ++- etcdserver/server.go | 2 +- {version => internal/version}/version.go | 0 rafthttp/http.go | 3 ++- rafthttp/http_test.go | 2 +- rafthttp/pipeline_test.go | 2 +- rafthttp/stream.go | 3 ++- rafthttp/stream_test.go | 6 +++--- rafthttp/util.go | 3 ++- rafthttp/util_test.go | 3 ++- tools/functional-tester/etcd-runner/command/help.go | 3 ++- 29 files changed, 43 insertions(+), 29 deletions(-) rename {version => internal/version}/version.go (100%) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index f940b9c43e3..4923a7bd320 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -31,6 +31,7 @@ - Move `"github.com/coreos/etcd/mvcc"` to [`"github.com/coreos/etcd/internal/mvcc"`](https://github.com/coreos/etcd/pull/9238). - Move `"github.com/coreos/etcd/snap"` to [`"github.com/coreos/etcd/internal/raftsnap"`](https://github.com/coreos/etcd/pull/9211). - Move `"github.com/coreos/etcd/store"` to [`"github.com/coreos/etcd/internal/store"`](https://github.com/coreos/etcd/pull/9238). + - Move `"github.com/coreos/etcd/version"` to [`"github.com/coreos/etcd/internal/version"`](https://github.com/coreos/etcd/pull/9244). ### Added(`etcd`) diff --git a/client/client.go b/client/client.go index e6874505666..ec732723049 100644 --- a/client/client.go +++ b/client/client.go @@ -29,7 +29,7 @@ import ( "sync" "time" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" ) var ( diff --git a/client/client_test.go b/client/client_test.go index 40328a1e9b8..5e547a8cd10 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -29,8 +29,8 @@ import ( "testing" "time" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/testutil" - "github.com/coreos/etcd/version" ) type actionAssertingHTTPClient struct { diff --git a/e2e/ctl_v3_test.go b/e2e/ctl_v3_test.go index 396e6c18417..22871ab7f86 100644 --- a/e2e/ctl_v3_test.go +++ b/e2e/ctl_v3_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/flags" "github.com/coreos/etcd/pkg/testutil" - "github.com/coreos/etcd/version" ) func TestCtlV3Version(t *testing.T) { testCtl(t, versionTest) } diff --git a/e2e/etcd_release_upgrade_test.go b/e2e/etcd_release_upgrade_test.go index 6b1d42323e7..434f2cbc490 100644 --- a/e2e/etcd_release_upgrade_test.go +++ b/e2e/etcd_release_upgrade_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/fileutil" "github.com/coreos/etcd/pkg/testutil" - "github.com/coreos/etcd/version" ) // TestReleaseUpgrade ensures that changes to master branch does not affect diff --git a/e2e/metrics_test.go b/e2e/metrics_test.go index 8c548c92077..1984b448dbb 100644 --- a/e2e/metrics_test.go +++ b/e2e/metrics_test.go @@ -18,7 +18,7 @@ import ( "fmt" "testing" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" ) func TestV3MetricsSecure(t *testing.T) { diff --git a/etcdctl/ctlv2/ctl.go b/etcdctl/ctlv2/ctl.go index e949b06f09c..7815748142d 100644 --- a/etcdctl/ctlv2/ctl.go +++ b/etcdctl/ctlv2/ctl.go @@ -21,7 +21,8 @@ import ( "time" "github.com/coreos/etcd/etcdctl/ctlv2/command" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" + "github.com/urfave/cli" ) diff --git a/etcdctl/ctlv3/command/version_command.go b/etcdctl/ctlv3/command/version_command.go index 9fa990f1f4c..e5f31843da6 100644 --- a/etcdctl/ctlv3/command/version_command.go +++ b/etcdctl/ctlv3/command/version_command.go @@ -17,7 +17,8 @@ package command import ( "fmt" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" + "github.com/spf13/cobra" ) diff --git a/etcdctl/ctlv3/help.go b/etcdctl/ctlv3/help.go index 1315a03cb25..3d25bfade42 100644 --- a/etcdctl/ctlv3/help.go +++ b/etcdctl/ctlv3/help.go @@ -25,7 +25,8 @@ import ( "text/tabwriter" "text/template" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/etcdmain/config.go b/etcdmain/config.go index 86fff2695a7..471c73480fb 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -26,9 +26,9 @@ import ( "strings" "github.com/coreos/etcd/embed" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/flags" "github.com/coreos/etcd/pkg/types" - "github.com/coreos/etcd/version" "github.com/ghodss/yaml" ) diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 49ef725782f..e5906f0be57 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -30,6 +30,7 @@ import ( "github.com/coreos/etcd/etcdserver" "github.com/coreos/etcd/etcdserver/api/etcdhttp" "github.com/coreos/etcd/internal/discovery" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/cors" "github.com/coreos/etcd/pkg/fileutil" pkgioutil "github.com/coreos/etcd/pkg/ioutil" @@ -37,7 +38,6 @@ import ( "github.com/coreos/etcd/pkg/transport" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/proxy/httpproxy" - "github.com/coreos/etcd/version" "github.com/coreos/pkg/capnslog" "google.golang.org/grpc" diff --git a/etcdserver/api/capability.go b/etcdserver/api/capability.go index eb34383d7f9..9b73a3d4298 100644 --- a/etcdserver/api/capability.go +++ b/etcdserver/api/capability.go @@ -17,7 +17,8 @@ package api import ( "sync" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" + "github.com/coreos/go-semver/semver" "github.com/coreos/pkg/capnslog" ) diff --git a/etcdserver/api/etcdhttp/base.go b/etcdserver/api/etcdhttp/base.go index f0d3b0bd3d2..e17029f41a8 100644 --- a/etcdserver/api/etcdhttp/base.go +++ b/etcdserver/api/etcdhttp/base.go @@ -25,8 +25,9 @@ import ( "github.com/coreos/etcd/etcdserver" "github.com/coreos/etcd/etcdserver/api" "github.com/coreos/etcd/etcdserver/api/v2http/httptypes" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/logutil" - "github.com/coreos/etcd/version" + "github.com/coreos/pkg/capnslog" ) diff --git a/etcdserver/api/etcdhttp/version_test.go b/etcdserver/api/etcdhttp/version_test.go index fea1659508c..057dc7abe18 100644 --- a/etcdserver/api/etcdhttp/version_test.go +++ b/etcdserver/api/etcdhttp/version_test.go @@ -20,7 +20,7 @@ import ( "net/http/httptest" "testing" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" ) func TestServeVersion(t *testing.T) { diff --git a/etcdserver/api/v3rpc/maintenance.go b/etcdserver/api/v3rpc/maintenance.go index 9b402aa0d62..aa5e90fdb54 100644 --- a/etcdserver/api/v3rpc/maintenance.go +++ b/etcdserver/api/v3rpc/maintenance.go @@ -25,9 +25,9 @@ import ( "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/mvcc" "github.com/coreos/etcd/internal/mvcc/backend" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft" - "github.com/coreos/etcd/version" ) type KVGetter interface { diff --git a/etcdserver/cluster_util.go b/etcdserver/cluster_util.go index f44862a4638..bcb9f426003 100644 --- a/etcdserver/cluster_util.go +++ b/etcdserver/cluster_util.go @@ -23,8 +23,9 @@ import ( "time" "github.com/coreos/etcd/etcdserver/membership" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/types" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" ) diff --git a/etcdserver/cluster_util_test.go b/etcdserver/cluster_util_test.go index 159d3f3a981..58c0396162f 100644 --- a/etcdserver/cluster_util_test.go +++ b/etcdserver/cluster_util_test.go @@ -18,8 +18,9 @@ import ( "reflect" "testing" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/types" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" ) diff --git a/etcdserver/membership/cluster.go b/etcdserver/membership/cluster.go index 84a8ffe796c..48e4d476437 100644 --- a/etcdserver/membership/cluster.go +++ b/etcdserver/membership/cluster.go @@ -29,11 +29,11 @@ import ( "github.com/coreos/etcd/internal/mvcc/backend" "github.com/coreos/etcd/internal/store" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/netutil" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" "github.com/coreos/go-semver/semver" ) diff --git a/etcdserver/metrics.go b/etcdserver/metrics.go index 6bf12f9de90..c86d27a81a4 100644 --- a/etcdserver/metrics.go +++ b/etcdserver/metrics.go @@ -17,8 +17,9 @@ package etcdserver import ( "time" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/runtime" - "github.com/coreos/etcd/version" + "github.com/prometheus/client_golang/prometheus" ) diff --git a/etcdserver/server.go b/etcdserver/server.go index d55b3ee7714..ca75d3a2550 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -44,6 +44,7 @@ import ( "github.com/coreos/etcd/internal/mvcc/backend" "github.com/coreos/etcd/internal/raftsnap" "github.com/coreos/etcd/internal/store" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/fileutil" "github.com/coreos/etcd/pkg/idutil" "github.com/coreos/etcd/pkg/pbutil" @@ -54,7 +55,6 @@ import ( "github.com/coreos/etcd/raft" "github.com/coreos/etcd/raft/raftpb" "github.com/coreos/etcd/rafthttp" - "github.com/coreos/etcd/version" "github.com/coreos/etcd/wal" "github.com/coreos/go-semver/semver" diff --git a/version/version.go b/internal/version/version.go similarity index 100% rename from version/version.go rename to internal/version/version.go diff --git a/rafthttp/http.go b/rafthttp/http.go index c3c095f7cb3..53bfbbdc250 100644 --- a/rafthttp/http.go +++ b/rafthttp/http.go @@ -24,10 +24,11 @@ import ( "strings" "github.com/coreos/etcd/internal/raftsnap" + "github.com/coreos/etcd/internal/version" pioutil "github.com/coreos/etcd/pkg/ioutil" "github.com/coreos/etcd/pkg/types" + "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" ) const ( diff --git a/rafthttp/http_test.go b/rafthttp/http_test.go index 44622c8143a..ebf1dcf3163 100644 --- a/rafthttp/http_test.go +++ b/rafthttp/http_test.go @@ -27,10 +27,10 @@ import ( "time" "github.com/coreos/etcd/internal/raftsnap" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/pbutil" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" ) func TestServeRaftPrefix(t *testing.T) { diff --git a/rafthttp/pipeline_test.go b/rafthttp/pipeline_test.go index bdcdbc87053..5881d82fa91 100644 --- a/rafthttp/pipeline_test.go +++ b/rafthttp/pipeline_test.go @@ -25,10 +25,10 @@ import ( "time" "github.com/coreos/etcd/etcdserver/stats" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/testutil" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" ) // TestPipelineSend tests that pipeline could send data using roundtripper diff --git a/rafthttp/stream.go b/rafthttp/stream.go index af49c18b1d9..0bccccc0679 100644 --- a/rafthttp/stream.go +++ b/rafthttp/stream.go @@ -28,11 +28,12 @@ import ( "golang.org/x/time/rate" "github.com/coreos/etcd/etcdserver/stats" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/httputil" "github.com/coreos/etcd/pkg/transport" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" ) diff --git a/rafthttp/stream_test.go b/rafthttp/stream_test.go index c9cd2b3d69c..e850ca52836 100644 --- a/rafthttp/stream_test.go +++ b/rafthttp/stream_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" - "golang.org/x/time/rate" - "github.com/coreos/etcd/etcdserver/stats" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/testutil" "github.com/coreos/etcd/pkg/types" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" + "golang.org/x/time/rate" ) // TestStreamWriterAttachOutgoingConn tests that outgoingConn can be attached diff --git a/rafthttp/util.go b/rafthttp/util.go index 6ec3641aa7a..6eeeef46467 100644 --- a/rafthttp/util.go +++ b/rafthttp/util.go @@ -23,9 +23,10 @@ import ( "strings" "time" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/pkg/transport" "github.com/coreos/etcd/pkg/types" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" ) diff --git a/rafthttp/util_test.go b/rafthttp/util_test.go index 6ff47969985..354e48fd3bf 100644 --- a/rafthttp/util_test.go +++ b/rafthttp/util_test.go @@ -22,8 +22,9 @@ import ( "reflect" "testing" + "github.com/coreos/etcd/internal/version" "github.com/coreos/etcd/raft/raftpb" - "github.com/coreos/etcd/version" + "github.com/coreos/go-semver/semver" ) diff --git a/tools/functional-tester/etcd-runner/command/help.go b/tools/functional-tester/etcd-runner/command/help.go index 448140a3bad..276fd334ac9 100644 --- a/tools/functional-tester/etcd-runner/command/help.go +++ b/tools/functional-tester/etcd-runner/command/help.go @@ -25,7 +25,8 @@ import ( "text/tabwriter" "text/template" - "github.com/coreos/etcd/version" + "github.com/coreos/etcd/internal/version" + "github.com/spf13/cobra" "github.com/spf13/pflag" )