From 22020655be584cac3e5d8b1cf6c20d926eb592dd Mon Sep 17 00:00:00 2001 From: Alex Szakaly Date: Sat, 25 Jan 2020 14:07:06 +0100 Subject: [PATCH 1/3] fix: update Go 1.13 Previous commit (5e773d2d) updates CI but go.mod should follow it Signed-off-by: Alex Szakaly --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fb949a672d..0df06e0cef 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubernetes-csi/external-attacher -go 1.12 +go 1.13 require ( github.com/container-storage-interface/spec v1.2.0 From 8e9aba01a2f5515b69d2a9e1c921863c246721e8 Mon Sep 17 00:00:00 2001 From: Alex Szakaly Date: Sat, 25 Jan 2020 14:07:11 +0100 Subject: [PATCH 2/3] fix: go module requirements for semantic versioning Fixes issue #208. Signed-off-by: Alex Szakaly --- cmd/csi-attacher/main.go | 4 ++-- go.mod | 2 +- pkg/controller/csi_handler.go | 2 +- pkg/controller/csi_handler_test.go | 2 +- pkg/controller/framework_test.go | 2 +- pkg/controller/trivial_handler_test.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/csi-attacher/main.go b/cmd/csi-attacher/main.go index ce5b1a4d79..1a5c69c3e6 100644 --- a/cmd/csi-attacher/main.go +++ b/cmd/csi-attacher/main.go @@ -36,8 +36,8 @@ import ( "github.com/kubernetes-csi/csi-lib-utils/leaderelection" "github.com/kubernetes-csi/csi-lib-utils/metrics" "github.com/kubernetes-csi/csi-lib-utils/rpc" - "github.com/kubernetes-csi/external-attacher/pkg/attacher" - "github.com/kubernetes-csi/external-attacher/pkg/controller" + "github.com/kubernetes-csi/external-attacher/v2/pkg/attacher" + "github.com/kubernetes-csi/external-attacher/v2/pkg/controller" "google.golang.org/grpc" ) diff --git a/go.mod b/go.mod index 0df06e0cef..5e1d74366c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/kubernetes-csi/external-attacher +module github.com/kubernetes-csi/external-attacher/v2 go 1.13 diff --git a/pkg/controller/csi_handler.go b/pkg/controller/csi_handler.go index 6e93a19529..2fc88d5d84 100644 --- a/pkg/controller/csi_handler.go +++ b/pkg/controller/csi_handler.go @@ -25,7 +25,7 @@ import ( "k8s.io/klog" - "github.com/kubernetes-csi/external-attacher/pkg/attacher" + "github.com/kubernetes-csi/external-attacher/v2/pkg/attacher" v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/controller/csi_handler_test.go b/pkg/controller/csi_handler_test.go index 00461f2c93..8f2d06ee70 100644 --- a/pkg/controller/csi_handler_test.go +++ b/pkg/controller/csi_handler_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/kubernetes-csi/external-attacher/pkg/attacher" + "github.com/kubernetes-csi/external-attacher/v2/pkg/attacher" v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1beta1" diff --git a/pkg/controller/framework_test.go b/pkg/controller/framework_test.go index cc167327c9..3fe6aaf650 100644 --- a/pkg/controller/framework_test.go +++ b/pkg/controller/framework_test.go @@ -27,7 +27,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/davecgh/go-spew/spew" - "github.com/kubernetes-csi/external-attacher/pkg/attacher" + "github.com/kubernetes-csi/external-attacher/v2/pkg/attacher" v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1beta1" diff --git a/pkg/controller/trivial_handler_test.go b/pkg/controller/trivial_handler_test.go index f21f2e05eb..dfdcfeecd3 100644 --- a/pkg/controller/trivial_handler_test.go +++ b/pkg/controller/trivial_handler_test.go @@ -20,7 +20,7 @@ import ( "errors" "testing" - "github.com/kubernetes-csi/external-attacher/pkg/attacher" + "github.com/kubernetes-csi/external-attacher/v2/pkg/attacher" storage "k8s.io/api/storage/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" From 7e9187cd448748ea87203aa06808b51878c469c0 Mon Sep 17 00:00:00 2001 From: Alex Szakaly Date: Mon, 27 Jan 2020 22:16:52 +0100 Subject: [PATCH 3/3] feat: add compatibility with dep This commit adds the compatibility with dep (Go dependency management tool) via symlink creation (same method applied in kubernetes-csi/csi-test) Signed-off-by: Alex Szakaly --- v2/README.md | 18 ++++++++++++++++++ v2/cmd/csi-attacher/main.go | 1 + v2/pkg/attacher/attacher.go | 1 + v2/pkg/attacher/attacher_test.go | 1 + v2/pkg/attacher/lister.go | 1 + v2/pkg/controller/controller.go | 1 + v2/pkg/controller/controller_test.go | 1 + v2/pkg/controller/csi_handler.go | 1 + v2/pkg/controller/csi_handler_test.go | 1 + v2/pkg/controller/framework_test.go | 1 + v2/pkg/controller/trivial_handler.go | 1 + v2/pkg/controller/trivial_handler_test.go | 1 + v2/pkg/controller/util.go | 1 + v2/pkg/controller/util_test.go | 1 + 14 files changed, 31 insertions(+) create mode 100644 v2/README.md create mode 120000 v2/cmd/csi-attacher/main.go create mode 120000 v2/pkg/attacher/attacher.go create mode 120000 v2/pkg/attacher/attacher_test.go create mode 120000 v2/pkg/attacher/lister.go create mode 120000 v2/pkg/controller/controller.go create mode 120000 v2/pkg/controller/controller_test.go create mode 120000 v2/pkg/controller/csi_handler.go create mode 120000 v2/pkg/controller/csi_handler_test.go create mode 120000 v2/pkg/controller/framework_test.go create mode 120000 v2/pkg/controller/trivial_handler.go create mode 120000 v2/pkg/controller/trivial_handler_test.go create mode 120000 v2/pkg/controller/util.go create mode 120000 v2/pkg/controller/util_test.go diff --git a/v2/README.md b/v2/README.md new file mode 100644 index 0000000000..ebfe2544bf --- /dev/null +++ b/v2/README.md @@ -0,0 +1,18 @@ +This directory mirrors the source code via symlinks. +This makes it possible to vendor v2.x releases of +external-attacher 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 external-attacher in their Gopk.toml, like this: + +```toml +[prune] + go-tests = true + unused-packages = true + + [[prune.project]] + name = "github.com/kubernetes-csi/external-attacher" + unused-packages = false +``` diff --git a/v2/cmd/csi-attacher/main.go b/v2/cmd/csi-attacher/main.go new file mode 120000 index 0000000000..8b0581700e --- /dev/null +++ b/v2/cmd/csi-attacher/main.go @@ -0,0 +1 @@ +../../../cmd/csi-attacher/main.go \ No newline at end of file diff --git a/v2/pkg/attacher/attacher.go b/v2/pkg/attacher/attacher.go new file mode 120000 index 0000000000..41bfec0b98 --- /dev/null +++ b/v2/pkg/attacher/attacher.go @@ -0,0 +1 @@ +../../../pkg/attacher/attacher.go \ No newline at end of file diff --git a/v2/pkg/attacher/attacher_test.go b/v2/pkg/attacher/attacher_test.go new file mode 120000 index 0000000000..f03251c04c --- /dev/null +++ b/v2/pkg/attacher/attacher_test.go @@ -0,0 +1 @@ +../../../pkg/attacher/attacher_test.go \ No newline at end of file diff --git a/v2/pkg/attacher/lister.go b/v2/pkg/attacher/lister.go new file mode 120000 index 0000000000..c7d85ed385 --- /dev/null +++ b/v2/pkg/attacher/lister.go @@ -0,0 +1 @@ +../../../pkg/attacher/lister.go \ No newline at end of file diff --git a/v2/pkg/controller/controller.go b/v2/pkg/controller/controller.go new file mode 120000 index 0000000000..29bb71b727 --- /dev/null +++ b/v2/pkg/controller/controller.go @@ -0,0 +1 @@ +../../../pkg/controller/controller.go \ No newline at end of file diff --git a/v2/pkg/controller/controller_test.go b/v2/pkg/controller/controller_test.go new file mode 120000 index 0000000000..26f818ca0d --- /dev/null +++ b/v2/pkg/controller/controller_test.go @@ -0,0 +1 @@ +../../../pkg/controller/controller_test.go \ No newline at end of file diff --git a/v2/pkg/controller/csi_handler.go b/v2/pkg/controller/csi_handler.go new file mode 120000 index 0000000000..b0847b473a --- /dev/null +++ b/v2/pkg/controller/csi_handler.go @@ -0,0 +1 @@ +../../../pkg/controller/csi_handler.go \ No newline at end of file diff --git a/v2/pkg/controller/csi_handler_test.go b/v2/pkg/controller/csi_handler_test.go new file mode 120000 index 0000000000..caca87dda7 --- /dev/null +++ b/v2/pkg/controller/csi_handler_test.go @@ -0,0 +1 @@ +../../../pkg/controller/csi_handler_test.go \ No newline at end of file diff --git a/v2/pkg/controller/framework_test.go b/v2/pkg/controller/framework_test.go new file mode 120000 index 0000000000..5494f31869 --- /dev/null +++ b/v2/pkg/controller/framework_test.go @@ -0,0 +1 @@ +../../../pkg/controller/framework_test.go \ No newline at end of file diff --git a/v2/pkg/controller/trivial_handler.go b/v2/pkg/controller/trivial_handler.go new file mode 120000 index 0000000000..ac11b861a3 --- /dev/null +++ b/v2/pkg/controller/trivial_handler.go @@ -0,0 +1 @@ +../../../pkg/controller/trivial_handler.go \ No newline at end of file diff --git a/v2/pkg/controller/trivial_handler_test.go b/v2/pkg/controller/trivial_handler_test.go new file mode 120000 index 0000000000..32960d0f16 --- /dev/null +++ b/v2/pkg/controller/trivial_handler_test.go @@ -0,0 +1 @@ +../../../pkg/controller/trivial_handler_test.go \ No newline at end of file diff --git a/v2/pkg/controller/util.go b/v2/pkg/controller/util.go new file mode 120000 index 0000000000..1d7316a35b --- /dev/null +++ b/v2/pkg/controller/util.go @@ -0,0 +1 @@ +../../../pkg/controller/util.go \ No newline at end of file diff --git a/v2/pkg/controller/util_test.go b/v2/pkg/controller/util_test.go new file mode 120000 index 0000000000..3003fba62b --- /dev/null +++ b/v2/pkg/controller/util_test.go @@ -0,0 +1 @@ +../../../pkg/controller/util_test.go \ No newline at end of file