Updated vednor files

This commit is contained in:
Serguei Bezverkhi
2018-02-15 08:50:31 -05:00
parent 18a4ce4439
commit 1f1e8cea37
3299 changed files with 834 additions and 1051200 deletions

View File

@ -1,19 +1,15 @@
# Setting "sudo" to false forces Travis-CI to use its
# container-based build infrastructure, which has shorter
# queue times.
sudo: false
# Use the newer Travis-CI build templates based on the
# Debian Linux distribution "Trusty" release.
dist: trusty
# Select Go as the language used to run the build.
language: go
# Needed for e2e tests
sudo: true
go: 1.9.x
go_import_path: github.com/kubernetes-csi/drivers
install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure -vendor-only
- make
script:
- go test -v github.com/kubernetes-csi/drivers/... -cover
- go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0
- go vet $(go list ./... | grep -v vendor)
- go test $(go list ./... | grep -v vendor)
- ./hack/e2e-hostpath.sh

View File

@ -1,18 +1,6 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/PuerkitoBio/purell"
packages = ["."]
revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/PuerkitoBio/urlesc"
packages = ["."]
revision = "de5bf2ad457846296e2031421a34e2568e304e35"
[[projects]]
branch = "master"
name = "github.com/beorn7/perks"
@ -23,7 +11,7 @@
branch = "master"
name = "github.com/container-storage-interface/spec"
packages = ["lib/go/csi"]
revision = "51e48d38ac8a5b4bdcf41826b77dc016ad83451e"
revision = "7ab01a90da87f9fef3ee1de0494962fdefaf7db7"
[[projects]]
name = "github.com/davecgh/go-spew"
@ -31,64 +19,22 @@
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
version = "v1.1.0"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "dbeaa9332f19a944acb5736b4456cfcc02140e29"
version = "v3.1.0"
[[projects]]
name = "github.com/docker/distribution"
packages = ["digestset","reference"]
revision = "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c"
[[projects]]
name = "github.com/emicklei/go-restful"
packages = [".","log"]
revision = "5741799b275a3c4a5a9623a993576d7545cf7b5c"
version = "v2.4.0"
[[projects]]
name = "github.com/emicklei/go-restful-swagger12"
packages = ["."]
revision = "dcef7f55730566d41eae5db10e7d6981829720f6"
version = "1.0.1"
[[projects]]
name = "github.com/ghodss/yaml"
packages = ["."]
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonpointer"
packages = ["."]
revision = "779f45308c19820f1a69e9a4cd965f496e0da10f"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonreference"
packages = ["."]
revision = "36d33bfe519efae5632669801b180bf1a245da3b"
[[projects]]
branch = "master"
name = "github.com/go-openapi/spec"
packages = ["."]
revision = "a4fa9574c7aa73b2fc54e251eb9524d0482bb592"
[[projects]]
branch = "master"
name = "github.com/go-openapi/swag"
packages = ["."]
revision = "cf0bdb963811675a4d7e74901cefc7411a1df939"
[[projects]]
name = "github.com/gogo/protobuf"
packages = ["proto","sortkeys"]
revision = "342cbe0a04158f6dcb03ca0079991a51a4248c02"
version = "v0.5"
revision = "1adfc126b41513cc696b209667c8656ea7aac67c"
version = "v1.0.0"
[[projects]]
branch = "master"
@ -100,19 +46,19 @@
branch = "master"
name = "github.com/golang/groupcache"
packages = ["lru"]
revision = "84a468cf14b4376def5d68c722b139b881c450a4"
revision = "66deaeb636dff1ac7d938ce666d090556056a4b0"
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto","ptypes","ptypes/any","ptypes/duration","ptypes/timestamp"]
revision = "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
revision = "925541529c1fa6821df4e44ce2723319eb2be768"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/google/btree"
packages = ["."]
revision = "316fb6d3f031ae8f4d457c6c5186b9e3ded70435"
revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4"
[[projects]]
branch = "master"
@ -130,19 +76,19 @@
branch = "master"
name = "github.com/gophercloud/gophercloud"
packages = [".","openstack","openstack/blockstorage/v3/volumes","openstack/compute/v2/extensions/volumeattach","openstack/identity/v2/tenants","openstack/identity/v2/tokens","openstack/identity/v3/tokens","openstack/utils","pagination"]
revision = "4d2733c962898d8cd68456bd275aee64256cd2a1"
revision = "6da026c32e2d622cc242d32984259c77237aefe1"
[[projects]]
branch = "master"
name = "github.com/gregjones/httpcache"
packages = [".","diskcache"]
revision = "22a0b1feae53974ed4cfe27bcce70dba061cc5fd"
revision = "2bcd89a1743fd4b373f7370ce8ddc14dfbd18229"
[[projects]]
branch = "master"
name = "github.com/hashicorp/golang-lru"
packages = [".","simplelru"]
revision = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6"
revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3"
[[projects]]
name = "github.com/inconshreveable/mousetrap"
@ -153,20 +99,14 @@
[[projects]]
name = "github.com/json-iterator/go"
packages = ["."]
revision = "6240e1e7983a85228f7fd9c3e1b6932d46ec58e2"
version = "1.0.3"
revision = "28452fcdec4e44348d2af0d91d1e9e38da3a9e0a"
version = "1.0.5"
[[projects]]
branch = "master"
name = "github.com/juju/ratelimit"
packages = ["."]
revision = "59fac5042749a5afb9af70e813da1dd5474f0167"
[[projects]]
branch = "master"
name = "github.com/mailru/easyjson"
packages = ["buffer","jlexer","jwriter"]
revision = "7578e5f07ef653b5940eff36e0d0d84e4362bea4"
version = "1.0.1"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
@ -214,19 +154,19 @@
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
revision = "6f3806018612930941127f2a7c6c453ba2c527d2"
revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = ["expfmt","internal/bitbucket.org/ww/goautoneg","model"]
revision = "e3fb1a1acd7605367a2b378bc2e2f893c05174b7"
revision = "89604d197083d4781071d3c65855d24ecfb0a563"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [".","xfs"]
revision = "a6e9df898b1336106c743392c48ee0b71f5c4efa"
packages = [".","internal/util","nfs","xfs"]
revision = "cb4147076ac75738c9a7d279075a253c0cc5acbd"
[[projects]]
name = "github.com/spf13/cobra"
@ -241,46 +181,52 @@
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/stretchr/objx"
packages = ["."]
revision = "1a9d0bb9f541897e62256577b352fdbc1fb4fd94"
revision = "facf9a85c22f48d2f52f2380e4efce1768749a89"
version = "v0.1"
[[projects]]
name = "github.com/stretchr/testify"
packages = ["assert","mock"]
revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0"
version = "v1.1.4"
revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71"
version = "v1.2.1"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ed25519","ed25519/internal/edwards25519"]
revision = "5119cf507ed5294cc409c092980c7497ee5d6fd2"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context","http2","http2/hpack","idna","internal/timeseries","lex/httplex","trace"]
revision = "a337091b0525af65de94df2eb7e98bd9962dcbe2"
revision = "f5dfe339be1d06f81b22525fe34671ee7d2c8904"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix"]
revision = "bf42f188b9bc6f2cf5b8ee5a912ef1aedd0eba4c"
revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd"
[[projects]]
branch = "master"
name = "golang.org/x/text"
packages = ["collate","collate/build","internal/colltab","internal/gen","internal/tag","internal/triegen","internal/ucd","language","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable","width"]
revision = "88f656faf3f37f690df1a32515b479415e1a6769"
packages = ["collate","collate/build","internal/colltab","internal/gen","internal/tag","internal/triegen","internal/ucd","language","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable"]
revision = "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1"
[[projects]]
branch = "master"
name = "google.golang.org/genproto"
packages = ["googleapis/rpc/status"]
revision = "11c7f9e547da6db876260ce49ea7536985904c9b"
revision = "2b5a72b8730b0b16380010cfe5286c42108d88e7"
[[projects]]
name = "google.golang.org/grpc"
packages = [".","balancer","codes","connectivity","credentials","grpclb/grpc_lb_v1/messages","grpclog","internal","keepalive","metadata","naming","peer","resolver","stats","status","tap","transport"]
revision = "5ffe3083946d5603a0578721101dc8165b1d5b5f"
version = "v1.7.2"
packages = [".","balancer","balancer/base","balancer/roundrobin","codes","connectivity","credentials","encoding","grpclb/grpc_lb_v1/messages","grpclog","internal","keepalive","metadata","naming","peer","resolver","resolver/dns","resolver/passthrough","stats","status","tap","transport"]
revision = "6b51017f791ae1cfbec89c52efdf444b13b550ef"
version = "v1.9.2"
[[projects]]
name = "gopkg.in/gcfg.v1"
@ -294,6 +240,12 @@
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
version = "v0.9.0"
[[projects]]
name = "gopkg.in/square/go-jose.v2"
packages = [".","cipher","json","jwt"]
revision = "f8f38de21b4dcd69d0413faf231983f5fd6634b1"
version = "v2.1.3"
[[projects]]
name = "gopkg.in/warnings.v0"
packages = ["."]
@ -304,59 +256,59 @@
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"
revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4"
[[projects]]
branch = "master"
name = "k8s.io/api"
packages = ["admissionregistration/v1alpha1","admissionregistration/v1beta1","apps/v1","apps/v1beta1","apps/v1beta2","authentication/v1","authentication/v1beta1","authorization/v1","authorization/v1beta1","autoscaling/v1","autoscaling/v2beta1","batch/v1","batch/v1beta1","batch/v2alpha1","certificates/v1beta1","core/v1","events/v1beta1","extensions/v1beta1","networking/v1","policy/v1beta1","rbac/v1","rbac/v1alpha1","rbac/v1beta1","scheduling/v1alpha1","settings/v1alpha1","storage/v1","storage/v1alpha1","storage/v1beta1"]
revision = "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
[[projects]]
branch = "master"
name = "k8s.io/apiextensions-apiserver"
packages = ["pkg/features"]
revision = "099fd227da1f60394aac19c77254374142d01079"
revision = "d64d645c52b769d38dbfa509fcba27186c212117"
[[projects]]
branch = "release-1.9"
branch = "master"
name = "k8s.io/apimachinery"
packages = ["pkg/api/equality","pkg/api/errors","pkg/api/meta","pkg/api/resource","pkg/api/validation","pkg/apimachinery","pkg/apimachinery/announced","pkg/apimachinery/registered","pkg/apis/meta/internalversion","pkg/apis/meta/v1","pkg/apis/meta/v1/unstructured","pkg/apis/meta/v1/validation","pkg/apis/meta/v1alpha1","pkg/conversion","pkg/conversion/queryparams","pkg/fields","pkg/labels","pkg/runtime","pkg/runtime/schema","pkg/runtime/serializer","pkg/runtime/serializer/json","pkg/runtime/serializer/protobuf","pkg/runtime/serializer/recognizer","pkg/runtime/serializer/streaming","pkg/runtime/serializer/versioning","pkg/selection","pkg/types","pkg/util/cache","pkg/util/clock","pkg/util/diff","pkg/util/errors","pkg/util/framer","pkg/util/intstr","pkg/util/json","pkg/util/mergepatch","pkg/util/net","pkg/util/runtime","pkg/util/sets","pkg/util/strategicpatch","pkg/util/validation","pkg/util/validation/field","pkg/util/wait","pkg/util/yaml","pkg/version","pkg/watch","third_party/forked/golang/json","third_party/forked/golang/reflect"]
revision = "180eddb345a5be3a157cea1c624700ad5bd27b8f"
packages = ["pkg/api/equality","pkg/api/errors","pkg/api/meta","pkg/api/resource","pkg/api/validation","pkg/apimachinery","pkg/apimachinery/announced","pkg/apimachinery/registered","pkg/apis/meta/internalversion","pkg/apis/meta/v1","pkg/apis/meta/v1/unstructured","pkg/apis/meta/v1/validation","pkg/apis/meta/v1beta1","pkg/conversion","pkg/conversion/queryparams","pkg/fields","pkg/labels","pkg/runtime","pkg/runtime/schema","pkg/runtime/serializer","pkg/runtime/serializer/json","pkg/runtime/serializer/protobuf","pkg/runtime/serializer/recognizer","pkg/runtime/serializer/streaming","pkg/runtime/serializer/versioning","pkg/selection","pkg/types","pkg/util/cache","pkg/util/clock","pkg/util/diff","pkg/util/errors","pkg/util/framer","pkg/util/intstr","pkg/util/json","pkg/util/mergepatch","pkg/util/net","pkg/util/runtime","pkg/util/sets","pkg/util/strategicpatch","pkg/util/validation","pkg/util/validation/field","pkg/util/wait","pkg/util/yaml","pkg/version","pkg/watch","third_party/forked/golang/json","third_party/forked/golang/reflect"]
revision = "616b23029fa3dc3e0ccefd47963f5651a6543d94"
[[projects]]
branch = "master"
name = "k8s.io/apiserver"
packages = ["pkg/authentication/authenticator","pkg/authentication/serviceaccount","pkg/authentication/user","pkg/features","pkg/util/feature"]
revision = "73f85001b53a0adc72b5d3dc68abbcda0837fe3a"
revision = "16f07649a010bed64bb9c7986bd9988f68ce0421"
[[projects]]
name = "k8s.io/client-go"
packages = ["discovery","informers","informers/admissionregistration","informers/admissionregistration/v1alpha1","informers/apps","informers/apps/v1beta1","informers/apps/v1beta2","informers/autoscaling","informers/autoscaling/v1","informers/autoscaling/v2beta1","informers/batch","informers/batch/v1","informers/batch/v1beta1","informers/batch/v2alpha1","informers/certificates","informers/certificates/v1beta1","informers/core","informers/core/v1","informers/extensions","informers/extensions/v1beta1","informers/internalinterfaces","informers/networking","informers/networking/v1","informers/policy","informers/policy/v1beta1","informers/rbac","informers/rbac/v1","informers/rbac/v1alpha1","informers/rbac/v1beta1","informers/scheduling","informers/scheduling/v1alpha1","informers/settings","informers/settings/v1alpha1","informers/storage","informers/storage/v1","informers/storage/v1beta1","kubernetes","kubernetes/scheme","kubernetes/typed/admissionregistration/v1alpha1","kubernetes/typed/apps/v1beta1","kubernetes/typed/apps/v1beta2","kubernetes/typed/authentication/v1","kubernetes/typed/authentication/v1beta1","kubernetes/typed/authorization/v1","kubernetes/typed/authorization/v1beta1","kubernetes/typed/autoscaling/v1","kubernetes/typed/autoscaling/v2beta1","kubernetes/typed/batch/v1","kubernetes/typed/batch/v1beta1","kubernetes/typed/batch/v2alpha1","kubernetes/typed/certificates/v1beta1","kubernetes/typed/core/v1","kubernetes/typed/extensions/v1beta1","kubernetes/typed/networking/v1","kubernetes/typed/policy/v1beta1","kubernetes/typed/rbac/v1","kubernetes/typed/rbac/v1alpha1","kubernetes/typed/rbac/v1beta1","kubernetes/typed/scheduling/v1alpha1","kubernetes/typed/settings/v1alpha1","kubernetes/typed/storage/v1","kubernetes/typed/storage/v1beta1","listers/admissionregistration/v1alpha1","listers/apps/v1beta1","listers/apps/v1beta2","listers/autoscaling/v1","listers/autoscaling/v2beta1","listers/batch/v1","listers/batch/v1beta1","listers/batch/v2alpha1","listers/certificates/v1beta1","listers/core/v1","listers/extensions/v1beta1","listers/networking/v1","listers/policy/v1beta1","listers/rbac/v1","listers/rbac/v1alpha1","listers/rbac/v1beta1","listers/scheduling/v1alpha1","listers/settings/v1alpha1","listers/storage/v1","listers/storage/v1beta1","pkg/version","rest","rest/watch","tools/cache","tools/clientcmd/api","tools/metrics","tools/pager","tools/record","tools/reference","transport","util/cert","util/flowcontrol","util/integer","util/retry"]
revision = "59ab1a8387ec5d6273ba6d3d400fb522d6e24c8f"
branch = "master"
packages = ["discovery","informers","informers/admissionregistration","informers/admissionregistration/v1alpha1","informers/admissionregistration/v1beta1","informers/apps","informers/apps/v1","informers/apps/v1beta1","informers/apps/v1beta2","informers/autoscaling","informers/autoscaling/v1","informers/autoscaling/v2beta1","informers/batch","informers/batch/v1","informers/batch/v1beta1","informers/batch/v2alpha1","informers/certificates","informers/certificates/v1beta1","informers/core","informers/core/v1","informers/events","informers/events/v1beta1","informers/extensions","informers/extensions/v1beta1","informers/internalinterfaces","informers/networking","informers/networking/v1","informers/policy","informers/policy/v1beta1","informers/rbac","informers/rbac/v1","informers/rbac/v1alpha1","informers/rbac/v1beta1","informers/scheduling","informers/scheduling/v1alpha1","informers/settings","informers/settings/v1alpha1","informers/storage","informers/storage/v1","informers/storage/v1alpha1","informers/storage/v1beta1","kubernetes","kubernetes/scheme","kubernetes/typed/admissionregistration/v1alpha1","kubernetes/typed/admissionregistration/v1beta1","kubernetes/typed/apps/v1","kubernetes/typed/apps/v1beta1","kubernetes/typed/apps/v1beta2","kubernetes/typed/authentication/v1","kubernetes/typed/authentication/v1beta1","kubernetes/typed/authorization/v1","kubernetes/typed/authorization/v1beta1","kubernetes/typed/autoscaling/v1","kubernetes/typed/autoscaling/v2beta1","kubernetes/typed/batch/v1","kubernetes/typed/batch/v1beta1","kubernetes/typed/batch/v2alpha1","kubernetes/typed/certificates/v1beta1","kubernetes/typed/core/v1","kubernetes/typed/events/v1beta1","kubernetes/typed/extensions/v1beta1","kubernetes/typed/networking/v1","kubernetes/typed/policy/v1beta1","kubernetes/typed/rbac/v1","kubernetes/typed/rbac/v1alpha1","kubernetes/typed/rbac/v1beta1","kubernetes/typed/scheduling/v1alpha1","kubernetes/typed/settings/v1alpha1","kubernetes/typed/storage/v1","kubernetes/typed/storage/v1alpha1","kubernetes/typed/storage/v1beta1","listers/admissionregistration/v1alpha1","listers/admissionregistration/v1beta1","listers/apps/v1","listers/apps/v1beta1","listers/apps/v1beta2","listers/autoscaling/v1","listers/autoscaling/v2beta1","listers/batch/v1","listers/batch/v1beta1","listers/batch/v2alpha1","listers/certificates/v1beta1","listers/core/v1","listers/events/v1beta1","listers/extensions/v1beta1","listers/networking/v1","listers/policy/v1beta1","listers/rbac/v1","listers/rbac/v1alpha1","listers/rbac/v1beta1","listers/scheduling/v1alpha1","listers/settings/v1alpha1","listers/storage/v1","listers/storage/v1alpha1","listers/storage/v1beta1","pkg/version","rest","rest/watch","tools/cache","tools/clientcmd/api","tools/metrics","tools/pager","tools/record","tools/reference","transport","util/buffer","util/cert","util/flowcontrol","util/integer","util/retry"]
revision = "78700dec6369ba22221b72770783300f143df150"
version = "v6.0.0"
[[projects]]
branch = "master"
name = "k8s.io/kube-openapi"
packages = ["pkg/common","pkg/util/proto"]
revision = "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1"
packages = ["pkg/util/proto"]
revision = "275e2ce91dec4c05a4094a7b1daee5560b555ac9"
[[projects]]
branch = "master"
name = "k8s.io/kubernetes"
packages = ["pkg/api/legacyscheme","pkg/api/service","pkg/api/v1/pod","pkg/apis/autoscaling","pkg/apis/core","pkg/apis/core/helper","pkg/apis/core/install","pkg/apis/core/pods","pkg/apis/core/v1","pkg/apis/core/v1/helper","pkg/apis/core/validation","pkg/apis/extensions","pkg/apis/networking","pkg/capabilities","pkg/cloudprovider","pkg/controller","pkg/features","pkg/fieldpath","pkg/kubelet/apis","pkg/kubelet/types","pkg/security/apparmor","pkg/serviceaccount","pkg/util/file","pkg/util/hash","pkg/util/io","pkg/util/mount","pkg/util/net/sets","pkg/util/nsenter","pkg/util/parsers","pkg/util/pointer","pkg/util/taints","pkg/volume","pkg/volume/util"]
revision = "3ac6d1f5c03bbc550fe197ae58da9d3f6a91a1f0"
version = "v1.9.0-beta.2"
packages = ["pkg/api/legacyscheme","pkg/api/service","pkg/api/v1/pod","pkg/apis/autoscaling","pkg/apis/core","pkg/apis/core/helper","pkg/apis/core/install","pkg/apis/core/pods","pkg/apis/core/v1","pkg/apis/core/v1/helper","pkg/apis/core/validation","pkg/apis/extensions","pkg/apis/networking","pkg/capabilities","pkg/cloudprovider","pkg/controller","pkg/features","pkg/fieldpath","pkg/kubelet/apis","pkg/kubelet/types","pkg/master/ports","pkg/security/apparmor","pkg/serviceaccount","pkg/util/file","pkg/util/hash","pkg/util/io","pkg/util/mount","pkg/util/net/sets","pkg/util/nsenter","pkg/util/parsers","pkg/util/pointer","pkg/util/taints","pkg/volume","pkg/volume/util"]
revision = "19829a24f1c1ee608e1862bfe9828f4630f484cd"
[[projects]]
branch = "master"
name = "k8s.io/utils"
packages = ["exec"]
revision = "bf963466fd3fea33c428098b12a89d8ecd012f25"
[[projects]]
branch = "master"
name = "k8s.io/api"
packages = ["admissionregistration/v1alpha1","apps/v1beta1","apps/v1beta2","authentication/v1","authentication/v1beta1","authorization/v1","authorization/v1beta1","autoscaling/v1","autoscaling/v2beta1","batch/v1","batch/v1beta1","batch/v2alpha1","certificates/v1beta1","core/v1","extensions/v1beta1","networking/v1","policy/v1beta1","rbac/v1","rbac/v1alpha1","rbac/v1beta1","scheduling/v1alpha1","settings/v1alpha1","storage/v1","storage/v1beta1"]
revision = "5cb170de1f060ebf2dde62cc4b8241fdb3c01203"
revision = "258e2a2fa64568210fbd6267cf1d8fd87c3cb86e"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "77a9f83151caa2ed28dd48707ab7b3122afd4adbf6699b248cbe3a463dfb4127"
inputs-digest = "ed3e1732651d25ef2fd3f1c44d70fb9a0c067dbb6a6c8e7bbc66088751bbf96c"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -22,8 +22,8 @@
[[constraint]]
branch = "master"
name = "github.com/container-storage-interface/spec"
branch = "master"
[[constraint]]
branch = "master"
@ -39,8 +39,16 @@
[[constraint]]
name = "k8s.io/kubernetes"
version = "v1.9.0-beta.2"
branch = "master"
[[constraint]]
branch = "master"
name = "github.com/kubernetes-csi/csi-test"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.9.0-beta.2"
branch = "master"
[[constraint]]
name = "k8s.io/api"
branch = "master"

View File

@ -22,19 +22,19 @@ test:
flexadapter:
if [ ! -d ./vendor ]; then dep ensure; fi
go build -o _output/flexadapter ./app/flexadapter
go build -i -o _output/flexadapter ./app/flexadapter
nfs:
if [ ! -d ./vendor ]; then dep ensure; fi
go build -o _output/nfsplugin ./app/nfsplugin
go build -i -o _output/nfsplugin ./app/nfsplugin
hostpath:
if [ ! -d ./vendor ]; then dep ensure; fi
go build -i -o _output/hostpathplugin ./app/hostpathplugin
iscsi:
if [ ! -d ./vendor ]; then dep ensure; fi
go build -o _output/iscsiplugin ./app/iscsiplugin
go build -i -o _output/iscsiplugin ./app/iscsiplugin
cinder:
if [ ! -d ./vendor ]; then dep ensure; fi
go build -o _output/cinderplugin ./app/cinderplugin
go build -i -o _output/cinderplugin ./app/cinderplugin
clean:
go clean -r -x

View File

@ -1,6 +1,6 @@
# CSI Drivers
These drivers are provided puerly for illustrative purposes, and should not be used for production workloads.
These drivers are provided purely for illustrative purposes, and should not be used for production workloads.
## Other sample drivers
Please read [Drivers](https://github.com/kubernetes-csi/docs/wiki/Drivers) for more information

View File

@ -72,6 +72,6 @@ func main() {
}
func handle() {
adapter := flexadapter.GetFlexAdapter()
adapter := flexadapter.New()
adapter.Run(driverName, driverPath, nodeID, endpoint)
}

View File

@ -0,0 +1,52 @@
#!/bin/bash
## This file is for app/hostpathplugin
## It could be used for other apps in this repo, but
## those applications may or may not take the same
## arguments
## Must be run from the root of the repo
UDS="/tmp/e2e-csi-sanity.sock"
CSI_ENDPOINT="unix://${UDS}"
CSI_MOUNTPOINT="/mnt"
APP=hostpathplugin
SKIP="WithCapacity"
if [ x${TRAVIS} = x"true" ] ; then
SKIP="WithCapacity|NodeUnpublishVolume|NodePublishVolume"
fi
# Get csi-sanity
git clone https://github.com/kubernetes-csi/csi-test $GOPATH/src/github.com/kubernetes-csi/csi-test
pushd $GOPATH/src/github.com/kubernetes-csi/csi-test/cmd/csi-sanity
make all
make install
popd
#./hack/get-sanity.sh
# Build
cd app/hostpathplugin
go install || exit 1
cd ../..
# Cleanup
rm -f $UDS
# Start the application in the background
sudo $GOPATH/bin/$APP --endpoint=$CSI_ENDPOINT --nodeid=1 &
pid=$!
# Need to skip Capacity testing since hostpath does not support it
sudo $GOPATH/bin/csi-sanity $@ \
--ginkgo.skip=${SKIP} \
--csi.mountpoint=$CSI_MOUNTPOINT \
--csi.endpoint=$CSI_ENDPOINT ; ret=$?
sudo kill -9 $pid
sudo rm -f $UDS
if [ $ret -ne 0 ] ; then
exit $ret
fi
exit 0

15
vendor/github.com/kubernetes-csi/drivers/hack/get-sanity.sh generated vendored Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
VERSION="v0.1.0-2"
SANITYTGZ="csi-sanity-${VERSION}.linux.amd64.tar.gz"
if [ ! -x $GOPATH/bin/csi-sanity ] ; then
curl -s -L \
https://github.com/kubernetes-csi/csi-test/releases/download/${VERSION}/${SANITYTGZ} \
-o ${SANITYTGZ} && \
tar xzvf ${SANITYTGZ} -C /tmp && \
rm -f ${SANITYTGZ} && \
cp /tmp/csi-sanity/csi-sanity $GOPATH/bin/csi-sanity && \
rm -rf /tmp/csi-sanity
fi

View File

@ -39,8 +39,8 @@ by using the result of the above command.
$ sudo ./_output/cinderplugin --endpoint tcp://127.0.0.1:10000 --cloud-config /etc/cloud.conf --nodeid CSINodeID
```
### Test
Get ```csc``` tool from https://github.com/chakri-nelluri/gocsi/tree/master/csc
### Test using csc
Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
#### Get plugin info
```

View File

@ -68,7 +68,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
glog.V(4).Infof("Create volume %s in Availability Zone: %s", resID, resAvailability)
return &csi.CreateVolumeResponse{
VolumeInfo: &csi.VolumeInfo{
Volume: &csi.Volume{
Id: resID,
Attributes: map[string]string{
"availability": resAvailability,
@ -137,7 +137,7 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
pvInfo["DevicePath"] = devicePath
return &csi.ControllerPublishVolumeResponse{
PublishVolumeInfo: pvInfo,
PublishInfo: pvInfo,
}, nil
}

View File

@ -61,11 +61,11 @@ func TestCreateVolume(t *testing.T) {
}
// Assert
assert.NotNil(actualRes.VolumeInfo)
assert.NotNil(actualRes.Volume)
assert.NotEqual(0, len(actualRes.VolumeInfo.Id), "Volume Id is nil")
assert.NotEqual(0, len(actualRes.Volume.Id), "Volume Id is nil")
assert.Equal(fakeAvailability, actualRes.VolumeInfo.Attributes["availability"])
assert.Equal(fakeAvailability, actualRes.Volume.Attributes["availability"])
}
// Test DeleteVolume
@ -126,7 +126,7 @@ func TestControllerPublishVolume(t *testing.T) {
// Expected Result
expectedRes := &csi.ControllerPublishVolumeResponse{
PublishVolumeInfo: map[string]string{
PublishInfo: map[string]string{
"DevicePath": fakeDevicePath,
},
}

View File

@ -26,7 +26,7 @@ var fakeConfig = "/etc/cloud.conf"
var fakeCtx = context.Background()
var fakeVolName = "CSIVolumeName"
var fakeVolID = "CSIVolumeID"
var fakeVolType = "lvmdriver-1"
var fakeAvailability = "nova"
var fakeVolType = ""
var fakeAvailability = ""
var fakeDevicePath = "/dev/xxx"
var fakeTargetPath = "/mnt/cinder"

View File

@ -31,7 +31,7 @@ type nodeServer struct {
*csicommon.DefaultNodeServer
}
func (ns *nodeServer) GetNodeID(ctx context.Context, req *csi.GetNodeIDRequest) (*csi.GetNodeIDResponse, error) {
func (ns *nodeServer) NodeGetId(ctx context.Context, req *csi.NodeGetIdRequest) (*csi.NodeGetIdResponse, error) {
// Get Mount Provider
m, err := mount.GetMountProvider()
@ -47,20 +47,20 @@ func (ns *nodeServer) GetNodeID(ctx context.Context, req *csi.GetNodeIDRequest)
}
if len(nodeID) > 0 {
return &csi.GetNodeIDResponse{
return &csi.NodeGetIdResponse{
NodeId: nodeID,
}, nil
}
// Using default function
return ns.DefaultNodeServer.GetNodeID(ctx, req)
return ns.DefaultNodeServer.NodeGetId(ctx, req)
}
func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
targetPath := req.GetTargetPath()
fsType := req.GetVolumeCapability().GetMount().GetFsType()
devicePath := req.GetPublishVolumeInfo()["DevicePath"]
devicePath := req.GetPublishInfo()["DevicePath"]
// Get Mount Provider
m, err := mount.GetMountProvider()

View File

@ -35,8 +35,8 @@ func init() {
}
}
// Test GetNodeID
func TestGetNodeID(t *testing.T) {
// Test NodeGetId
func TestNodeGetId(t *testing.T) {
// mock MountMock
mmock := new(mount.MountMock)
@ -48,19 +48,19 @@ func TestGetNodeID(t *testing.T) {
assert := assert.New(t)
// Expected Result
expectedRes := &csi.GetNodeIDResponse{
expectedRes := &csi.NodeGetIdResponse{
NodeId: fakeNodeID,
}
// Fake request
fakeReq := &csi.GetNodeIDRequest{
fakeReq := &csi.NodeGetIdRequest{
Version: &version,
}
// Invoke GetNodeID
actualRes, err := fakeNs.GetNodeID(fakeCtx, fakeReq)
// Invoke NodeGetId
actualRes, err := fakeNs.NodeGetId(fakeCtx, fakeReq)
if err != nil {
t.Errorf("failed to GetNodeID: %v", err)
t.Errorf("failed to NodeGetId: %v", err)
}
// Assert
@ -88,12 +88,12 @@ func TestNodePublishVolume(t *testing.T) {
// Fake request
fakeReq := &csi.NodePublishVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
PublishVolumeInfo: map[string]string{"DevicePath": fakeDevicePath},
TargetPath: fakeTargetPath,
VolumeCapability: nil,
Readonly: false,
Version: &version,
VolumeId: fakeVolID,
PublishInfo: map[string]string{"DevicePath": fakeDevicePath},
TargetPath: fakeTargetPath,
VolumeCapability: nil,
Readonly: false,
}
// Invoke NodePublishVolume

View File

@ -90,6 +90,11 @@ func (cs *DefaultControllerServer) ControllerProbe(ctx context.Context, req *csi
func (cs *DefaultControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
glog.V(5).Infof("Using default ControllerGetCapabilities")
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
return &csi.ControllerGetCapabilitiesResponse{
Capabilities: cs.Driver.cap,
}, nil

View File

@ -33,10 +33,10 @@ const (
var (
fakeVersion = csi.Version{Major: 5, Minor: 2, Patch: 0}
fakeVersionsSupported = []*csi.Version{
&csi.Version{
{
Major: 4, Minor: 0, Patch: 0,
},
&csi.Version{
{
Major: 4, Minor: 1, Patch: 0,
},
}
@ -45,10 +45,10 @@ var (
func NewFakeDriver() *CSIDriver {
fakeVersion = csi.Version{Major: 5, Minor: 2, Patch: 0}
fakeVersionsSupported = []*csi.Version{
&csi.Version{
{
Major: 4, Minor: 0, Patch: 0,
},
&csi.Version{
{
Major: 4, Minor: 1, Patch: 0,
},
}

View File

@ -44,15 +44,15 @@ func (ns *DefaultNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.N
return nil, status.Error(codes.Unimplemented, "")
}
func (ns *DefaultNodeServer) GetNodeID(ctx context.Context, req *csi.GetNodeIDRequest) (*csi.GetNodeIDResponse, error) {
glog.V(5).Infof("Using default GetNodeID")
func (ns *DefaultNodeServer) NodeGetId(ctx context.Context, req *csi.NodeGetIdRequest) (*csi.NodeGetIdResponse, error) {
glog.V(5).Infof("Using default NodeGetId")
err := ns.Driver.CheckVersion(req.GetVersion())
if err != nil {
return nil, err
}
return &csi.GetNodeIDResponse{
return &csi.NodeGetIdResponse{
NodeId: ns.Driver.nodeID,
}, nil
}
@ -76,5 +76,15 @@ func (ns *DefaultNodeServer) NodeGetCapabilities(ctx context.Context, req *csi.N
return nil, err
}
return &csi.NodeGetCapabilitiesResponse{}, nil
return &csi.NodeGetCapabilitiesResponse{
Capabilities: []*csi.NodeServiceCapability{
{
Type: &csi.NodeServiceCapability_Rpc{
Rpc: &csi.NodeServiceCapability_RPC{
Type: csi.NodeServiceCapability_RPC_UNKNOWN,
},
},
},
},
}, nil
}

View File

@ -26,21 +26,21 @@ import (
"google.golang.org/grpc/status"
)
func TestGetNodeID(t *testing.T) {
func TestNodeGetId(t *testing.T) {
d := NewFakeDriver()
ns := NewDefaultNodeServer(d)
// Test invalid request
req := csi.GetNodeIDRequest{}
_, err := ns.GetNodeID(context.Background(), &req)
req := csi.NodeGetIdRequest{}
_, err := ns.NodeGetId(context.Background(), &req)
s, ok := status.FromError(err)
assert.True(t, ok)
assert.Equal(t, s.Code(), codes.InvalidArgument)
// Test valid request
req.Version = &fakeVersion
resp, err := ns.GetNodeID(context.Background(), &req)
resp, err := ns.NodeGetId(context.Background(), &req)
assert.NoError(t, err)
assert.Equal(t, resp.GetNodeId(), fakeNodeID)
}

View File

@ -41,7 +41,7 @@ func GetVersionString(v *csi.Version) string {
}
func GetVersionFromString(v string) (*csi.Version, error) {
var major, minor, patch uint32
var major, minor, patch int32
n, err := fmt.Sscanf(v, "%d.%d.%d", &major, &minor, &patch)
if err != nil {

View File

@ -31,9 +31,9 @@ func TestGetVersionFromString(t *testing.T) {
v, err := GetVersionFromString("1.2.3")
assert.NoError(t, err)
assert.Equal(t, v.GetMajor(), uint32(1))
assert.Equal(t, v.GetMinor(), uint32(2))
assert.Equal(t, v.GetPatch(), uint32(3))
assert.Equal(t, v.GetMajor(), int32(1))
assert.Equal(t, v.GetMinor(), int32(2))
assert.Equal(t, v.GetPatch(), int32(3))
// Invalid version
_, err = GetVersionFromString("1.2")

View File

@ -4,39 +4,39 @@
### Start Flexvolume adapter for simple nfs flexvolume driver
```
$ sudo ../_output/flexadapter --endpoint tcp://127.0.0.1:10000 --drivername simplenfs --driverpath ./examples/simple-nfs-flexdriver/nfs --nodeid CSINode
$ sudo ./_output/flexadapter --endpoint tcp://127.0.0.1:10000 --drivername simplenfs --driverpath ./pkg/flexadapter/examples/simplenfs-flexdriver/driver/nfs --nodeid CSINode -v=5
```
### Test using csc
Get ```csc``` tool from https://github.com/chakri-nelluri/gocsi/tree/master/csc
Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
#### Get plugin info
```
$ csc identity plugininfo --endpoint tcp://127.0.0.1:10000
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"simplenfs" "0.1.0"
```
### Get supported versions
```
$ csc identity supportedversions --endpoint tcp://127.0.0.1:10000
$ csc identity supported-versions --endpoint tcp://127.0.0.1:10000
0.1.0
```
#### NodePublish a volume
```
$ csc node publishvolume --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=a.b.c.d --attrib share=nfs_share nfstestvol
$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=a.b.c.d --attrib share=nfs_share nfstestvol
nfstestvol
```
#### NodeUnpublish a volume
```
$ csc node unpublishvolume --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
nfstestvol
```
#### Get NodeID
```
$ csc node getid --endpoint tcp://127.0.0.1:10000
$ csc node get-id --endpoint tcp://127.0.0.1:10000
CSINode
```

View File

@ -32,6 +32,7 @@ const (
)
type controllerServer struct {
flexDriver *flexVolumeDriver
*csicommon.DefaultControllerServer
}
@ -44,9 +45,14 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
return nil, err
}
call := GetFlexAdapter().flexDriver.NewDriverCall(attachCmd)
cap := req.GetVolumeCapability()
fsType := "ext4"
if cap != nil {
mount := req.GetVolumeCapability().GetMount()
fsType = mount.FsType
}
fsType := req.GetVolumeCapability().GetMount().FsType
call := cs.flexDriver.NewDriverCall(attachCmd)
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
call.Append(req.GetNodeId())
@ -62,7 +68,7 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
pvInfo[deviceID] = callStatus.DevicePath
return &csi.ControllerPublishVolumeResponse{
PublishVolumeInfo: pvInfo,
PublishInfo: pvInfo,
}, nil
}
@ -71,7 +77,7 @@ func (cs *controllerServer) ControllerUnpublishVolume(ctx context.Context, req *
return nil, err
}
call := GetFlexAdapter().flexDriver.NewDriverCall(detachCmd)
call := cs.flexDriver.NewDriverCall(detachCmd)
call.Append(req.GetVolumeId())
call.Append(req.GetNodeId())

View File

@ -18,7 +18,6 @@ package flexadapter
import (
"os"
"sync"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
@ -39,8 +38,6 @@ type flexAdapter struct {
}
var (
adapter *flexAdapter
runOnce sync.Once
version = csi.Version{
Minor: 1,
}
@ -50,15 +47,13 @@ func GetSupportedVersions() []*csi.Version {
return []*csi.Version{&version}
}
func GetFlexAdapter() *flexAdapter {
runOnce.Do(func() {
adapter = &flexAdapter{}
})
return adapter
func New() *flexAdapter {
return &flexAdapter{}
}
func NewControllerServer(d *csicommon.CSIDriver) *controllerServer {
func NewControllerServer(d *csicommon.CSIDriver, f *flexVolumeDriver) *controllerServer {
return &controllerServer{
flexDriver: f,
DefaultControllerServer: csicommon.NewDefaultControllerServer(d),
}
}
@ -76,22 +71,22 @@ func (f *flexAdapter) Run(driverName, driverPath, nodeID, endpoint string) {
glog.Infof("Driver: %v version: %v", driverName, GetVersionString(&version))
// Create flex volume driver
adapter.flexDriver, err = NewFlexVolumeDriver(driverName, driverPath)
f.flexDriver, err = NewFlexVolumeDriver(driverName, driverPath)
if err != nil {
glog.Errorf("Failed to initialize flex volume driver, error: %v", err.Error())
os.Exit(1)
}
// Initialize default library driver
adapter.driver = csicommon.NewCSIDriver(driverName, &version, GetSupportedVersions(), nodeID)
if adapter.flexDriver.capabilities.Attach {
adapter.driver.AddControllerServiceCapabilities([]csi.ControllerServiceCapability_RPC_Type{csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME})
f.driver = csicommon.NewCSIDriver(driverName, &version, GetSupportedVersions(), nodeID)
if f.flexDriver.capabilities.Attach {
f.driver.AddControllerServiceCapabilities([]csi.ControllerServiceCapability_RPC_Type{csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME})
}
adapter.driver.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER})
f.driver.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER})
// Create GRPC servers
f.ns = NewNodeServer(adapter.driver, adapter.flexDriver)
f.cs = NewControllerServer(adapter.driver)
f.ns = NewNodeServer(f.driver, f.flexDriver)
f.cs = NewControllerServer(f.driver, f.flexDriver)
csicommon.RunControllerandNodePublishServer(endpoint, adapter.driver, f.cs, f.ns)
csicommon.RunControllerandNodePublishServer(endpoint, f.driver, f.cs, f.ns)
}

View File

@ -58,8 +58,6 @@ func NewFlexVolumeDriver(driverName, driverPath string) (*flexVolumeDriver, erro
execPath: driverPath,
}
adapter.flexDriver = flexDriver
// Initialize the plugin and probe the capabilities
call := flexDriver.NewDriverCall(initCmd)
ds, err := call.Run()

View File

@ -46,7 +46,37 @@ func mountDevice(devicePath, targetPath, fsType string, readOnly bool, mountOpti
diskMounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOsExec()}
return diskMounter.FormatAndMount(deviceID, targetPath, fsType, options)
return diskMounter.FormatAndMount(devicePath, targetPath, fsType, options)
}
func (ns *nodeServer) waitForAttach(req *csi.NodePublishVolumeRequest, fsType string) error {
var dID string
if req.GetPublishInfo() != nil {
var ok bool
dID, ok = req.GetPublishInfo()[deviceID]
if !ok {
return status.Error(codes.InvalidArgument, "Missing device ID")
}
} else {
return status.Error(codes.InvalidArgument, "Missing publish info and device ID")
}
call := ns.flexDriver.NewDriverCall(waitForAttachCmd)
call.Append(dID)
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
_, err := call.Run()
if isCmdNotSupportedErr(err) {
return nil
}
if err != nil {
status.Error(codes.Internal, err.Error())
}
return nil
}
func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
@ -70,11 +100,24 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
return &csi.NodePublishVolumeResponse{}, nil
}
call := GetFlexAdapter().flexDriver.NewDriverCall(mountCmd)
var call *DriverCall
// Attachable driver.
if ns.flexDriver.capabilities.Attach {
err = ns.waitForAttach(req, fsType)
if err != nil {
return nil, err
}
call = ns.flexDriver.NewDriverCall(mountDeviceCmd)
} else {
call = ns.flexDriver.NewDriverCall(mountCmd)
}
call.Append(req.GetTargetPath())
if req.GetPublishVolumeInfo() != nil {
call.Append(req.GetPublishVolumeInfo()[deviceID])
if req.GetPublishInfo() != nil {
call.Append(req.GetPublishInfo()[deviceID])
}
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
@ -98,7 +141,12 @@ func unmountDevice(path string) error {
func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
call := GetFlexAdapter().flexDriver.NewDriverCall(unmountCmd)
var call *DriverCall
if ns.flexDriver.capabilities.Attach {
call = ns.flexDriver.NewDriverCall(unmountDeviceCmd)
} else {
call = ns.flexDriver.NewDriverCall(unmountCmd)
}
call.Append(req.GetTargetPath())
_, err := call.Run()
@ -109,5 +157,6 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
return nil, status.Error(codes.Internal, err.Error())
}
// WaitForDetach is ignored in current K8S plugins
return &csi.NodeUnpublishVolumeResponse{}, nil
}

View File

@ -0,0 +1,64 @@
# CSI Hostpath driver
## Usage:
### Build hostpathplugin
```
$ make hostpath
```
### Start Hostpath driver
```
$ sudo ./_output/hostpathplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
```
### Test using csc
Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
#### Get plugin info
```
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"csi-hostpath" "0.1.0"
```
#### Get supported versions
```
$ csc identity supported-versions --endpoint tcp://127.0.0.1:10000
0.1.0
```
#### Create a volume
```
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName
CSIVolumeID
```
#### Delete a volume
```
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
CSIVolumeID
```
#### Validate volume capabilities
```
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
CSIVolumeID true
```
#### NodePublish a volume
```
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```
#### NodeUnpublish a volume
```
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```
#### Get NodeID
```
$ csc node get-id --endpoint tcp://127.0.0.1:10000
CSINode
```

View File

@ -23,6 +23,8 @@ import (
"github.com/golang/glog"
"github.com/pborman/uuid"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/kubernetes-csi/drivers/pkg/csi-common"
@ -42,6 +44,18 @@ func GetVersionString(ver *csi.Version) string {
}
func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
if len(req.GetName()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Name missing in request")
}
if req.GetVolumeCapabilities() == nil {
return nil, status.Error(codes.InvalidArgument, "Volume Capabilities missing in request")
}
if err := cs.Driver.ValidateControllerServiceRequest(req.Version, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil {
glog.V(3).Infof("invalid create volume req: %v", req)
return nil, err
@ -55,13 +69,22 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
}
glog.V(4).Infof("create volume %s", path)
return &csi.CreateVolumeResponse{
VolumeInfo: &csi.VolumeInfo{
Volume: &csi.Volume{
Id: volumeId,
},
}, nil
}
func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
if len(req.GetVolumeId()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
}
if err := cs.Driver.ValidateControllerServiceRequest(req.Version, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil {
glog.V(3).Infof("invalid delete volume req: %v", req)
return nil, err
@ -75,6 +98,18 @@ func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
}
func (cs *controllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
if len(req.GetVolumeId()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
}
if req.GetVolumeCapabilities() == nil {
return nil, status.Error(codes.InvalidArgument, "Volume capabilities missing in request")
}
for _, cap := range req.VolumeCapabilities {
if cap.GetAccessMode().GetMode() != csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER {
return &csi.ValidateVolumeCapabilitiesResponse{Supported: false, Message: ""}, nil

View File

@ -37,7 +37,7 @@ type hostPath struct {
var (
hostPathDriver *hostPath
version = csi.Version{
Minor: 1,
Minor: 2,
}
)
@ -72,6 +72,9 @@ func (hp *hostPath) Run(driverName, nodeID, endpoint string) {
// Initialize default library driver
hp.driver = csicommon.NewCSIDriver(driverName, &version, GetSupportedVersions(), nodeID)
if hp.driver == nil {
glog.Fatalln("Failed to initialize CSI Driver.")
}
hp.driver.AddControllerServiceCapabilities([]csi.ControllerServiceCapability_RPC_Type{csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME})
hp.driver.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER})

View File

@ -35,6 +35,21 @@ type nodeServer struct {
}
func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
if req.GetVolumeCapability() == nil {
return nil, status.Error(codes.InvalidArgument, "Volume capability missing in request")
}
if len(req.GetVolumeId()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
}
if len(req.GetTargetPath()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Target path missing in request")
}
targetPath := req.GetTargetPath()
notMnt, err := mount.New("").IsLikelyNotMountPoint(targetPath)
if err != nil {
@ -55,8 +70,8 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
fsType := req.GetVolumeCapability().GetMount().GetFsType()
deviceId := ""
if req.GetPublishVolumeInfo() != nil {
deviceId = req.GetPublishVolumeInfo()[deviceID]
if req.GetPublishInfo() != nil {
deviceId = req.GetPublishInfo()[deviceID]
}
readOnly := req.GetReadonly()
@ -81,5 +96,17 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
}
func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
// Check arguments
if req.GetVersion() == nil {
return nil, status.Error(codes.InvalidArgument, "Version missing in request")
}
if len(req.GetVolumeId()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
}
if len(req.GetTargetPath()) == 0 {
return nil, status.Error(codes.InvalidArgument, "Target path missing in request")
}
return &csi.NodeUnpublishVolumeResponse{}, nil
}

View File

@ -4,11 +4,11 @@
### Start ISCSI driver
```
$ sudo ../_output/iscsidriver --endpoint tcp://127.0.0.1:10000 --nodeid CSINode
$ sudo ./_output/iscsidriver --endpoint tcp://127.0.0.1:10000 --nodeid CSINode
```
### Test using csc
Get ```csc``` tool from https://github.com/chakri-nelluri/gocsi/tree/master/csc
Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
#### Get plugin info
```

View File

@ -28,9 +28,14 @@ Please update the NFS Server & share information in nginx.yaml file.
## Using CSC tool
### Build nfsplugin
```
$ make nfs
```
### Start NFS driver
```
$ sudo ../../_output/flexadapter --endpoint tcp://127.0.0.1:10000 --drivername simplenfs --driverpath ./examples/simplenfs-flexdriver/driver/nfs --nodeid CSINode -v=3
$ sudo ./_output/nfsplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
```
## Test
@ -38,13 +43,13 @@ Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
#### Get plugin info
```
$ csc identity plugininfo --endpoint tcp://127.0.0.1:10000
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"NFS" "0.1.0"
```
### Get supported versions
```
$ csc identity supportedversions --endpoint tcp://127.0.0.1:10000
$ csc identity supported-versions --endpoint tcp://127.0.0.1:10000
0.1.0
```
@ -52,19 +57,19 @@ $ csc identity supportedversions --endpoint tcp://127.0.0.1:10000
```
$ export NFS_SERVER="Your Server IP (Ex: 10.10.10.10)"
$ export NFS_SHARE="Your NFS share"
$ csc node publishvolume --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=$NFS_SERVER --attrib share=$NFS_SHARE nfstestvol
$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=$NFS_SERVER --attrib share=$NFS_SHARE nfstestvol
nfstestvol
```
#### NodeUnpublish a volume
```
$ csc node unpublishvolume --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
nfstestvol
```
#### Get NodeID
```
$ csc node getid --endpoint tcp://127.0.0.1:10000
$ csc node get-id --endpoint tcp://127.0.0.1:10000
CSINode
```

View File

@ -43,7 +43,7 @@ spec:
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: nfs
image: docker.io/k8s/nfsplugin:v0.1
image: docker.io/k8scsi/nfsplugin:v0.1
args :
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"

View File

@ -37,7 +37,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: docker.io/k8s/nfsplugin:v0.1
image: docker.io/k8scsi/nfsplugin:v0.1
args :
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"

View File

@ -59,7 +59,7 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
}
s := req.GetVolumeAttributes()["server"]
ep := req.GetVolumeAttributes()["exportPath"]
ep := req.GetVolumeAttributes()["share"]
source := fmt.Sprintf("%s:%s", s, ep)
mounter := mount.New("")