From 327fc272e6ccdaa835fadda5013a05097e3011f3 Mon Sep 17 00:00:00 2001 From: Krish Chowdhary Date: Wed, 14 Oct 2020 15:12:55 -0400 Subject: [PATCH 1/2] adds deployment configuration for the CSI driver --- .gitignore | 2 +- Dockerfile | 7 ++ Makefile | 6 + cmd/cmd.go | 11 +- cmd/driver.go | 27 ++--- deploy/csi-cosi.properties | 4 + deploy/kustomizeconfig.yaml | 25 ++++ deploy/ns.yaml | 4 + deploy/rbac.yaml | 72 +++++++++++ deploy/workloads.yaml | 233 +++++++++++++++++++++++++++++++++++ go.mod | 5 +- go.sum | 48 ++++++-- kustomization.yaml | 50 ++++++++ pkg/identity/identity.go | 2 +- pkg/node/node.go | 235 ++++++++++++++++++++++-------------- pkg/node/provisioner.go | 2 +- 16 files changed, 603 insertions(+), 130 deletions(-) create mode 100644 Dockerfile create mode 100644 deploy/csi-cosi.properties create mode 100644 deploy/kustomizeconfig.yaml create mode 100644 deploy/ns.yaml create mode 100644 deploy/rbac.yaml create mode 100644 deploy/workloads.yaml create mode 100644 kustomization.yaml diff --git a/.gitignore b/.gitignore index 3ce5adb..331c58f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .idea -vendor +vendor \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..43c81f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM golang:1.14 as builder + +WORKDIR /go/src/github.com/container-object-storage-interface/ephemeral-csi-driver + +ADD ./bin/main /go/src/github.com/container-object-storage-interface/ephemeral-csi-driver/bin/main + +ENTRYPOINT ["./bin/main"] diff --git a/Makefile b/Makefile index 27f981f..fcb5aea 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ build: go build -o bin/main main.go + +docker: build + docker build --tag quay.io/krishchow/ephemeral-csi-driver:v0.06 . + +push: docker + docker push quay.io/krishchow/ephemeral-csi-driver:v0.06 \ No newline at end of file diff --git a/cmd/cmd.go b/cmd/cmd.go index 0fa2c00..289cb17 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -34,7 +34,6 @@ var ( nodeID = "" protocol = "" listen = "" - basePath = "" //endpoint = "unix://csi/csi.sock" ) @@ -46,12 +45,11 @@ var driverCmd = &cobra.Command{ RunE: func(c *cobra.Command, args []string) error { return driver(args) }, - Version: Version, } func init() { - if driverCmd.Version == "" { - driverCmd.Version = "dev" + if Version == "" { + Version = "dev" } viper.AutomaticEnv() @@ -63,9 +61,8 @@ func init() { driverCmd.PersistentFlags().StringVarP(&identity, "identity", "i", identity, "identity of this COSI CSI driver") //driverCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", endpoint, "endpoint at which COSI CSI driver is listening") driverCmd.PersistentFlags().StringVarP(&nodeID, "node-id", "n", nodeID, "identity of the node in which COSI CSI driver is running") - driverCmd.PersistentFlags().StringVarP(&listen, "listen", "l", nodeID, "address of the listening socket for the node server") - driverCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", nodeID, "must be one of tcp, tcp4, tcp6, unix, unixpacket") - driverCmd.PersistentFlags().StringVarP(&basePath, "basepath", "p", nodeID, "the base path for the CSI driver") + driverCmd.PersistentFlags().StringVarP(&listen, "listen", "l", listen, "address of the listening socket for the node server") + driverCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", protocol, "must be one of tcp, tcp4, tcp6, unix, unixpacket") driverCmd.PersistentFlags().MarkHidden("alsologtostderr") driverCmd.PersistentFlags().MarkHidden("log_backtrace_at") diff --git a/cmd/driver.go b/cmd/driver.go index 2bd5174..e863c7d 100644 --- a/cmd/driver.go +++ b/cmd/driver.go @@ -17,13 +17,13 @@ limitations under the License. package cmd import ( - "net" + "github.com/container-object-storage-interface/ephemeral-csi-driver/pkg/controller" "os" cs "github.com/container-object-storage-interface/api/clientset/typed/objectstorage.k8s.io/v1alpha1" - "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/glog" - "google.golang.org/grpc" + csicommon "github.com/kubernetes-csi/drivers/pkg/csi-common" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/klog" @@ -48,23 +48,14 @@ func driver(args []string) error { config := &rest.Config{} client := cs.NewForConfigOrDie(config) + kube := kubernetes.NewForConfigOrDie(config) - node.Initalize(basePath) - node := node.NewNodeServer(identity, nodeID, *client) - if err != nil { - return err - } + nodeServer := node.NewNodeServer(identity, nodeID, *client, kube) + controllerServer, err := controller.NewControllerServer(identity, nodeID) - srv := grpc.NewServer() - csi.RegisterNodeServer(srv, node) - csi.RegisterIdentityServer(srv, idServer) - l, err := net.Listen(protocol, listen) - if err != nil { - klog.Fatalf("could not create listener: %v", err) - } - if err = srv.Serve(l); err != nil { - klog.Fatalf("%v", err) - } + s := csicommon.NewNonBlockingGRPCServer() + s.Start(listen, idServer, controllerServer, nodeServer) + s.Wait() return nil } \ No newline at end of file diff --git a/deploy/csi-cosi.properties b/deploy/csi-cosi.properties new file mode 100644 index 0000000..c832fea --- /dev/null +++ b/deploy/csi-cosi.properties @@ -0,0 +1,4 @@ +VERSION=v0.06 +KUBELET_DIR_PATH=/var/lib/kubelet +CSI_COSI_REPOSITORY_ORG=quay.io/krishchow +CSI_COSI_REPOSITORY_IMAGE=ephemeral-csi-driver \ No newline at end of file diff --git a/deploy/kustomizeconfig.yaml b/deploy/kustomizeconfig.yaml new file mode 100644 index 0000000..b5c30ce --- /dev/null +++ b/deploy/kustomizeconfig.yaml @@ -0,0 +1,25 @@ +varReference: + - path: data/VERSION + kind: ConfigMap + - path: spec/template/spec/volumes/hostPath/path + kind: DaemonSet + - path: spec/selector/matchLabels + kind: DaemonSet + - path: spec/template/metadata/labels + kind: DaemonSet + - path: spec/template/spec/containers/image + kind: DaemonSet + - path: spec/template/spec/containers/terminationMessagePath + kind: DaemonSet + - path: spec/template/spec/volumes/hostPath/path + kind: Deployment + - path: spec/selector/matchLabels + kind: Deployment + - path: spec/template/metadata/labels + kind: Deployment + - path: spec/template/spec/containers/image + kind: Deployment + - path: spec/template/spec/containers/terminationMessagePath + kind: Deployment + - path: spec/selector + kind: Service diff --git a/deploy/ns.yaml b/deploy/ns.yaml new file mode 100644 index 0000000..9223984 --- /dev/null +++ b/deploy/ns.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: cosi diff --git a/deploy/rbac.yaml b/deploy/rbac.yaml new file mode 100644 index 0000000..3002538 --- /dev/null +++ b/deploy/rbac.yaml @@ -0,0 +1,72 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: csi-cosi-driver + namespace: cosi +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + name: csi-cosi-driver +rules: + # The following rule should be uncommented for plugins that require secrets + # for provisioning. + # - apiGroups: [""] + # resources: ["secrets"] + # verbs: ["get", "list"] + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "delete"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["get", "list"] + - apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["endpoints"] + verbs: ["get", "watch", "list", "delete", "update", "create"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] + - apiGroups: ["driver.objectstorage.k8s.io"] + resources: ["volumes"] + verbs: ["get", "watch", "list", "delete", "update", "create"] + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["create","get", "watch", "list", "delete", "update"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + name: csi-cosi-driver +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: csi-cosi-driver +subjects: + - kind: ServiceAccount + name: csi-cosi-driver + namespace: cosi diff --git a/deploy/workloads.yaml b/deploy/workloads.yaml new file mode 100644 index 0000000..ba13bff --- /dev/null +++ b/deploy/workloads.yaml @@ -0,0 +1,233 @@ +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + name: driver.objectstorage.k8s.io + namespace: cosi +spec: + volumeLifecycleModes: + - Persistent + - Ephemeral + podInfoOnMount: false + attachRequired: false +--- +apiVersion: v1 +kind: Secret +metadata: + name: csi-cosi-driver + namespace: cosi +data: + key: none +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: driver.objectstorage.k8s.io +provisioner: driver.objectstorage.k8s.io +parameters: + disable.csi.storage.k8s.io/provisioner-secret-name: csi-cosi-driver + disable.csi.storage.k8s.io/provisioner-secret-namespace: default + disable.csi.storage.k8s.io/fstype: xfs +--- +kind: Service +apiVersion: v1 +metadata: + name: csi-cosi-driver + namespace: cosi + labels: + app: csi-cosi-driver +spec: + selector: + app: csi-cosi-driver + ports: + - name: unused + port: 12345 +--- +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: csi-cosi-driver + namespace: cosi +spec: + selector: + matchLabels: + app: csi-cosi-driver + template: + metadata: + labels: + app: csi-cosi-driver + spec: + serviceAccountName: csi-cosi-driver + containers: + - name: node-driver-registrar + image: quay.io/k8scsi/csi-node-driver-registrar:v1.3.0 + args: + - --v=5 + - --csi-address=/csi/csi.sock + - --kubelet-registration-path=$(KUBELET_DIR_PATH)/plugins/csi-cosi-driver/csi.sock + securityContext: + # This is necessary only for systems with SELinux, where + # non-privileged sidecar containers cannot access unix domain socket + # created by privileged CSI driver container. + privileged: true + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + volumeMounts: + - mountPath: /csi + name: socket-dir + - mountPath: /registration + name: registration-dir + terminationMessagePolicy: FallbackToLogsOnError + terminationMessagePath: /driver-registrar-termination-log + - name: csi-cosi-driver + image: $(REPOSITORY_ORG)/$(REPOSITORY_IMAGE):$(VERSION) + imagePullPolicy: "Always" + args: + - "--identity=driver.objectstorage.k8s.io" + - "--v=5" + - "--listen=$(CSI_ENDPOINT)" + - "--node-id=$(KUBE_NODE_NAME)" + - "--protocol=unix" + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + securityContext: + privileged: true + terminationMessagePolicy: FallbackToLogsOnError + terminationMessagePath: /driver-termination-log + ports: + - containerPort: 9898 + name: healthz + protocol: TCP + volumeMounts: + - mountPath: /csi + name: socket-dir + - mountPath: $(KUBELET_DIR_PATH)/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: $(KUBELET_DIR_PATH)/plugins + mountPropagation: Bidirectional + name: plugins-dir + - mountPath: /dev + name: dev-dir + volumes: + - hostPath: + path: $(KUBELET_DIR_PATH)/plugins/csi-cosi-driver + type: DirectoryOrCreate + name: socket-dir + - hostPath: + path: $(KUBELET_DIR_PATH)/pods + type: DirectoryOrCreate + name: mountpoint-dir + - hostPath: + path: $(KUBELET_DIR_PATH)/plugins_registry + type: Directory + name: registration-dir + - hostPath: + path: $(KUBELET_DIR_PATH)/plugins + type: Directory + name: plugins-dir + - hostPath: + path: /dev + type: Directory + name: dev-dir +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ephemeral-controller-cosi + namespace: cosi +spec: + replicas: 3 + selector: + matchLabels: + app: ephemeral-controller-cosi + template: + metadata: + labels: + app: ephemeral-controller-cosi + spec: + serviceAccountName: csi-cosi-driver + containers: + - name: csi-provisioner + image: quay.io/k8scsi/csi-provisioner:v1.2.1 + args: + - "--v=5" + - "--timeout=300s" + - "--csi-address=$(CSI_ENDPOINT)" + - "--enable-leader-election" + - "--leader-election-type=leases" + - "--feature-gates=Topology=true" + - "--strict-topology" + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + volumeMounts: + - mountPath: /csi + name: socket-dir + - mountPath: /dev + name: dev-dir + terminationMessagePolicy: FallbackToLogsOnError + terminationMessagePath: /tmp/controller-provisioner-termination-log + ports: + - containerPort: 9898 + name: healthz + protocol: TCP + livenessProbe: + failureThreshold: 5 + httpGet: + path: /healthz + port: 9898 + initialDelaySeconds: 10 + timeoutSeconds: 3 + periodSeconds: 2 + - name: ephemeral-controller-cosi + image: $(REPOSITORY_ORG)/$(REPOSITORY_IMAGE):$(VERSION) + imagePullPolicy: "Always" + args: + - "--v=5" + - "--identity=driver.objectstorage.k8s.io" + - "--listen=$(CSI_ENDPOINT)" + - "--node-id=$(KUBE_NODE_NAME)" + - "--protocol=unix" + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + securityContext: + # This is necessary only for systems with SELinux, where + # non-privileged sidecar containers cannot access unix domain socket + # created by privileged CSI driver container. + privileged: true + ports: + - containerPort: 9898 + name: healthz + protocol: TCP + terminationMessagePolicy: FallbackToLogsOnError + terminationMessagePath: /tmp/controller-termination-log + volumeMounts: + - mountPath: /dev + name: dev-dir + - mountPath: /csi + name: socket-dir + volumes: + - hostPath: + path: $(KUBELET_DIR_PATH)/plugins/ephemeral-controller-cosi + type: DirectoryOrCreate + name: socket-dir + - hostPath: + path: /dev + type: Directory + name: dev-dir diff --git a/go.mod b/go.mod index 7aabd14..8c0649b 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,9 @@ require ( github.com/go-openapi/spec v0.19.9 // indirect github.com/go-openapi/swag v0.19.9 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b - github.com/golang/protobuf v1.4.2 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/kubernetes-csi/csi-lib-utils v0.8.1 // indirect + github.com/kubernetes-csi/drivers v1.0.2 github.com/magiconair/properties v1.8.4 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/mitchellh/mapstructure v1.3.3 // indirect @@ -29,7 +30,7 @@ require ( google.golang.org/genproto v0.0.0-20201002142447-3860012362da // indirect google.golang.org/grpc v1.32.0 gopkg.in/ini.v1 v1.61.0 // indirect - k8s.io/api v0.19.2 + k8s.io/api v0.19.2 k8s.io/apimachinery v0.19.2 k8s.io/client-go v0.19.2 k8s.io/klog v1.0.0 diff --git a/go.sum b/go.sum index a8d13e8..cc04ce4 100644 --- a/go.sum +++ b/go.sum @@ -59,7 +59,9 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -69,23 +71,22 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/container-object-storage-interface/api v0.0.0-20200919075357-9eea1b2d66da h1:5e5qwRs0Iu+YdtNyjOvTXcMXxz1ZNGjspyYne3DZaHw= -github.com/container-object-storage-interface/api v0.0.0-20200919075357-9eea1b2d66da/go.mod h1:1b2KgnG4h66Q0skwEmxnrF6yxR9iN3RmawVuX7n/LY4= -github.com/container-object-storage-interface/api v0.0.0-20200921183428-9b976cb5ebaf h1:tfepUC1/hVC6H0/KUG/+CWr0SO8nqfbG5zOhcAZS7GU= -github.com/container-object-storage-interface/api v0.0.0-20200921183428-9b976cb5ebaf/go.mod h1:1b2KgnG4h66Q0skwEmxnrF6yxR9iN3RmawVuX7n/LY4= github.com/container-object-storage-interface/api v0.0.0-20200930202452-38b4abe7b3dc h1:xNUXec+3p7k4VvYIt2C8H/46UzpQ7tFmRJ7nJ/9PfnI= github.com/container-object-storage-interface/api v0.0.0-20200930202452-38b4abe7b3dc/go.mod h1:AGSCVuBrCT8Jm9KlJdMfzHgYsEEyEYKgKQtd2KnTFJ4= +github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/container-storage-interface/spec v1.3.0 h1:wMH4UIoWnK/TXYw8mbcIHgZmB6kHOeIsYsiaTJwa6bc= github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -117,7 +118,6 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v1.1.3 h1:KOKLkEASmIa2roa2xEV6WkADqyWrok5dt3TOMMHF1fE= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.14.2+incompatible h1:uyx8VgUCryEkh7qbr8rEtrA0rGDEJ73F5lOJdB5m3V8= @@ -142,6 +142,7 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= @@ -248,6 +249,7 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -271,8 +273,10 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -324,21 +328,28 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kubernetes-csi/csi-lib-utils v0.8.1 h1:DHFs4MgzjSGF/FH95TEdLVa7R1CCi9UJ76jTUPO8iF0= +github.com/kubernetes-csi/csi-lib-utils v0.8.1/go.mod h1:FZflf0cCYlCquPQxVHa6Tyy0i/so6VAZTiEVK1do7CU= +github.com/kubernetes-csi/drivers v1.0.2 h1:kaEAMfo+W5YFr23yedBIY+NGnNjr6/PbPzx7N4GYgiQ= +github.com/kubernetes-csi/drivers v1.0.2/go.mod h1:V6rHbbSLCZGaQoIZ8MkyDtoXtcKXZM0F7N3bkloDCOY= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -358,6 +369,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -370,6 +382,7 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -380,6 +393,7 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -387,12 +401,14 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -412,6 +428,7 @@ github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prY github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -419,10 +436,12 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -434,7 +453,10 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -473,6 +495,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -652,6 +676,7 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= @@ -689,6 +714,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -725,6 +751,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -795,6 +822,7 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -837,11 +865,13 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -853,6 +883,8 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4 h1:8x49nBRxuXGUlDlwlWd3RMY1SayZrzFfxea3UZSkFw4= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= +k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= +k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= @@ -860,6 +892,7 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc k8s.io/apimachinery v0.18.4 h1:ST2beySjhqwJoIFk6p7Hp5v5O0hYY6Gngq/gUYXTPIA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= +k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= @@ -868,15 +901,14 @@ k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.4 h1:un55V1Q/B3JO3A76eS0kUSywgGK/WR3BQ8fHQjNa6Zc= k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= +k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= -k8s.io/client-go v1.5.1 h1:XaX/lo2/u3/pmFau8HN+sB5C/b4dc4Dmm2eXjBH4p1E= -k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= -k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= +k8s.io/component-base v0.19.0/go.mod h1:dKsY8BxkA+9dZIAh2aWJLL/UdASFDNtGYTCItL4LM7Y= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 0000000..cf2f3e6 --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,50 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: cosi +commonAnnotations: + driver.objectstorage.k8s.io/authors: "The Kubernetes Authors" + driver.objectstorage.k8s.io/license: "Apache-2.0" +commonLabels: + driver.objectstorage.k8s.io/version: $(VERSION) +configMapGenerator: + - name: csi-cosi-config + env: deploy/csi-cosi.properties +generatorOptions: + disableNameSuffixHash: true + labels: + generated-by: "kustomize" +resources: + - deploy/workloads.yaml + - deploy/ns.yaml + - deploy/rbac.yaml +configurations: + - deploy/kustomizeconfig.yaml +vars: + - name: VERSION + objref: + name: csi-cosi-config + kind: ConfigMap + apiVersion: v1 + fieldref: + fieldpath: data.VERSION + - name: KUBELET_DIR_PATH + objref: + name: csi-cosi-config + kind: ConfigMap + apiVersion: v1 + fieldref: + fieldpath: data.KUBELET_DIR_PATH + - name: REPOSITORY_ORG + objref: + name: csi-cosi-config + kind: ConfigMap + apiVersion: v1 + fieldref: + fieldpath: data.CSI_COSI_REPOSITORY_ORG + - name: REPOSITORY_IMAGE + objref: + name: csi-cosi-config + kind: ConfigMap + apiVersion: v1 + fieldref: + fieldpath: data.CSI_COSI_REPOSITORY_IMAGE diff --git a/pkg/identity/identity.go b/pkg/identity/identity.go index 54acde3..2134381 100644 --- a/pkg/identity/identity.go +++ b/pkg/identity/identity.go @@ -72,7 +72,7 @@ func (i *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.Get } caps := []*csi.PluginCapability{ - serviceCap(csi.PluginCapability_Service_CONTROLLER_SERVICE), + serviceCap(csi.PluginCapability_Service_UNKNOWN), } return &csi.GetPluginCapabilitiesResponse{ diff --git a/pkg/node/node.go b/pkg/node/node.go index f402608..80fc899 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -3,11 +3,14 @@ package node import ( "context" "encoding/json" + "errors" "fmt" "github.com/container-object-storage-interface/api/apis/objectstorage.k8s.io/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" "k8s.io/klog" "k8s.io/utils/mount" "os" @@ -19,13 +22,15 @@ import ( var _ csi.NodeServer = &NodeServer{} const protocolFileName string = `protocolConn.json` +var getError = func(t, n string, e error) error { return fmt.Errorf("failed to get <%s>%s: %v", t, n, e) } -func NewNodeServer(nodeId, driverName string, c cs.ObjectstorageV1alpha1Client) csi.NodeServer { +func NewNodeServer(driverName, nodeID string, c cs.ObjectstorageV1alpha1Client, kube kubernetes.Interface) csi.NodeServer { return &NodeServer{ name: driverName, - nodeID: nodeId, + nodeID: nodeID, cosiClient: c, ctx: context.Background(), + kubeClient: kube, } } @@ -42,122 +47,88 @@ type NodeServer struct { name string nodeID string cosiClient cs.ObjectstorageV1alpha1Client + kubeClient kubernetes.Interface ctx context.Context } -func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { - vID := request.GetVolumeId() - stagingTargetPath := request.GetStagingTargetPath() - - if vID == "" { - return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") - } - - if err := os.MkdirAll(stagingTargetPath, 0755); err != nil { - return nil, status.Errorf(codes.Internal, "Stage Volume Failed: %v", err) +func (n NodeServer) getBAR(barName, barNs string) (*v1alpha1.BucketAccessRequest, error) { + klog.Infof("getting bucketAccessRequest %q", fmt.Sprintf("%s/%s", barNs, barName)) + bar, err := n.cosiClient.BucketAccessRequests(barNs).Get(n.ctx, barName, metav1.GetOptions{}) + if err != nil || bar == nil || !bar.Status.AccessGranted { + return nil, logErr(getError("bucketAccessRequest", fmt.Sprintf("%s/%s", barNs, barName), err)) } - - dir, err := Provision(vID) - if err != nil { - return nil, status.Errorf(codes.Internal, "Stage Volume Provision Failed: %v", err) + if len(bar.Spec.BucketRequestName) == 0 { + return nil, logErr(fmt.Errorf("bucketAccessRequest.Spec.BucketRequestName unset")) } + return bar, nil +} - if err := mount.New("").Mount(dir, stagingTargetPath, "", []string{"bind"}); err != nil { - return nil, status.Errorf(codes.Internal, "Stage Volume Mount Failed: %v", err) +func (n NodeServer) getBA(baName string) (*v1alpha1.BucketAccess, error) { + klog.Infof("getting bucketAccess %q", fmt.Sprintf("%s", baName)) + ba, err := n.cosiClient.BucketAccesses().Get(n.ctx, baName, metav1.GetOptions{}) + if err != nil || ba == nil || !ba.Status.AccessGranted { + return nil, logErr(getError("bucketAccess", fmt.Sprintf("%s", baName), err)) } - - return &csi.NodeStageVolumeResponse{}, nil + return ba, nil } -func (n NodeServer) NodeUnstageVolume(ctx context.Context, request *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { - vID := request.GetVolumeId() - stagingTargetPath := request.GetStagingTargetPath() - - if vID == "" { - return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") +func (n NodeServer) getBR(brName, brNs string) (*v1alpha1.BucketRequest, error) { + klog.Infof("getting bucketRequest %q", brName) + br, err := n.cosiClient.BucketRequests(brNs).Get(n.ctx, brName, metav1.GetOptions{}) + if err != nil || br == nil || !br.Status.BucketAvailable { + return nil, logErr(getError("bucketRequest", fmt.Sprintf("%s/%s", brNs, brName), err)) } + return br, nil +} - if notMnt, err := mount.IsNotMountPoint(mount.New(""), stagingTargetPath); err != nil { - if !os.IsNotExist(err) { - return nil, status.Error(codes.Internal, err.Error()) - } - } else if !notMnt { - // Unmounting the image or filesystem. - err = mount.New("").Unmount(stagingTargetPath) - if err != nil { - return nil, status.Errorf(codes.Internal, "Unstage Unmounting failed: %v", err) - } - } - if err := Unprovision(vID); err != nil { - return nil,status.Errorf(codes.Internal, "Unstage Volume Unprovision failed: %v", err) +func (n NodeServer) getB(bName string) (*v1alpha1.Bucket, error) { + klog.Infof("getting bucket %q", bName) + // is BucketInstanceName the correct field, or should it be BucketClass + bkt, err := n.cosiClient.Buckets().Get(n.ctx, bName, metav1.GetOptions{}) + if err != nil || bkt == nil || !bkt.Status.BucketAvailable { + return nil, logErr(getError("bucket", bName, err)) } + return bkt, nil +} - return &csi.NodeUnstageVolumeResponse{}, nil} - -const ( - barName = "bucketAccessRequestName" - barNamespace = "bucketAccessRequestNamespace" -) +func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { + klog.Infof("NodePublishVolume: volId: %v, targetPath: %v\n", request.GetVolumeId(), request.StagingTargetPath) -func parseValue(key string, ctx map[string]string) (string, error) { - value, ok := ctx[key] - if !ok { - return "", fmt.Errorf("required volume context key unset: %v", key) + name, ns, err := parseVolumeContext(request.VolumeContext) + if err != nil { + return nil, err } - klog.Infof("got value: %v", value) - return value, nil -} -func parseVolumeContext(volCtx map[string]string) (name, ns string, err error) { - klog.Info("parsing bucketAccessRequest namespace/name from volume context") - name, err = parseValue(barName, volCtx) + pod, err := n.kubeClient.CoreV1().Pods(ns).Get(ctx, name, metav1.GetOptions{}) if err != nil { - return "", "", err + return nil, logErr(getError("pod", fmt.Sprintf("%s/%s", ns, name), err)) } - ns, err = parseValue(barNamespace, volCtx) + barName, barNs, err := parsePod(pod, n.name) if err != nil { - return "", "", err + return nil, err } - - return -} - -func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { - klog.Infof("NodePublishVolume: volId: %v, targetPath: %v\n", request.GetVolumeId(), request.GetTargetPath()) - - name, ns, err := parseVolumeContext(request.VolumeContext) + bar, err := n.getBAR(barName, barNs) if err != nil { return nil, err } - - getError := func(t, n string, e error) error { return fmt.Errorf("failed to get <%s>%s: %v", t, n, e) } - - klog.Infof("getting bucketAccessRequest %q", fmt.Sprintf("%s/%s", ns, name)) - bar, err := n.cosiClient.BucketAccessRequests(ns).Get(n.ctx, name, v1.GetOptions{}) - - if err != nil || bar == nil || !bar.Status.AccessGranted { - return nil, logErr(getError("bucketAccessRequest", fmt.Sprintf("%s/%s", ns, name), err)) + ba, err := n.getBA(bar.Spec.BucketAccessName) + if err != nil { + return nil, err } - - if len(bar.Spec.BucketRequestName) == 0 { - return nil, logErr(fmt.Errorf("bucketAccessRequest.Spec.BucketRequestName unset")) + br, err := n.getBR(bar.Spec.BucketRequestName, barNs) + if err != nil { + return nil, err } - - klog.Infof("getting bucketRequest %q", bar.Spec.BucketRequestName) - br, err := n.cosiClient.BucketRequests(bar.Namespace).Get(n.ctx, bar.Spec.BucketRequestName, v1.GetOptions{}) - if err != nil || br == nil || !br.Status.BucketAvailable { - return nil, logErr(getError("bucketRequest", fmt.Sprintf("%s/%s", bar.Namespace, bar.Spec.BucketRequestName), err)) + bkt, err := n.getB(br.Spec.BucketInstanceName) + if err != nil { + return nil, err } - - klog.Infof("getting bucket %q", br.Spec.BucketInstanceName) - // is BucketInstanceName the correct field, or should it be BucketClass - bkt, err := n.cosiClient.Buckets().Get(n.ctx, br.Spec.BucketInstanceName, v1.GetOptions{}) - if err != nil || bkt == nil || !bkt.Status.BucketAvailable { - return nil, logErr(getError("bucket", br.Spec.BucketInstanceName, err)) + secret, err := n.kubeClient.CoreV1().Secrets(barNs).Get(ctx, ba.Spec.MintedSecretName, metav1.GetOptions{}) + if err != nil { + return nil, logErr(getError("pod", fmt.Sprintf("%s/%s", barNs, ba.Spec.MintedSecretName), err)) } - var protocolConnection interface{} switch bkt.Spec.Protocol.ProtocolName { case v1alpha1.ProtocolNameS3: @@ -177,12 +148,16 @@ func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePubl } klog.Infof("bucket %q has protocol %q", bkt.Name, bkt.Spec.Protocol) - protoData, err := json.Marshal(protocolConnection) + data := make(map[string]interface{}) + data["protocol"] = protocolConnection + data["connection"] = secret.Data + + protoData, err := json.Marshal(data) if err != nil { return nil, logErr(fmt.Errorf("error marshalling protocol: %v", err)) } - target := filepath.Join(request.TargetPath, protocolFileName) + target := filepath.Join(request.StagingTargetPath, protocolFileName) klog.Infof("creating conn file: %s", target) f, err := os.Open(target) if err != nil { @@ -193,6 +168,82 @@ func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePubl if err != nil { return nil, logErr(fmt.Errorf("unable to write to file: %v", err)) } + return &csi.NodeStageVolumeResponse{}, nil +} + +func (n NodeServer) NodeUnstageVolume(ctx context.Context, request *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { + panic("implement me") +} + +const ( + podNameKey = "csi.storage.k8s.io/pod.name" + podNamespaceKey = "csi.storage.k8s.io/pod.namespace" + barNameKey = "bar-name" + barNamespaceKey = "bar-namespace" +) + +func parseValue(key string, ctx map[string]string) (string, error) { + value, ok := ctx[key] + if !ok { + return "", fmt.Errorf("required volume context key unset: %v", key) + } + klog.Infof("got value: %v", value) + return value, nil +} + +func parseVolumeContext(volCtx map[string]string) (name, ns string, err error) { + klog.Info("parsing bucketAccessRequest namespace/name from volume context") + + name, err = parseValue(podNameKey, volCtx) + if err != nil { + return "", "", err + } + + ns, err = parseValue(podNamespaceKey, volCtx) + if err != nil { + return "", "", err + } + + return +} + +func parsePod(pod *v1.Pod, driverName string) (name, ns string, err error) { + klog.Info("parsing bucketAccessRequest namespace/name from pod") + + for _, v := range pod.Spec.Volumes { + if v.CSI != nil && v.CSI.Driver == driverName { + name, ok := v.CSI.VolumeAttributes[barNameKey] + if !ok { + return "", "", errors.New("invalid BAR Name") + } + namespace, ok := v.CSI.VolumeAttributes[barNamespaceKey] + if !ok { + return "", "", errors.New("invalid BAR Namespace") + } + return name, namespace, nil + } + } + + return "", "", nil +} + +func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { + vID := request.GetVolumeId() + stagingTargetPath := request.GetStagingTargetPath() + targetPath := request.GetTargetPath() + + if vID == "" { + return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") + } + + if err := os.MkdirAll(targetPath, 0755); err != nil { + return nil, status.Errorf(codes.Internal, "Stage Volume Failed: %v", err) + } + + if err := mount.New("").Mount(stagingTargetPath, targetPath, "", []string{"bind"}); err != nil { + return nil, status.Errorf(codes.Internal, "Stage Volume Mount Failed: %v", err) + } + return &csi.NodePublishVolumeResponse{}, nil } diff --git a/pkg/node/provisioner.go b/pkg/node/provisioner.go index 48699c7..c71739e 100644 --- a/pkg/node/provisioner.go +++ b/pkg/node/provisioner.go @@ -16,7 +16,7 @@ type provision struct { Path string } -func Initalize(path string) { +func Initialize(path string) { provisioner.Path = path } From 67204341869001fd9c6e8d71f70d57eec7f25c82 Mon Sep 17 00:00:00 2001 From: Krish Chowdhary Date: Thu, 15 Oct 2020 13:31:20 -0400 Subject: [PATCH 2/2] removed controller from deployment --- Makefile | 6 +- cmd/cmd.go | 11 +- cmd/driver.go | 27 +++-- deploy/workloads.yaml | 33 ------ go.mod | 5 +- go.sum | 48 ++------ pkg/identity/identity.go | 2 +- pkg/node/node.go | 235 +++++++++++++++------------------------ pkg/node/provisioner.go | 2 +- 9 files changed, 133 insertions(+), 236 deletions(-) diff --git a/Makefile b/Makefile index fcb5aea..e35e652 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ +repository = krishchow +version = v0.1 build: go build -o bin/main main.go docker: build - docker build --tag quay.io/krishchow/ephemeral-csi-driver:v0.06 . + docker build --tag quay.io/$(repository)/ephemeral-csi-driver:$(version) . push: docker - docker push quay.io/krishchow/ephemeral-csi-driver:v0.06 \ No newline at end of file + docker push quay.io/$(repository)/ephemeral-csi-driver:$(version) \ No newline at end of file diff --git a/cmd/cmd.go b/cmd/cmd.go index 289cb17..0fa2c00 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -34,6 +34,7 @@ var ( nodeID = "" protocol = "" listen = "" + basePath = "" //endpoint = "unix://csi/csi.sock" ) @@ -45,11 +46,12 @@ var driverCmd = &cobra.Command{ RunE: func(c *cobra.Command, args []string) error { return driver(args) }, + Version: Version, } func init() { - if Version == "" { - Version = "dev" + if driverCmd.Version == "" { + driverCmd.Version = "dev" } viper.AutomaticEnv() @@ -61,8 +63,9 @@ func init() { driverCmd.PersistentFlags().StringVarP(&identity, "identity", "i", identity, "identity of this COSI CSI driver") //driverCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", endpoint, "endpoint at which COSI CSI driver is listening") driverCmd.PersistentFlags().StringVarP(&nodeID, "node-id", "n", nodeID, "identity of the node in which COSI CSI driver is running") - driverCmd.PersistentFlags().StringVarP(&listen, "listen", "l", listen, "address of the listening socket for the node server") - driverCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", protocol, "must be one of tcp, tcp4, tcp6, unix, unixpacket") + driverCmd.PersistentFlags().StringVarP(&listen, "listen", "l", nodeID, "address of the listening socket for the node server") + driverCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", nodeID, "must be one of tcp, tcp4, tcp6, unix, unixpacket") + driverCmd.PersistentFlags().StringVarP(&basePath, "basepath", "p", nodeID, "the base path for the CSI driver") driverCmd.PersistentFlags().MarkHidden("alsologtostderr") driverCmd.PersistentFlags().MarkHidden("log_backtrace_at") diff --git a/cmd/driver.go b/cmd/driver.go index e863c7d..2bd5174 100644 --- a/cmd/driver.go +++ b/cmd/driver.go @@ -17,13 +17,13 @@ limitations under the License. package cmd import ( - "github.com/container-object-storage-interface/ephemeral-csi-driver/pkg/controller" + "net" "os" cs "github.com/container-object-storage-interface/api/clientset/typed/objectstorage.k8s.io/v1alpha1" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/glog" - csicommon "github.com/kubernetes-csi/drivers/pkg/csi-common" - "k8s.io/client-go/kubernetes" + "google.golang.org/grpc" "k8s.io/client-go/rest" "k8s.io/klog" @@ -48,14 +48,23 @@ func driver(args []string) error { config := &rest.Config{} client := cs.NewForConfigOrDie(config) - kube := kubernetes.NewForConfigOrDie(config) - nodeServer := node.NewNodeServer(identity, nodeID, *client, kube) - controllerServer, err := controller.NewControllerServer(identity, nodeID) + node.Initalize(basePath) + node := node.NewNodeServer(identity, nodeID, *client) + if err != nil { + return err + } - s := csicommon.NewNonBlockingGRPCServer() - s.Start(listen, idServer, controllerServer, nodeServer) - s.Wait() + srv := grpc.NewServer() + csi.RegisterNodeServer(srv, node) + csi.RegisterIdentityServer(srv, idServer) + l, err := net.Listen(protocol, listen) + if err != nil { + klog.Fatalf("could not create listener: %v", err) + } + if err = srv.Serve(l); err != nil { + klog.Fatalf("%v", err) + } return nil } \ No newline at end of file diff --git a/deploy/workloads.yaml b/deploy/workloads.yaml index ba13bff..5fa380e 100644 --- a/deploy/workloads.yaml +++ b/deploy/workloads.yaml @@ -189,39 +189,6 @@ spec: initialDelaySeconds: 10 timeoutSeconds: 3 periodSeconds: 2 - - name: ephemeral-controller-cosi - image: $(REPOSITORY_ORG)/$(REPOSITORY_IMAGE):$(VERSION) - imagePullPolicy: "Always" - args: - - "--v=5" - - "--identity=driver.objectstorage.k8s.io" - - "--listen=$(CSI_ENDPOINT)" - - "--node-id=$(KUBE_NODE_NAME)" - - "--protocol=unix" - env: - - name: CSI_ENDPOINT - value: unix:///csi/csi.sock - - name: KUBE_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - securityContext: - # This is necessary only for systems with SELinux, where - # non-privileged sidecar containers cannot access unix domain socket - # created by privileged CSI driver container. - privileged: true - ports: - - containerPort: 9898 - name: healthz - protocol: TCP - terminationMessagePolicy: FallbackToLogsOnError - terminationMessagePath: /tmp/controller-termination-log - volumeMounts: - - mountPath: /dev - name: dev-dir - - mountPath: /csi - name: socket-dir volumes: - hostPath: path: $(KUBELET_DIR_PATH)/plugins/ephemeral-controller-cosi diff --git a/go.mod b/go.mod index 8c0649b..7aabd14 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,8 @@ require ( github.com/go-openapi/spec v0.19.9 // indirect github.com/go-openapi/swag v0.19.9 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b + github.com/golang/protobuf v1.4.2 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/kubernetes-csi/csi-lib-utils v0.8.1 // indirect - github.com/kubernetes-csi/drivers v1.0.2 github.com/magiconair/properties v1.8.4 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/mitchellh/mapstructure v1.3.3 // indirect @@ -30,7 +29,7 @@ require ( google.golang.org/genproto v0.0.0-20201002142447-3860012362da // indirect google.golang.org/grpc v1.32.0 gopkg.in/ini.v1 v1.61.0 // indirect - k8s.io/api v0.19.2 + k8s.io/api v0.19.2 k8s.io/apimachinery v0.19.2 k8s.io/client-go v0.19.2 k8s.io/klog v1.0.0 diff --git a/go.sum b/go.sum index cc04ce4..a8d13e8 100644 --- a/go.sum +++ b/go.sum @@ -59,9 +59,7 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -71,22 +69,23 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/container-object-storage-interface/api v0.0.0-20200919075357-9eea1b2d66da h1:5e5qwRs0Iu+YdtNyjOvTXcMXxz1ZNGjspyYne3DZaHw= +github.com/container-object-storage-interface/api v0.0.0-20200919075357-9eea1b2d66da/go.mod h1:1b2KgnG4h66Q0skwEmxnrF6yxR9iN3RmawVuX7n/LY4= +github.com/container-object-storage-interface/api v0.0.0-20200921183428-9b976cb5ebaf h1:tfepUC1/hVC6H0/KUG/+CWr0SO8nqfbG5zOhcAZS7GU= +github.com/container-object-storage-interface/api v0.0.0-20200921183428-9b976cb5ebaf/go.mod h1:1b2KgnG4h66Q0skwEmxnrF6yxR9iN3RmawVuX7n/LY4= github.com/container-object-storage-interface/api v0.0.0-20200930202452-38b4abe7b3dc h1:xNUXec+3p7k4VvYIt2C8H/46UzpQ7tFmRJ7nJ/9PfnI= github.com/container-object-storage-interface/api v0.0.0-20200930202452-38b4abe7b3dc/go.mod h1:AGSCVuBrCT8Jm9KlJdMfzHgYsEEyEYKgKQtd2KnTFJ4= -github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/container-storage-interface/spec v1.3.0 h1:wMH4UIoWnK/TXYw8mbcIHgZmB6kHOeIsYsiaTJwa6bc= github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -118,6 +117,7 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v1.1.3 h1:KOKLkEASmIa2roa2xEV6WkADqyWrok5dt3TOMMHF1fE= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.14.2+incompatible h1:uyx8VgUCryEkh7qbr8rEtrA0rGDEJ73F5lOJdB5m3V8= @@ -142,7 +142,6 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= @@ -249,7 +248,6 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -273,10 +271,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -328,28 +324,21 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kubernetes-csi/csi-lib-utils v0.8.1 h1:DHFs4MgzjSGF/FH95TEdLVa7R1CCi9UJ76jTUPO8iF0= -github.com/kubernetes-csi/csi-lib-utils v0.8.1/go.mod h1:FZflf0cCYlCquPQxVHa6Tyy0i/so6VAZTiEVK1do7CU= -github.com/kubernetes-csi/drivers v1.0.2 h1:kaEAMfo+W5YFr23yedBIY+NGnNjr6/PbPzx7N4GYgiQ= -github.com/kubernetes-csi/drivers v1.0.2/go.mod h1:V6rHbbSLCZGaQoIZ8MkyDtoXtcKXZM0F7N3bkloDCOY= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -369,7 +358,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -382,7 +370,6 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -393,7 +380,6 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -401,14 +387,12 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -428,7 +412,6 @@ github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prY github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -436,12 +419,10 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -453,10 +434,7 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -495,8 +473,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -676,7 +652,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= @@ -714,7 +689,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -751,7 +725,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -822,7 +795,6 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -865,13 +837,11 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -883,8 +853,6 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4 h1:8x49nBRxuXGUlDlwlWd3RMY1SayZrzFfxea3UZSkFw4= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= -k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= -k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= @@ -892,7 +860,6 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc k8s.io/apimachinery v0.18.4 h1:ST2beySjhqwJoIFk6p7Hp5v5O0hYY6Gngq/gUYXTPIA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= @@ -901,14 +868,15 @@ k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.4 h1:un55V1Q/B3JO3A76eS0kUSywgGK/WR3BQ8fHQjNa6Zc= k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= -k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= +k8s.io/client-go v1.5.1 h1:XaX/lo2/u3/pmFau8HN+sB5C/b4dc4Dmm2eXjBH4p1E= +k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= +k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= -k8s.io/component-base v0.19.0/go.mod h1:dKsY8BxkA+9dZIAh2aWJLL/UdASFDNtGYTCItL4LM7Y= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/pkg/identity/identity.go b/pkg/identity/identity.go index 2134381..54acde3 100644 --- a/pkg/identity/identity.go +++ b/pkg/identity/identity.go @@ -72,7 +72,7 @@ func (i *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.Get } caps := []*csi.PluginCapability{ - serviceCap(csi.PluginCapability_Service_UNKNOWN), + serviceCap(csi.PluginCapability_Service_CONTROLLER_SERVICE), } return &csi.GetPluginCapabilitiesResponse{ diff --git a/pkg/node/node.go b/pkg/node/node.go index 80fc899..f402608 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -3,14 +3,11 @@ package node import ( "context" "encoding/json" - "errors" "fmt" "github.com/container-object-storage-interface/api/apis/objectstorage.k8s.io/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog" "k8s.io/utils/mount" "os" @@ -22,15 +19,13 @@ import ( var _ csi.NodeServer = &NodeServer{} const protocolFileName string = `protocolConn.json` -var getError = func(t, n string, e error) error { return fmt.Errorf("failed to get <%s>%s: %v", t, n, e) } -func NewNodeServer(driverName, nodeID string, c cs.ObjectstorageV1alpha1Client, kube kubernetes.Interface) csi.NodeServer { +func NewNodeServer(nodeId, driverName string, c cs.ObjectstorageV1alpha1Client) csi.NodeServer { return &NodeServer{ name: driverName, - nodeID: nodeID, + nodeID: nodeId, cosiClient: c, ctx: context.Background(), - kubeClient: kube, } } @@ -47,88 +42,122 @@ type NodeServer struct { name string nodeID string cosiClient cs.ObjectstorageV1alpha1Client - kubeClient kubernetes.Interface ctx context.Context } -func (n NodeServer) getBAR(barName, barNs string) (*v1alpha1.BucketAccessRequest, error) { - klog.Infof("getting bucketAccessRequest %q", fmt.Sprintf("%s/%s", barNs, barName)) - bar, err := n.cosiClient.BucketAccessRequests(barNs).Get(n.ctx, barName, metav1.GetOptions{}) - if err != nil || bar == nil || !bar.Status.AccessGranted { - return nil, logErr(getError("bucketAccessRequest", fmt.Sprintf("%s/%s", barNs, barName), err)) +func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { + vID := request.GetVolumeId() + stagingTargetPath := request.GetStagingTargetPath() + + if vID == "" { + return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") } - if len(bar.Spec.BucketRequestName) == 0 { - return nil, logErr(fmt.Errorf("bucketAccessRequest.Spec.BucketRequestName unset")) + + if err := os.MkdirAll(stagingTargetPath, 0755); err != nil { + return nil, status.Errorf(codes.Internal, "Stage Volume Failed: %v", err) } - return bar, nil -} -func (n NodeServer) getBA(baName string) (*v1alpha1.BucketAccess, error) { - klog.Infof("getting bucketAccess %q", fmt.Sprintf("%s", baName)) - ba, err := n.cosiClient.BucketAccesses().Get(n.ctx, baName, metav1.GetOptions{}) - if err != nil || ba == nil || !ba.Status.AccessGranted { - return nil, logErr(getError("bucketAccess", fmt.Sprintf("%s", baName), err)) + dir, err := Provision(vID) + if err != nil { + return nil, status.Errorf(codes.Internal, "Stage Volume Provision Failed: %v", err) } - return ba, nil -} -func (n NodeServer) getBR(brName, brNs string) (*v1alpha1.BucketRequest, error) { - klog.Infof("getting bucketRequest %q", brName) - br, err := n.cosiClient.BucketRequests(brNs).Get(n.ctx, brName, metav1.GetOptions{}) - if err != nil || br == nil || !br.Status.BucketAvailable { - return nil, logErr(getError("bucketRequest", fmt.Sprintf("%s/%s", brNs, brName), err)) + if err := mount.New("").Mount(dir, stagingTargetPath, "", []string{"bind"}); err != nil { + return nil, status.Errorf(codes.Internal, "Stage Volume Mount Failed: %v", err) } - return br, nil + + return &csi.NodeStageVolumeResponse{}, nil } -func (n NodeServer) getB(bName string) (*v1alpha1.Bucket, error) { - klog.Infof("getting bucket %q", bName) - // is BucketInstanceName the correct field, or should it be BucketClass - bkt, err := n.cosiClient.Buckets().Get(n.ctx, bName, metav1.GetOptions{}) - if err != nil || bkt == nil || !bkt.Status.BucketAvailable { - return nil, logErr(getError("bucket", bName, err)) +func (n NodeServer) NodeUnstageVolume(ctx context.Context, request *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { + vID := request.GetVolumeId() + stagingTargetPath := request.GetStagingTargetPath() + + if vID == "" { + return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") } - return bkt, nil -} -func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { - klog.Infof("NodePublishVolume: volId: %v, targetPath: %v\n", request.GetVolumeId(), request.StagingTargetPath) + if notMnt, err := mount.IsNotMountPoint(mount.New(""), stagingTargetPath); err != nil { + if !os.IsNotExist(err) { + return nil, status.Error(codes.Internal, err.Error()) + } + } else if !notMnt { + // Unmounting the image or filesystem. + err = mount.New("").Unmount(stagingTargetPath) + if err != nil { + return nil, status.Errorf(codes.Internal, "Unstage Unmounting failed: %v", err) + } + } + if err := Unprovision(vID); err != nil { + return nil,status.Errorf(codes.Internal, "Unstage Volume Unprovision failed: %v", err) + } - name, ns, err := parseVolumeContext(request.VolumeContext) - if err != nil { - return nil, err + return &csi.NodeUnstageVolumeResponse{}, nil} + +const ( + barName = "bucketAccessRequestName" + barNamespace = "bucketAccessRequestNamespace" +) + +func parseValue(key string, ctx map[string]string) (string, error) { + value, ok := ctx[key] + if !ok { + return "", fmt.Errorf("required volume context key unset: %v", key) } + klog.Infof("got value: %v", value) + return value, nil +} +func parseVolumeContext(volCtx map[string]string) (name, ns string, err error) { + klog.Info("parsing bucketAccessRequest namespace/name from volume context") - pod, err := n.kubeClient.CoreV1().Pods(ns).Get(ctx, name, metav1.GetOptions{}) + name, err = parseValue(barName, volCtx) if err != nil { - return nil, logErr(getError("pod", fmt.Sprintf("%s/%s", ns, name), err)) + return "", "", err } - barName, barNs, err := parsePod(pod, n.name) + ns, err = parseValue(barNamespace, volCtx) if err != nil { - return nil, err + return "", "", err } - bar, err := n.getBAR(barName, barNs) + + return +} + +func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { + klog.Infof("NodePublishVolume: volId: %v, targetPath: %v\n", request.GetVolumeId(), request.GetTargetPath()) + + name, ns, err := parseVolumeContext(request.VolumeContext) if err != nil { return nil, err } - ba, err := n.getBA(bar.Spec.BucketAccessName) - if err != nil { - return nil, err + + getError := func(t, n string, e error) error { return fmt.Errorf("failed to get <%s>%s: %v", t, n, e) } + + klog.Infof("getting bucketAccessRequest %q", fmt.Sprintf("%s/%s", ns, name)) + bar, err := n.cosiClient.BucketAccessRequests(ns).Get(n.ctx, name, v1.GetOptions{}) + + if err != nil || bar == nil || !bar.Status.AccessGranted { + return nil, logErr(getError("bucketAccessRequest", fmt.Sprintf("%s/%s", ns, name), err)) } - br, err := n.getBR(bar.Spec.BucketRequestName, barNs) - if err != nil { - return nil, err + + if len(bar.Spec.BucketRequestName) == 0 { + return nil, logErr(fmt.Errorf("bucketAccessRequest.Spec.BucketRequestName unset")) } - bkt, err := n.getB(br.Spec.BucketInstanceName) - if err != nil { - return nil, err + + klog.Infof("getting bucketRequest %q", bar.Spec.BucketRequestName) + br, err := n.cosiClient.BucketRequests(bar.Namespace).Get(n.ctx, bar.Spec.BucketRequestName, v1.GetOptions{}) + if err != nil || br == nil || !br.Status.BucketAvailable { + return nil, logErr(getError("bucketRequest", fmt.Sprintf("%s/%s", bar.Namespace, bar.Spec.BucketRequestName), err)) } - secret, err := n.kubeClient.CoreV1().Secrets(barNs).Get(ctx, ba.Spec.MintedSecretName, metav1.GetOptions{}) - if err != nil { - return nil, logErr(getError("pod", fmt.Sprintf("%s/%s", barNs, ba.Spec.MintedSecretName), err)) + + klog.Infof("getting bucket %q", br.Spec.BucketInstanceName) + // is BucketInstanceName the correct field, or should it be BucketClass + bkt, err := n.cosiClient.Buckets().Get(n.ctx, br.Spec.BucketInstanceName, v1.GetOptions{}) + if err != nil || bkt == nil || !bkt.Status.BucketAvailable { + return nil, logErr(getError("bucket", br.Spec.BucketInstanceName, err)) } + var protocolConnection interface{} switch bkt.Spec.Protocol.ProtocolName { case v1alpha1.ProtocolNameS3: @@ -148,16 +177,12 @@ func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageV } klog.Infof("bucket %q has protocol %q", bkt.Name, bkt.Spec.Protocol) - data := make(map[string]interface{}) - data["protocol"] = protocolConnection - data["connection"] = secret.Data - - protoData, err := json.Marshal(data) + protoData, err := json.Marshal(protocolConnection) if err != nil { return nil, logErr(fmt.Errorf("error marshalling protocol: %v", err)) } - target := filepath.Join(request.StagingTargetPath, protocolFileName) + target := filepath.Join(request.TargetPath, protocolFileName) klog.Infof("creating conn file: %s", target) f, err := os.Open(target) if err != nil { @@ -168,82 +193,6 @@ func (n NodeServer) NodeStageVolume(ctx context.Context, request *csi.NodeStageV if err != nil { return nil, logErr(fmt.Errorf("unable to write to file: %v", err)) } - return &csi.NodeStageVolumeResponse{}, nil -} - -func (n NodeServer) NodeUnstageVolume(ctx context.Context, request *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { - panic("implement me") -} - -const ( - podNameKey = "csi.storage.k8s.io/pod.name" - podNamespaceKey = "csi.storage.k8s.io/pod.namespace" - barNameKey = "bar-name" - barNamespaceKey = "bar-namespace" -) - -func parseValue(key string, ctx map[string]string) (string, error) { - value, ok := ctx[key] - if !ok { - return "", fmt.Errorf("required volume context key unset: %v", key) - } - klog.Infof("got value: %v", value) - return value, nil -} - -func parseVolumeContext(volCtx map[string]string) (name, ns string, err error) { - klog.Info("parsing bucketAccessRequest namespace/name from volume context") - - name, err = parseValue(podNameKey, volCtx) - if err != nil { - return "", "", err - } - - ns, err = parseValue(podNamespaceKey, volCtx) - if err != nil { - return "", "", err - } - - return -} - -func parsePod(pod *v1.Pod, driverName string) (name, ns string, err error) { - klog.Info("parsing bucketAccessRequest namespace/name from pod") - - for _, v := range pod.Spec.Volumes { - if v.CSI != nil && v.CSI.Driver == driverName { - name, ok := v.CSI.VolumeAttributes[barNameKey] - if !ok { - return "", "", errors.New("invalid BAR Name") - } - namespace, ok := v.CSI.VolumeAttributes[barNamespaceKey] - if !ok { - return "", "", errors.New("invalid BAR Namespace") - } - return name, namespace, nil - } - } - - return "", "", nil -} - -func (n NodeServer) NodePublishVolume(ctx context.Context, request *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { - vID := request.GetVolumeId() - stagingTargetPath := request.GetStagingTargetPath() - targetPath := request.GetTargetPath() - - if vID == "" { - return nil, status.Error(codes.InvalidArgument, "volume ID missing in request") - } - - if err := os.MkdirAll(targetPath, 0755); err != nil { - return nil, status.Errorf(codes.Internal, "Stage Volume Failed: %v", err) - } - - if err := mount.New("").Mount(stagingTargetPath, targetPath, "", []string{"bind"}); err != nil { - return nil, status.Errorf(codes.Internal, "Stage Volume Mount Failed: %v", err) - } - return &csi.NodePublishVolumeResponse{}, nil } diff --git a/pkg/node/provisioner.go b/pkg/node/provisioner.go index c71739e..48699c7 100644 --- a/pkg/node/provisioner.go +++ b/pkg/node/provisioner.go @@ -16,7 +16,7 @@ type provision struct { Path string } -func Initialize(path string) { +func Initalize(path string) { provisioner.Path = path }