From fb1955674933b7f44bea9cb920f17f12df98495b Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Fri, 25 Dec 2020 14:37:12 +0000 Subject: [PATCH 1/4] test: refine sanity test script --- go.mod | 2 +- test/sanity/run-test.sh | 8 ++++++-- vendor/modules.txt | 42 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6fc8a423a..1e3cd0191 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubernetes-csi/csi-driver-nfs -go 1.13 +go 1.15 require ( github.com/container-storage-interface/spec v1.3.0 diff --git a/test/sanity/run-test.sh b/test/sanity/run-test.sh index 8ec020229..12371ecc6 100755 --- a/test/sanity/run-test.sh +++ b/test/sanity/run-test.sh @@ -28,9 +28,13 @@ trap cleanup EXIT function install_csi_sanity_bin { echo 'Installing CSI sanity test binary...' + mkdir -p $GOPATH/src/github.com/kubernetes-csi + pushd $GOPATH/src/github.com/kubernetes-csi + export GO111MODULE=off git clone https://github.com/kubernetes-csi/csi-test.git -b v2.2.0 pushd csi-test/cmd/csi-sanity - make + make install + popd popd } @@ -53,5 +57,5 @@ fi bin/nfsplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 & echo 'Begin to run sanity test...' -readonly CSI_SANITY_BIN='csi-test/cmd/csi-sanity/csi-sanity' +readonly CSI_SANITY_BIN='csi-sanity' "$CSI_SANITY_BIN" --ginkgo.v --csi.testvolumeparameters="$(pwd)/test/sanity/params.yaml" --csi.endpoint="$endpoint" --ginkgo.skip="should not fail when requesting to create a volume with already existing name and same capacity|should fail when requesting to create a volume with already existing name and different capacity|should work|should fail when the requested volume does not exist" diff --git a/vendor/modules.txt b/vendor/modules.txt index d49de2ac6..77439acc7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -5,6 +5,7 @@ github.com/blang/semver # github.com/cespare/xxhash/v2 v2.1.1 github.com/cespare/xxhash/v2 # github.com/container-storage-interface/spec v1.3.0 +## explicit github.com/container-storage-interface/spec/lib/go/csi # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew @@ -22,10 +23,12 @@ github.com/go-logr/logr github.com/gogo/protobuf/proto github.com/gogo/protobuf/sortkeys # github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b +## explicit github.com/golang/glog # github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 github.com/golang/groupcache/lru # github.com/golang/protobuf v1.4.2 +## explicit github.com/golang/protobuf/descriptor github.com/golang/protobuf/proto github.com/golang/protobuf/protoc-gen-go/descriptor @@ -64,8 +67,10 @@ github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.10 github.com/json-iterator/go # github.com/kubernetes-csi/csi-lib-utils v0.9.0 +## explicit github.com/kubernetes-csi/csi-lib-utils/protosanitizer # github.com/kubernetes-csi/external-snapshotter/v2 v2.0.0-20200617021606-4800ca72d403 +## explicit github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1 # github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 github.com/matttproud/golang_protobuf_extensions/pbutil @@ -74,6 +79,7 @@ github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 # github.com/onsi/ginkgo v1.11.0 +## explicit github.com/onsi/ginkgo github.com/onsi/ginkgo/config github.com/onsi/ginkgo/internal/codelocation @@ -93,6 +99,7 @@ github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty github.com/onsi/ginkgo/types # github.com/onsi/gomega v1.7.1 +## explicit github.com/onsi/gomega github.com/onsi/gomega/format github.com/onsi/gomega/internal/assertion @@ -108,6 +115,7 @@ github.com/onsi/gomega/types # github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/go-digest # github.com/pborman/uuid v1.2.0 +## explicit github.com/pborman/uuid # github.com/pkg/errors v0.9.1 github.com/pkg/errors @@ -130,10 +138,12 @@ github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util # github.com/spf13/cobra v1.0.0 +## explicit github.com/spf13/cobra # github.com/spf13/pflag v1.0.5 github.com/spf13/pflag # github.com/stretchr/testify v1.5.1 +## explicit github.com/stretchr/testify/assert # golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto/blowfish @@ -148,6 +158,7 @@ golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20200707034311-ab3426394381 +## explicit golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/html @@ -201,6 +212,7 @@ google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.29.0 +## explicit google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff @@ -241,6 +253,7 @@ google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap # google.golang.org/protobuf v1.25.0 +## explicit google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt @@ -287,6 +300,7 @@ gopkg.in/tomb.v1 # gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 # k8s.io/api v0.19.0 => k8s.io/api v0.19.0 +## explicit k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 k8s.io/api/admissionregistration/v1 @@ -331,6 +345,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 # k8s.io/apimachinery v0.19.0 => k8s.io/apimachinery v0.19.0 +## explicit k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -424,6 +439,7 @@ k8s.io/apiserver/pkg/util/feature k8s.io/apiserver/pkg/util/webhook k8s.io/apiserver/pkg/warning # k8s.io/client-go v0.19.0 => k8s.io/client-go v0.19.0 +## explicit k8s.io/client-go/discovery k8s.io/client-go/discovery/cached/memory k8s.io/client-go/dynamic @@ -617,6 +633,7 @@ k8s.io/component-base/metrics/legacyregistry k8s.io/component-base/metrics/testutil k8s.io/component-base/version # k8s.io/klog/v2 v2.2.0 +## explicit k8s.io/klog/v2 # k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 k8s.io/kube-openapi/pkg/util/proto @@ -624,6 +641,7 @@ k8s.io/kube-openapi/pkg/util/proto k8s.io/kubectl/pkg/scale k8s.io/kubectl/pkg/util/podutils # k8s.io/kubernetes v1.19.0 +## explicit k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service k8s.io/kubernetes/pkg/api/v1/pod @@ -674,6 +692,7 @@ k8s.io/kubernetes/test/e2e/system k8s.io/kubernetes/test/utils k8s.io/kubernetes/test/utils/image # k8s.io/utils v0.0.0-20200729134348-d5654de09c73 +## explicit k8s.io/utils/buffer k8s.io/utils/exec k8s.io/utils/integer @@ -691,3 +710,26 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml +# k8s.io/api => k8s.io/api v0.19.0 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.0 +# k8s.io/apimachinery => k8s.io/apimachinery v0.19.0 +# k8s.io/apiserver => k8s.io/apiserver v0.19.0 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.0 +# k8s.io/client-go => k8s.io/client-go v0.19.0 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.0 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.0 +# k8s.io/code-generator => k8s.io/code-generator v0.19.0 +# k8s.io/component-base => k8s.io/component-base v0.19.0 +# k8s.io/cri-api => k8s.io/cri-api v0.19.0 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.19.0 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.19.0 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.0 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.0 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.0 +# k8s.io/kubectl => k8s.io/kubectl v0.19.0 +# k8s.io/kubelet => k8s.io/kubelet v0.19.0 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.0 +# k8s.io/metrics => k8s.io/metrics v0.19.0 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.0 +# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.19.0 +# k8s.io/sample-controller => k8s.io/sample-controller v0.19.0 From 87dce63c7ad0c498426f2cdedd3b7ceb14dc5ae7 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Fri, 25 Dec 2020 14:38:26 +0000 Subject: [PATCH 2/4] doc: revise PR template fix test failure --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/sanity.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d70526403..274c5d0bd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -36,5 +36,5 @@ If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". --> ```release-note - +none ``` diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index 5e9267e58..c644724d3 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -13,4 +13,4 @@ jobs: uses: actions/checkout@v2 - name: Run tests run: | - sudo make sanity-test \ No newline at end of file + make sanity-test From ddeb6a8e5fa97c0b1170743e5bf2f7b931f7a12b Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Fri, 25 Dec 2020 15:12:21 +0000 Subject: [PATCH 3/4] test: remove sanity test in GH action --- .github/workflows/sanity.yaml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/sanity.yaml diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml deleted file mode 100644 index c644724d3..000000000 --- a/.github/workflows/sanity.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Sanity Tests -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] -jobs: - test: - name: Sanity tests - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Run tests - run: | - make sanity-test From 4c6213dc3f4043ee09414fcebcfe05dd4fe55148 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 26 Dec 2020 00:41:35 +0000 Subject: [PATCH 4/4] chore: switch to 3.0.0 for master branch revise version sleep 10s --- Makefile | 2 +- pkg/nfs/nfs.go | 2 +- test/sanity/run-test.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b8c30a766..75ec6aec6 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ export GOPATH GOBIN GO111MODULE DOCKER_CLI_EXPERIMENTAL include release-tools/build.make LDFLAGS = "-X ${PKG}/pkg/nfs.driverVersion=${IMAGE_VERSION} -s -w -extldflags '-static'" GIT_COMMIT ?= $(shell git rev-parse HEAD) -IMAGE_VERSION ?= v0.5.0 +IMAGE_VERSION ?= v3.0.0 # Use a custom version for E2E tests if we are testing in CI ifdef CI ifndef PUBLISH diff --git a/pkg/nfs/nfs.go b/pkg/nfs/nfs.go index 65ec0ed5c..521d748e1 100644 --- a/pkg/nfs/nfs.go +++ b/pkg/nfs/nfs.go @@ -51,7 +51,7 @@ const ( ) var ( - version = "2.0.0" + version = "3.0.0" ) func NewNFSdriver(nodeID, endpoint string, perm *uint32) *Driver { diff --git a/test/sanity/run-test.sh b/test/sanity/run-test.sh index 12371ecc6..32e9e7742 100755 --- a/test/sanity/run-test.sh +++ b/test/sanity/run-test.sh @@ -43,6 +43,7 @@ function provision_nfs_server { apt-get update -y apt-get install -y nfs-common docker run -d --name nfs --privileged -p 2049:2049 -v $(pwd)/nfsshare:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest + sleep 10 } provision_nfs_server