From 6b40e09a4da457e9e45f9ad84ac29205b8e81fb5 Mon Sep 17 00:00:00 2001 From: Christian Schulze-Wiehenbrauk Date: Mon, 28 Oct 2019 15:49:36 +0100 Subject: [PATCH 1/4] Fix go module requirements for semantic versioning As stated in this blog post: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher modules that release a version higher than 1 need to put the version into the package path. --- cmd/csi-sanity/sanity_test.go | 2 +- cmd/mock-driver/main.go | 4 ++-- driver/mock.go | 2 +- go.mod | 2 +- mock/service/service.go | 2 +- pkg/sanity/sanity.go | 2 +- test/co_test.go | 4 ++-- test/driver_test.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/csi-sanity/sanity_test.go b/cmd/csi-sanity/sanity_test.go index 5f1b2b5a..014c91d3 100644 --- a/cmd/csi-sanity/sanity_test.go +++ b/cmd/csi-sanity/sanity_test.go @@ -21,7 +21,7 @@ import ( "os" "testing" - "github.com/kubernetes-csi/csi-test/pkg/sanity" + "github.com/kubernetes-csi/csi-test/v2/pkg/sanity" ) const ( diff --git a/cmd/mock-driver/main.go b/cmd/mock-driver/main.go index e530cb12..5aed2862 100644 --- a/cmd/mock-driver/main.go +++ b/cmd/mock-driver/main.go @@ -24,8 +24,8 @@ import ( "strings" "syscall" - "github.com/kubernetes-csi/csi-test/driver" - "github.com/kubernetes-csi/csi-test/mock/service" + "github.com/kubernetes-csi/csi-test/v2/driver" + "github.com/kubernetes-csi/csi-test/v2/mock/service" ) func main() { diff --git a/driver/mock.go b/driver/mock.go index 0eed51d1..914f80c2 100644 --- a/driver/mock.go +++ b/driver/mock.go @@ -19,7 +19,7 @@ package driver import ( "net" - "github.com/kubernetes-csi/csi-test/utils" + "github.com/kubernetes-csi/csi-test/v2/utils" "google.golang.org/grpc" ) diff --git a/go.mod b/go.mod index c84b190a..0b73db35 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/kubernetes-csi/csi-test +module github.com/kubernetes-csi/csi-test/v2 go 1.12 diff --git a/mock/service/service.go b/mock/service/service.go index d94f1f6c..61be938a 100644 --- a/mock/service/service.go +++ b/mock/service/service.go @@ -7,7 +7,7 @@ import ( "sync/atomic" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/csi-test/mock/cache" + "github.com/kubernetes-csi/csi-test/v2/mock/cache" "golang.org/x/net/context" "github.com/golang/protobuf/ptypes" diff --git a/pkg/sanity/sanity.go b/pkg/sanity/sanity.go index 49daa7f7..41edea35 100644 --- a/pkg/sanity/sanity.go +++ b/pkg/sanity/sanity.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/kubernetes-csi/csi-test/utils" + "github.com/kubernetes-csi/csi-test/v2/utils" yaml "gopkg.in/yaml.v2" "google.golang.org/grpc" diff --git a/test/co_test.go b/test/co_test.go index 03b0f052..512c199d 100644 --- a/test/co_test.go +++ b/test/co_test.go @@ -24,8 +24,8 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/mock/gomock" "github.com/golang/protobuf/proto" - mock_driver "github.com/kubernetes-csi/csi-test/driver" - mock_utils "github.com/kubernetes-csi/csi-test/utils" + mock_driver "github.com/kubernetes-csi/csi-test/v2/driver" + mock_utils "github.com/kubernetes-csi/csi-test/v2/utils" ) func TestPluginInfoResponse(t *testing.T) { diff --git a/test/driver_test.go b/test/driver_test.go index ae8c3367..bdcf38bb 100644 --- a/test/driver_test.go +++ b/test/driver_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/csi-test/utils" + "github.com/kubernetes-csi/csi-test/v2/utils" "google.golang.org/grpc" "google.golang.org/grpc/reflection" ) From 91151b01cac24b485b5bb3e5059c7c3569784fcb Mon Sep 17 00:00:00 2001 From: Christian Schulze-Wiehenbrauk Date: Mon, 28 Oct 2019 16:51:50 +0100 Subject: [PATCH 2/4] Version bump to v3 --- cmd/csi-sanity/sanity_test.go | 2 +- cmd/mock-driver/main.go | 4 ++-- driver/mock.go | 2 +- go.mod | 2 +- mock/service/service.go | 2 +- pkg/sanity/sanity.go | 2 +- test/co_test.go | 4 ++-- test/driver_test.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/csi-sanity/sanity_test.go b/cmd/csi-sanity/sanity_test.go index 014c91d3..bf4c3f63 100644 --- a/cmd/csi-sanity/sanity_test.go +++ b/cmd/csi-sanity/sanity_test.go @@ -21,7 +21,7 @@ import ( "os" "testing" - "github.com/kubernetes-csi/csi-test/v2/pkg/sanity" + "github.com/kubernetes-csi/csi-test/v3/pkg/sanity" ) const ( diff --git a/cmd/mock-driver/main.go b/cmd/mock-driver/main.go index 5aed2862..0b8a477e 100644 --- a/cmd/mock-driver/main.go +++ b/cmd/mock-driver/main.go @@ -24,8 +24,8 @@ import ( "strings" "syscall" - "github.com/kubernetes-csi/csi-test/v2/driver" - "github.com/kubernetes-csi/csi-test/v2/mock/service" + "github.com/kubernetes-csi/csi-test/v3/driver" + "github.com/kubernetes-csi/csi-test/v3/mock/service" ) func main() { diff --git a/driver/mock.go b/driver/mock.go index 914f80c2..399d0170 100644 --- a/driver/mock.go +++ b/driver/mock.go @@ -19,7 +19,7 @@ package driver import ( "net" - "github.com/kubernetes-csi/csi-test/v2/utils" + "github.com/kubernetes-csi/csi-test/v3/utils" "google.golang.org/grpc" ) diff --git a/go.mod b/go.mod index 0b73db35..0a68cf51 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/kubernetes-csi/csi-test/v2 +module github.com/kubernetes-csi/csi-test/v3 go 1.12 diff --git a/mock/service/service.go b/mock/service/service.go index 61be938a..3ef85a87 100644 --- a/mock/service/service.go +++ b/mock/service/service.go @@ -7,7 +7,7 @@ import ( "sync/atomic" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/csi-test/v2/mock/cache" + "github.com/kubernetes-csi/csi-test/v3/mock/cache" "golang.org/x/net/context" "github.com/golang/protobuf/ptypes" diff --git a/pkg/sanity/sanity.go b/pkg/sanity/sanity.go index 41edea35..27c983ff 100644 --- a/pkg/sanity/sanity.go +++ b/pkg/sanity/sanity.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/kubernetes-csi/csi-test/v2/utils" + "github.com/kubernetes-csi/csi-test/v3/utils" yaml "gopkg.in/yaml.v2" "google.golang.org/grpc" diff --git a/test/co_test.go b/test/co_test.go index 512c199d..5c12b364 100644 --- a/test/co_test.go +++ b/test/co_test.go @@ -24,8 +24,8 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/mock/gomock" "github.com/golang/protobuf/proto" - mock_driver "github.com/kubernetes-csi/csi-test/v2/driver" - mock_utils "github.com/kubernetes-csi/csi-test/v2/utils" + mock_driver "github.com/kubernetes-csi/csi-test/v3/driver" + mock_utils "github.com/kubernetes-csi/csi-test/v3/utils" ) func TestPluginInfoResponse(t *testing.T) { diff --git a/test/driver_test.go b/test/driver_test.go index bdcf38bb..fe82aa6a 100644 --- a/test/driver_test.go +++ b/test/driver_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/csi-test/v2/utils" + "github.com/kubernetes-csi/csi-test/v3/utils" "google.golang.org/grpc" "google.golang.org/grpc/reflection" ) From 0163355aebd264bb9de79618854c7d703f9b117e Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 29 Oct 2019 09:55:28 +0100 Subject: [PATCH 3/4] v3: ensure that dep can import v3.0.0 These symlinks ensure that "dep" can still import v3.0.0. Without them, importing fails when it encounters the github.com/kubernetes-csi/csi-test/v3 because there's no code under that path without the symlinks. Symlinks work for files, but not for directories (probably due to a check in dep which expects directories for packages). Upstream suggests to move the code itself ("Major subdirectory", https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher). But that messes with git history. Symlinks are simpler, but have the disadvantage of only working on Unix. Users on Windows will have to use "go mod" for importing. --- v3/driver/driver-controller.go | 1 + v3/driver/driver-node.go | 1 + v3/driver/driver.go | 1 + v3/driver/driver.mock.go | 1 + v3/driver/mock.go | 1 + v3/mock/cache/SnapshotCache.go | 1 + v3/mock/service/controller.go | 1 + v3/mock/service/identity.go | 1 + v3/mock/service/node.go | 1 + v3/mock/service/service.go | 1 + v3/pkg/sanity/cleanup.go | 1 + v3/pkg/sanity/controller.go | 1 + v3/pkg/sanity/identity.go | 1 + v3/pkg/sanity/node.go | 1 + v3/pkg/sanity/sanity.go | 1 + v3/pkg/sanity/tests.go | 1 + v3/pkg/sanity/util.go | 1 + v3/utils/grpcutil.go | 1 + v3/utils/safegoroutinetester.go | 1 + 19 files changed, 19 insertions(+) create mode 120000 v3/driver/driver-controller.go create mode 120000 v3/driver/driver-node.go create mode 120000 v3/driver/driver.go create mode 120000 v3/driver/driver.mock.go create mode 120000 v3/driver/mock.go create mode 120000 v3/mock/cache/SnapshotCache.go create mode 120000 v3/mock/service/controller.go create mode 120000 v3/mock/service/identity.go create mode 120000 v3/mock/service/node.go create mode 120000 v3/mock/service/service.go create mode 120000 v3/pkg/sanity/cleanup.go create mode 120000 v3/pkg/sanity/controller.go create mode 120000 v3/pkg/sanity/identity.go create mode 120000 v3/pkg/sanity/node.go create mode 120000 v3/pkg/sanity/sanity.go create mode 120000 v3/pkg/sanity/tests.go create mode 120000 v3/pkg/sanity/util.go create mode 120000 v3/utils/grpcutil.go create mode 120000 v3/utils/safegoroutinetester.go diff --git a/v3/driver/driver-controller.go b/v3/driver/driver-controller.go new file mode 120000 index 00000000..9d51eebc --- /dev/null +++ b/v3/driver/driver-controller.go @@ -0,0 +1 @@ +../../driver/driver-controller.go \ No newline at end of file diff --git a/v3/driver/driver-node.go b/v3/driver/driver-node.go new file mode 120000 index 00000000..fed18807 --- /dev/null +++ b/v3/driver/driver-node.go @@ -0,0 +1 @@ +../../driver/driver-node.go \ No newline at end of file diff --git a/v3/driver/driver.go b/v3/driver/driver.go new file mode 120000 index 00000000..6a987fdf --- /dev/null +++ b/v3/driver/driver.go @@ -0,0 +1 @@ +../../driver/driver.go \ No newline at end of file diff --git a/v3/driver/driver.mock.go b/v3/driver/driver.mock.go new file mode 120000 index 00000000..15e6e3ed --- /dev/null +++ b/v3/driver/driver.mock.go @@ -0,0 +1 @@ +../../driver/driver.mock.go \ No newline at end of file diff --git a/v3/driver/mock.go b/v3/driver/mock.go new file mode 120000 index 00000000..3aaf6c43 --- /dev/null +++ b/v3/driver/mock.go @@ -0,0 +1 @@ +../../driver/mock.go \ No newline at end of file diff --git a/v3/mock/cache/SnapshotCache.go b/v3/mock/cache/SnapshotCache.go new file mode 120000 index 00000000..f4e14d24 --- /dev/null +++ b/v3/mock/cache/SnapshotCache.go @@ -0,0 +1 @@ +../../../mock/cache/SnapshotCache.go \ No newline at end of file diff --git a/v3/mock/service/controller.go b/v3/mock/service/controller.go new file mode 120000 index 00000000..b2043f88 --- /dev/null +++ b/v3/mock/service/controller.go @@ -0,0 +1 @@ +../../../mock/service/controller.go \ No newline at end of file diff --git a/v3/mock/service/identity.go b/v3/mock/service/identity.go new file mode 120000 index 00000000..b77a5303 --- /dev/null +++ b/v3/mock/service/identity.go @@ -0,0 +1 @@ +../../../mock/service/identity.go \ No newline at end of file diff --git a/v3/mock/service/node.go b/v3/mock/service/node.go new file mode 120000 index 00000000..5eaad7e1 --- /dev/null +++ b/v3/mock/service/node.go @@ -0,0 +1 @@ +../../../mock/service/node.go \ No newline at end of file diff --git a/v3/mock/service/service.go b/v3/mock/service/service.go new file mode 120000 index 00000000..3dff3486 --- /dev/null +++ b/v3/mock/service/service.go @@ -0,0 +1 @@ +../../../mock/service/service.go \ No newline at end of file diff --git a/v3/pkg/sanity/cleanup.go b/v3/pkg/sanity/cleanup.go new file mode 120000 index 00000000..6e6c0375 --- /dev/null +++ b/v3/pkg/sanity/cleanup.go @@ -0,0 +1 @@ +../../../pkg/sanity/cleanup.go \ No newline at end of file diff --git a/v3/pkg/sanity/controller.go b/v3/pkg/sanity/controller.go new file mode 120000 index 00000000..01753eb9 --- /dev/null +++ b/v3/pkg/sanity/controller.go @@ -0,0 +1 @@ +../../../pkg/sanity/controller.go \ No newline at end of file diff --git a/v3/pkg/sanity/identity.go b/v3/pkg/sanity/identity.go new file mode 120000 index 00000000..2c696c51 --- /dev/null +++ b/v3/pkg/sanity/identity.go @@ -0,0 +1 @@ +../../../pkg/sanity/identity.go \ No newline at end of file diff --git a/v3/pkg/sanity/node.go b/v3/pkg/sanity/node.go new file mode 120000 index 00000000..b3cbff94 --- /dev/null +++ b/v3/pkg/sanity/node.go @@ -0,0 +1 @@ +../../../pkg/sanity/node.go \ No newline at end of file diff --git a/v3/pkg/sanity/sanity.go b/v3/pkg/sanity/sanity.go new file mode 120000 index 00000000..9656c4bb --- /dev/null +++ b/v3/pkg/sanity/sanity.go @@ -0,0 +1 @@ +../../../pkg/sanity/sanity.go \ No newline at end of file diff --git a/v3/pkg/sanity/tests.go b/v3/pkg/sanity/tests.go new file mode 120000 index 00000000..c2ff5c22 --- /dev/null +++ b/v3/pkg/sanity/tests.go @@ -0,0 +1 @@ +../../../pkg/sanity/tests.go \ No newline at end of file diff --git a/v3/pkg/sanity/util.go b/v3/pkg/sanity/util.go new file mode 120000 index 00000000..723383c0 --- /dev/null +++ b/v3/pkg/sanity/util.go @@ -0,0 +1 @@ +../../../pkg/sanity/util.go \ No newline at end of file diff --git a/v3/utils/grpcutil.go b/v3/utils/grpcutil.go new file mode 120000 index 00000000..41483ec2 --- /dev/null +++ b/v3/utils/grpcutil.go @@ -0,0 +1 @@ +../../utils/grpcutil.go \ No newline at end of file diff --git a/v3/utils/safegoroutinetester.go b/v3/utils/safegoroutinetester.go new file mode 120000 index 00000000..241ea3f9 --- /dev/null +++ b/v3/utils/safegoroutinetester.go @@ -0,0 +1 @@ +../../utils/safegoroutinetester.go \ No newline at end of file From 4c648a165681c9dd107a3173ea4e7dea17e2cad0 Mon Sep 17 00:00:00 2001 From: Christian Schulze-Wiehenbrauk Date: Thu, 31 Oct 2019 14:44:43 +0100 Subject: [PATCH 4/4] Add readme for v3 dir --- v3/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 v3/README.md diff --git a/v3/README.md b/v3/README.md new file mode 100644 index 00000000..921556f0 --- /dev/null +++ b/v3/README.md @@ -0,0 +1,18 @@ +This directory mirrors the source code via symlinks. +This makes it possible to vendor v3.x releases of +csi-test with `dep` versions that do not support +semantic imports. Support for that is currently +[pending in dep](https://github.com/golang/dep/pull/1963). + +If users of dep have enabled pruning, they must disable if +for csi-test in their Gopk.toml, like this: + +```toml +[prune] + go-tests = true + unused-packages = true + + [[prune.project]] + name = "github.com/kubernetes-csi/csi-test" + unused-packages = false +```