From 3436e3cf83ed0c43f3a2f92f53a5f698718d640a Mon Sep 17 00:00:00 2001
From: David Ko <dko@suse.com>
Date: Tue, 27 Jul 2021 18:25:44 +0800
Subject: [PATCH] Update build dependencies

Signed-off-by: David Ko <dko@suse.com>
---
 .drone.yml                               |  7 ++++---
 .golangci.json                           |  6 +++---
 Dockerfile.dapper                        | 22 ++++++++--------------
 examples/pod-with-node-affinity/pod.yaml |  2 +-
 go.mod                                   |  2 +-
 go.sum                                   |  1 -
 scripts/e2e-test                         |  2 +-
 test/testdata/kind-cluster.yaml          |  1 +
 vendor/modules.txt                       | 19 +++++++++++++++++++
 9 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 9fd37bf1..3cc00040 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -8,7 +8,7 @@ platform:
 
 steps:
 - name: build
-  image: rancher/dapper:v0.4.1
+  image: rancher/dapper:v0.4.2
   commands:
   - dapper ci
   - dapper e2e-test
@@ -71,9 +71,10 @@ platform:
 
 steps:
 - name: build
-  image: rancher/dapper:v0.4.1
+  image: rancher/dapper:v0.4.2
   commands:
   - dapper ci
+#  - dapper e2e-test
   volumes:
   - name: docker
     path: /var/run/docker.sock
@@ -133,7 +134,7 @@ platform:
 
 steps:
 - name: build
-  image: rancher/dapper:v0.4.1
+  image: rancher/dapper:v0.4.2
   commands:
   - dapper ci
   volumes:
diff --git a/.golangci.json b/.golangci.json
index f317e317..076c923d 100644
--- a/.golangci.json
+++ b/.golangci.json
@@ -2,12 +2,12 @@
 	"linters": {
 		"disable-all": true,
 		"enable": [
+			"gofmt",
 			"govet",
-			"golint",
 			"goimports",
+			"revive",
 			"misspell",
-			"ineffassign",
-			"gofmt"
+			"ineffassign"
 		]
 	},
 	"run": {
diff --git a/Dockerfile.dapper b/Dockerfile.dapper
index 31879788..b9fc66d7 100644
--- a/Dockerfile.dapper
+++ b/Dockerfile.dapper
@@ -1,24 +1,18 @@
-FROM golang:1.15-alpine3.12
+FROM golang:1.16-alpine
 
 ARG DAPPER_HOST_ARCH
 ENV ARCH $DAPPER_HOST_ARCH
 
-RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
-RUN go get -d golang.org/x/lint/golint && \
-    git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
-    go install golang.org/x/lint/golint && \
-    rm -rf /go/src /go/pkg
-RUN mkdir -p /go/src/golang.org/x && \
-    cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
-    git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
-    go install golang.org/x/tools/cmd/goimports
+RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates jq
 RUN rm -rf /go/src /go/pkg
 RUN if [ "${ARCH}" == "amd64" ]; then \
-        curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.36.0; \
+        curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.41.1; \
     fi; \
-    curl -sL "https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-${ARCH}" -o kind && install kind /usr/local/bin; \
-    curl -sLO "https://dl.k8s.io/release/v1.20.2/bin/linux/${ARCH}/kubectl" && install kubectl /usr/local/bin; \
-    curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.9.2/kustomize_v3.9.2_linux_${ARCH}.tar.gz" | tar -zxv -C /usr/local/bin;
+    if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ]; then \
+        kind_version=$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r ".tag_name") && curl -sL "https://kind.sigs.k8s.io/dl/${kind_version}/kind-linux-${ARCH}" -o kind && install kind /usr/local/bin; \
+        kubectl_version=$(curl -sL https://dl.k8s.io/release/stable.txt) && curl -sLO "https://dl.k8s.io/release/${kubectl_version}/bin/linux/${ARCH}/kubectl" && install kubectl /usr/local/bin; \
+        curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.2.0/kustomize_v4.2.0_linux_${ARCH}.tar.gz" | tar -zxv -C /usr/local/bin; \
+    fi
 
 ENV DAPPER_ENV REPO TAG DRONE_TAG
 ENV DAPPER_SOURCE /go/src/github.com/rancher/local-path-provisioner/
diff --git a/examples/pod-with-node-affinity/pod.yaml b/examples/pod-with-node-affinity/pod.yaml
index fe8137cc..da04bf50 100644
--- a/examples/pod-with-node-affinity/pod.yaml
+++ b/examples/pod-with-node-affinity/pod.yaml
@@ -24,4 +24,4 @@ spec:
           - key: kubernetes.io/hostname
             operator: In
             values:
-            - yasker-lp-dev1
+            - kind-worker
diff --git a/go.mod b/go.mod
index b01d0143..35dd4137 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/rancher/local-path-provisioner
 
-go 1.12
+go 1.16
 
 replace (
 	github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
diff --git a/go.sum b/go.sum
index 03498348..a24b8466 100644
--- a/go.sum
+++ b/go.sum
@@ -32,7 +32,6 @@ github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkg
 github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
 github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I=
 github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
diff --git a/scripts/e2e-test b/scripts/e2e-test
index e0583442..fdae11f3 100755
--- a/scripts/e2e-test
+++ b/scripts/e2e-test
@@ -13,4 +13,4 @@ echo "$image"
 
 echo Running tests
 
-TEST_IMAGE="$image" go test -cover -v --tags=e2e ./test/...
\ No newline at end of file
+TEST_IMAGE="$image" go test -cover -v --tags=e2e -timeout 20m ./test/...
\ No newline at end of file
diff --git a/test/testdata/kind-cluster.yaml b/test/testdata/kind-cluster.yaml
index 5328286e..5d48018e 100644
--- a/test/testdata/kind-cluster.yaml
+++ b/test/testdata/kind-cluster.yaml
@@ -3,3 +3,4 @@ kind: Cluster
 nodes:
   - role: control-plane
   - role: worker
+  - role: worker
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a7e8acdf..8d1bccf9 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,13 +1,16 @@
 # github.com/Sirupsen/logrus v0.11.0
+## explicit
 github.com/Sirupsen/logrus
 # github.com/beorn7/perks v1.0.1
 github.com/beorn7/perks/quantile
 # github.com/davecgh/go-spew v1.1.1
 github.com/davecgh/go-spew/spew
 # github.com/gogo/protobuf v1.3.0 => github.com/gogo/protobuf v1.3.2
+## explicit
 github.com/gogo/protobuf/proto
 github.com/gogo/protobuf/sortkeys
 # github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6
+## explicit
 github.com/golang/groupcache/lru
 # github.com/golang/protobuf v1.3.2
 github.com/golang/protobuf/proto
@@ -26,10 +29,12 @@ github.com/google/gofuzz
 # github.com/google/uuid v1.1.1
 github.com/google/uuid
 # github.com/googleapis/gnostic v0.3.1
+## explicit
 github.com/googleapis/gnostic/OpenAPIv2
 github.com/googleapis/gnostic/compiler
 github.com/googleapis/gnostic/extensions
 # github.com/hashicorp/golang-lru v0.5.3
+## explicit
 github.com/hashicorp/golang-lru
 github.com/hashicorp/golang-lru/simplelru
 # github.com/imdario/mergo v0.3.5
@@ -37,20 +42,24 @@ github.com/imdario/mergo
 # github.com/json-iterator/go v1.1.8
 github.com/json-iterator/go
 # github.com/kelseyhightower/envconfig v1.4.0
+## explicit
 github.com/kelseyhightower/envconfig
 # github.com/matttproud/golang_protobuf_extensions v1.0.1
 github.com/matttproud/golang_protobuf_extensions/pbutil
 # github.com/miekg/dns v1.1.27
+## explicit
 github.com/miekg/dns
 # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
 github.com/modern-go/concurrent
 # github.com/modern-go/reflect2 v1.0.1
 github.com/modern-go/reflect2
 # github.com/pkg/errors v0.8.1
+## explicit
 github.com/pkg/errors
 # github.com/pmezard/go-difflib v1.0.0
 github.com/pmezard/go-difflib/difflib
 # github.com/prometheus/client_golang v1.1.0
+## explicit
 github.com/prometheus/client_golang/prometheus
 github.com/prometheus/client_golang/prometheus/internal
 github.com/prometheus/client_golang/prometheus/promhttp
@@ -66,10 +75,12 @@ github.com/prometheus/procfs/internal/fs
 # github.com/spf13/pflag v1.0.5
 github.com/spf13/pflag
 # github.com/stretchr/testify v1.7.0
+## explicit
 github.com/stretchr/testify/assert
 github.com/stretchr/testify/require
 github.com/stretchr/testify/suite
 # github.com/urfave/cli v1.19.1
+## explicit
 github.com/urfave/cli
 # golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 => golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f
 golang.org/x/crypto/ed25519
@@ -103,6 +114,7 @@ golang.org/x/text/transform
 golang.org/x/text/unicode/bidi
 golang.org/x/text/unicode/norm
 # golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0
+## explicit
 golang.org/x/time/rate
 # google.golang.org/appengine v1.5.0
 google.golang.org/appengine/internal
@@ -119,6 +131,7 @@ gopkg.in/yaml.v2
 # gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
 gopkg.in/yaml.v3
 # k8s.io/api v0.17.1
+## explicit
 k8s.io/api/admissionregistration/v1
 k8s.io/api/admissionregistration/v1beta1
 k8s.io/api/apps/v1
@@ -160,6 +173,7 @@ k8s.io/api/storage/v1
 k8s.io/api/storage/v1alpha1
 k8s.io/api/storage/v1beta1
 # k8s.io/apimachinery v0.17.1
+## explicit
 k8s.io/apimachinery/pkg/api/errors
 k8s.io/apimachinery/pkg/api/meta
 k8s.io/apimachinery/pkg/api/resource
@@ -205,6 +219,7 @@ k8s.io/apimachinery/pkg/watch
 k8s.io/apimachinery/third_party/forked/golang/json
 k8s.io/apimachinery/third_party/forked/golang/reflect
 # k8s.io/client-go v0.17.1
+## explicit
 k8s.io/client-go/discovery
 k8s.io/client-go/informers
 k8s.io/client-go/informers/admissionregistration
@@ -378,8 +393,12 @@ k8s.io/utils/buffer
 k8s.io/utils/integer
 k8s.io/utils/trace
 # sigs.k8s.io/sig-storage-lib-external-provisioner v4.0.2-0.20200115000635-36885abbb2bd+incompatible
+## explicit
 sigs.k8s.io/sig-storage-lib-external-provisioner/controller
 sigs.k8s.io/sig-storage-lib-external-provisioner/controller/metrics
 sigs.k8s.io/sig-storage-lib-external-provisioner/util
 # sigs.k8s.io/yaml v1.1.0
+## explicit
 sigs.k8s.io/yaml
+# github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
+# golang.org/x/crypto => golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f
-- 
GitLab