Repository: kubernetes-csi/external-attacher (go)

Issue:
Incorrect repository layour for v2 Go Modules
From https://github.com/kubernetes-csi/external-snapshotter/issues/239:
```
$ go get -v github.com/kubernetes-csi/external-attacher@v2.1.0
go get github.com/kubernetes-csi/external-attacher@v2.1.0: github.com/kubernetes-csi/external-attacher@v2.1.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
```

See https://github.com/kubernetes-csi/external-snapshotter/pull/240 for a fix.

Pull request description:
fix: go module requirements for semantic versioning
**What type of PR is this?**
/kind bug

**What this PR does / why we need it**:
Fix go module requirements for semantic versioning

**Which issue(s) this PR fixes**:
Fixes #208.

**Special notes for your reviewer**:
Adding Go `dep` compatibility should be decided
**Does this PR introduce a user-facing change?**:
```release-note
Update package path to v2. Vendoring with dep depends on https://github.com/golang/dep/pull/1963 or the workaround described in v2/README.md.
```


Patch:
diff --git a/cmd/csi-attacher/main.go b/cmd/csi-attacher/main.go
index ce5b1a4d..1a5c69c3 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 fb949a67..5e1d7436 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
-module github.com/kubernetes-csi/external-attacher
+module github.com/kubernetes-csi/external-attacher/v2
 
-go 1.12
+go 1.13
 
 require (
 	github.com/container-storage-interface/spec v1.2.0
diff --git a/pkg/controller/csi_handler.go b/pkg/controller/csi_handler.go
index 6e93a195..2fc88d5d 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/v2/README.md b/v2/README.md
new file mode 100644
index 00000000..ebfe2544
--- /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 00000000..8b058170
--- /dev/null
+++ b/v2/cmd/csi-attacher/main.go
@@ -0,0 +1,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 00000000..41bfec0b
--- /dev/null
+++ b/v2/pkg/attacher/attacher.go
@@ -0,0 +1,1 @@
+../../../pkg/attacher/attacher.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 00000000..c7d85ed3
--- /dev/null
+++ b/v2/pkg/attacher/lister.go
@@ -0,0 +1,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 00000000..29bb71b7
--- /dev/null
+++ b/v2/pkg/controller/controller.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/controller.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 00000000..b0847b47
--- /dev/null
+++ b/v2/pkg/controller/csi_handler.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/csi_handler.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 00000000..ac11b861
--- /dev/null
+++ b/v2/pkg/controller/trivial_handler.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/trivial_handler.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 00000000..1d7316a3
--- /dev/null
+++ b/v2/pkg/controller/util.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/util.go
\ No newline at end of file


Test patch:
diff --git a/pkg/controller/csi_handler_test.go b/pkg/controller/csi_handler_test.go
index 00461f2c..8f2d06ee 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 cc167327..3fe6aaf6 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 f21f2e05..dfdcfeec 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"
diff --git a/v2/pkg/attacher/attacher_test.go b/v2/pkg/attacher/attacher_test.go
new file mode 120000
index 00000000..f03251c0
--- /dev/null
+++ b/v2/pkg/attacher/attacher_test.go
@@ -0,0 +1,1 @@
+../../../pkg/attacher/attacher_test.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 00000000..26f818ca
--- /dev/null
+++ b/v2/pkg/controller/controller_test.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/controller_test.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 00000000..caca87dd
--- /dev/null
+++ b/v2/pkg/controller/csi_handler_test.go
@@ -0,0 +1,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 00000000..5494f318
--- /dev/null
+++ b/v2/pkg/controller/framework_test.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/framework_test.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 00000000..32960d0f
--- /dev/null
+++ b/v2/pkg/controller/trivial_handler_test.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/trivial_handler_test.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 00000000..3003fba6
--- /dev/null
+++ b/v2/pkg/controller/util_test.go
@@ -0,0 +1,1 @@
+../../../pkg/controller/util_test.go
\ No newline at end of file