From ca2fba5398e83170fa0eaeb913fdeb5aa1e0ded1 Mon Sep 17 00:00:00 2001 From: Alexander Ding Date: Mon, 28 Nov 2022 21:39:44 +0000 Subject: [PATCH] feat: migrate to csi proxy v2 alpha --- Dockerfile.Windows | 4 +- Makefile | 36 +- .../overlays/dev/kustomization.yaml | 1 + .../overlays/dev/windows_hostprocess.yaml | 40 + .../overlays/noauth-debug/kustomization.yaml | 1 + .../noauth-debug/windows_hostprocess.yaml | 40 + go.mod | 4 +- go.sum | 8 +- manifest_osversion.sh | 41 - pkg/gce-pd-csi-driver/server.go | 3 +- pkg/gce-pd-csi-driver/utils_linux.go | 5 + pkg/gce-pd-csi-driver/utils_windows.go | 15 + pkg/mount-manager/safe-mounter-v1_windows.go | 339 --- .../safe-mounter-v1beta_windows.go | 333 --- pkg/mount-manager/safe-mounter_windows.go | 344 ++- pkg/mount-manager/statter_windows.go | 59 +- pkg/resizefs/resizefs_windows.go | 53 +- .../github.com/Microsoft/go-winio/.gitignore | 1 - .../github.com/Microsoft/go-winio/CODEOWNERS | 1 - vendor/github.com/Microsoft/go-winio/LICENSE | 22 - .../github.com/Microsoft/go-winio/README.md | 22 - .../github.com/Microsoft/go-winio/backup.go | 280 --- vendor/github.com/Microsoft/go-winio/ea.go | 137 -- vendor/github.com/Microsoft/go-winio/file.go | 323 --- .../github.com/Microsoft/go-winio/fileinfo.go | 73 - .../github.com/Microsoft/go-winio/hvsock.go | 307 --- vendor/github.com/Microsoft/go-winio/pipe.go | 517 ----- .../Microsoft/go-winio/pkg/guid/guid.go | 237 --- .../Microsoft/go-winio/privilege.go | 202 -- .../github.com/Microsoft/go-winio/reparse.go | 128 -- vendor/github.com/Microsoft/go-winio/sd.go | 98 - .../github.com/Microsoft/go-winio/syscall.go | 3 - .../Microsoft/go-winio/zsyscall_windows.go | 427 ---- .../kubernetes-csi/csi-proxy/client/README.md | 5 - .../csi-proxy/client/api/disk/v1/api.pb.go | 1476 ------------- .../csi-proxy/client/api/disk/v1/api.proto | 111 - .../client/api/disk/v1beta2/api.pb.go | 1028 --------- .../client/api/disk/v1beta2/api.proto | 109 - .../client/api/filesystem/v1/api.pb.go | 1041 --------- .../client/api/filesystem/v1/api.proto | 136 -- .../client/api/filesystem/v1beta1/api.pb.go | 872 -------- .../client/api/filesystem/v1beta1/api.proto | 168 -- .../csi-proxy/client/api/volume/v1/api.pb.go | 1876 ----------------- .../csi-proxy/client/api/volume/v1/api.proto | 143 -- .../client/api/volume/v1beta1/api.pb.go | 1197 ----------- .../client/api/volume/v1beta1/api.proto | 121 -- .../csi-proxy/client/apiversion/version.go | 143 -- .../client/groups/disk/v1/client_generated.go | 94 - .../groups/disk/v1beta2/client_generated.go | 94 - .../groups/filesystem/v1/client_generated.go | 86 - .../filesystem/v1beta1/client_generated.go | 86 - .../groups/volume/v1/client_generated.go | 106 - .../groups/volume/v1beta1/client_generated.go | 102 - .../kubernetes-csi/csi-proxy/client/utils.go | 35 - .../csi-proxy/{client => v2}/LICENSE | 1 - .../csi-proxy/v2/pkg/disk/disk.go | 173 ++ .../csi-proxy/v2/pkg/disk/hostapi/hostapi.go | 360 ++++ .../csi-proxy/v2/pkg/disk/hostapi/types.go | 129 ++ .../csi-proxy/v2/pkg/disk/types.go | 81 + .../csi-proxy/v2/pkg/filesystem/filesystem.go | 152 ++ .../v2/pkg/filesystem/hostapi/hostapi.go | 146 ++ .../csi-proxy/v2/pkg/filesystem/types.go | 145 ++ .../csi-proxy/v2/pkg/filesystem/utils.go | 69 + .../csi-proxy/v2/pkg/utils/utils.go | 20 + .../v2/pkg/volume/hostapi/hostapi.go | 388 ++++ .../csi-proxy/v2/pkg/volume/types.go | 121 ++ .../csi-proxy/v2/pkg/volume/volume.go | 280 +++ vendor/github.com/pkg/errors/.gitignore | 24 - vendor/github.com/pkg/errors/.travis.yml | 10 - vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/Makefile | 44 - vendor/github.com/pkg/errors/README.md | 59 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/pkg/errors/errors.go | 288 --- vendor/github.com/pkg/errors/go113.go | 38 - vendor/github.com/pkg/errors/stack.go | 177 -- vendor/modules.txt | 30 +- 77 files changed, 2531 insertions(+), 13392 deletions(-) create mode 100644 deploy/kubernetes/overlays/dev/windows_hostprocess.yaml create mode 100644 deploy/kubernetes/overlays/noauth-debug/windows_hostprocess.yaml delete mode 100755 manifest_osversion.sh delete mode 100644 pkg/mount-manager/safe-mounter-v1_windows.go delete mode 100644 pkg/mount-manager/safe-mounter-v1beta_windows.go delete mode 100644 vendor/github.com/Microsoft/go-winio/.gitignore delete mode 100644 vendor/github.com/Microsoft/go-winio/CODEOWNERS delete mode 100644 vendor/github.com/Microsoft/go-winio/LICENSE delete mode 100644 vendor/github.com/Microsoft/go-winio/README.md delete mode 100644 vendor/github.com/Microsoft/go-winio/backup.go delete mode 100644 vendor/github.com/Microsoft/go-winio/ea.go delete mode 100644 vendor/github.com/Microsoft/go-winio/file.go delete mode 100644 vendor/github.com/Microsoft/go-winio/fileinfo.go delete mode 100644 vendor/github.com/Microsoft/go-winio/hvsock.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pipe.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go delete mode 100644 vendor/github.com/Microsoft/go-winio/privilege.go delete mode 100644 vendor/github.com/Microsoft/go-winio/reparse.go delete mode 100644 vendor/github.com/Microsoft/go-winio/sd.go delete mode 100644 vendor/github.com/Microsoft/go-winio/syscall.go delete mode 100644 vendor/github.com/Microsoft/go-winio/zsyscall_windows.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/README.md delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.proto delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/apiversion/version.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1/client_generated.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/utils.go rename vendor/github.com/kubernetes-csi/csi-proxy/{client => v2}/LICENSE (99%) create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/disk.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/hostapi.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/types.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/types.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/filesystem.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi/hostapi.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/types.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/utils.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/utils/utils.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi/hostapi.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/types.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/volume.go delete mode 100644 vendor/github.com/pkg/errors/.gitignore delete mode 100644 vendor/github.com/pkg/errors/.travis.yml delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/Makefile delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/go113.go delete mode 100644 vendor/github.com/pkg/errors/stack.go diff --git a/Dockerfile.Windows b/Dockerfile.Windows index 64c74f2d4..f0f861570 100644 --- a/Dockerfile.Windows +++ b/Dockerfile.Windows @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BASE_IMAGE FROM --platform=$BUILDPLATFORM golang:1.17.8 AS builder ARG TARGETPLATFORM @@ -22,8 +21,9 @@ WORKDIR /code ADD . /code/ RUN cd /code/ && GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') GCE_PD_CSI_STAGING_VERSION=${STAGINGVERSION} make gce-pd-driver-windows -FROM ${BASE_IMAGE} +FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 LABEL description="PD CSI driver" + COPY --from=builder /code/bin/gce-pd-csi-driver.exe /gce-pd-csi-driver.exe USER ContainerAdministrator diff --git a/Makefile b/Makefile index 28aba86f2..ff48ca71d 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,10 @@ STAGINGVERSION=${GCE_PD_CSI_STAGING_VERSION} STAGINGIMAGE=${GCE_PD_CSI_STAGING_IMAGE} DRIVERBINARY=gce-pd-csi-driver DRIVERWINDOWSBINARY=${DRIVERBINARY}.exe +LTSC2019=10.0.17763 # version mapping found here: https://kubernetes.io/docs/concepts/windows/user-guide/#handling-multiple-windows-versions-in-the-same-cluster DOCKER=DOCKER_CLI_EXPERIMENTAL=enabled docker -BASE_IMAGE_LTSC2019=mcr.microsoft.com/windows/servercore:ltsc2019 -BASE_IMAGE_20H2=mcr.microsoft.com/windows/servercore:20H2 - -# Both arrays MUST be index aligned. -WINDOWS_IMAGE_TAGS=ltsc2019 20H2 -WINDOWS_BASE_IMAGES=$(BASE_IMAGE_LTSC2019) $(BASE_IMAGE_20H2) - GCFLAGS="" ifdef GCE_PD_CSI_DEBUG GCFLAGS="all=-N -l" @@ -55,26 +49,24 @@ build-container: require-GCE_PD_CSI_STAGING_IMAGE require-GCE_PD_CSI_STAGING_VER --build-arg STAGINGVERSION=$(STAGINGVERSION) \ --push . -build-and-push-windows-container-ltsc2019: require-GCE_PD_CSI_STAGING_IMAGE init-buildx - $(DOCKER) buildx build --file=Dockerfile.Windows --platform=windows \ - -t $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019 \ - --build-arg BASE_IMAGE=$(BASE_IMAGE_LTSC2019) \ - --build-arg STAGINGVERSION=$(STAGINGVERSION) --push . +# TODO(alexander-ding): the Windows image built here should work on every Windows Server version +# however, due to https://github.com/containerd/containerd/issues/7431 we still need to tag +# a specific Windows OS version in the image. For now, we tag Windows ltsc2019, but after the issue +# is resolved, we can remove the docker manifest annotate lines and rename the manifest to $(STAGINGVERSION)_windows -build-and-push-windows-container-20H2: require-GCE_PD_CSI_STAGING_IMAGE init-buildx - $(DOCKER) buildx build --file=Dockerfile.Windows --platform=windows \ - -t $(STAGINGIMAGE):$(STAGINGVERSION)_20H2 \ - --build-arg BASE_IMAGE=$(BASE_IMAGE_20H2) \ +build-and-push-container-windows-ltsc2019: require-GCE_PD_CSI_STAGING_IMAGE init-buildx + $(DOCKER) buildx build --file=Dockerfile.Windows --platform=windows/amd64 \ + -t $(STAGINGIMAGE):$(STAGINGVERSION)_windows_ltsc2019 \ --build-arg STAGINGVERSION=$(STAGINGVERSION) --push . -build-and-push-multi-arch: build-and-push-container-linux-amd64 build-and-push-container-linux-arm64 build-and-push-windows-container-ltsc2019 build-and-push-windows-container-20H2 - $(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64 $(STAGINGIMAGE):$(STAGINGVERSION)_20H2 $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019 - STAGINGIMAGE="$(STAGINGIMAGE)" STAGINGVERSION="$(STAGINGVERSION)" WINDOWS_IMAGE_TAGS="$(WINDOWS_IMAGE_TAGS)" WINDOWS_BASE_IMAGES="$(WINDOWS_BASE_IMAGES)" ./manifest_osversion.sh +build-and-push-multi-arch: build-and-push-container-linux-amd64 build-and-push-container-linux-arm64 build-and-push-container-windows-ltsc2019 + $(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64 $(STAGINGIMAGE):$(STAGINGVERSION)_windows_ltsc2019 + $(DOCKER) manifest annotate --os-version 10.0.17763 $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_windows_ltsc2019 $(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION) -build-and-push-multi-arch-debug: build-and-push-container-linux-debug build-and-push-windows-container-ltsc2019 - $(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019 - STAGINGIMAGE="$(STAGINGIMAGE)" STAGINGVERSION="$(STAGINGVERSION)" WINDOWS_IMAGE_TAGS="ltsc2019" WINDOWS_BASE_IMAGES="$(BASE_IMAGE_LTSC2019)" ./manifest_osversion.sh +build-and-push-multi-arch-debug: build-and-push-container-linux-debug build-and-push-container-windows-ltsc2019 + $(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux $(STAGINGIMAGE):$(STAGINGVERSION)_windows_ltsc2019 + $(DOCKER) manifest annotate --os-version $(LTSC2019) $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_windows_ltsc2019 $(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION) push-container: build-container diff --git a/deploy/kubernetes/overlays/dev/kustomization.yaml b/deploy/kubernetes/overlays/dev/kustomization.yaml index f6ffff391..759c094d6 100644 --- a/deploy/kubernetes/overlays/dev/kustomization.yaml +++ b/deploy/kubernetes/overlays/dev/kustomization.yaml @@ -3,6 +3,7 @@ kind: Kustomization patchesStrategicMerge: - controller_always_pull.yaml - node_always_pull.yaml +- windows_hostprocess.yaml namespace: gce-pd-csi-driver resources: - ../../base/ diff --git a/deploy/kubernetes/overlays/dev/windows_hostprocess.yaml b/deploy/kubernetes/overlays/dev/windows_hostprocess.yaml new file mode 100644 index 000000000..2be5bdb2d --- /dev/null +++ b/deploy/kubernetes/overlays/dev/windows_hostprocess.yaml @@ -0,0 +1,40 @@ +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: csi-gce-pd-node-win +spec: + template: + spec: + hostNetwork: true + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" + containers: + - name: csi-driver-registrar + command: + - csi-node-driver-registrar.exe + args: + - --v=5 + - --csi-address=unix://c:\var\lib\kubelet\plugins\pd.csi.storage.gke.io\csi.sock + - --kubelet-registration-path=/var/lib/kubelet/plugins/pd.csi.storage.gke.io/csi.sock + - --plugin-registration-path=/var/lib/kubelet/plugins_registry + volumeMounts: + - name: registration-dir + mountPath: /registration + $patch: delete + - name: gce-pd-driver + command: + - gce-pd-csi-driver.exe + args: + - --v=5 + - --endpoint=unix:/c:\var\lib\kubelet\plugins\pd.csi.storage.gke.io\csi.sock + - --run-controller-service=false + volumeMounts: + - $patch: replace + volumes: + - name: plugin-dir + hostPath: + path: /var/lib/kubelet/plugins/pd.csi.storage.gke.io + type: DirectoryOrCreate + - $patch: replace diff --git a/deploy/kubernetes/overlays/noauth-debug/kustomization.yaml b/deploy/kubernetes/overlays/noauth-debug/kustomization.yaml index d85ab5e71..68ccd98a2 100644 --- a/deploy/kubernetes/overlays/noauth-debug/kustomization.yaml +++ b/deploy/kubernetes/overlays/noauth-debug/kustomization.yaml @@ -9,6 +9,7 @@ patchesStrategicMerge: - noauth.yaml - controller-overlay.yaml - node-overlay.yaml +- windows_hostprocess.yaml namespace: gce-pd-csi-driver # To change the dev image, add something like the following. # images: diff --git a/deploy/kubernetes/overlays/noauth-debug/windows_hostprocess.yaml b/deploy/kubernetes/overlays/noauth-debug/windows_hostprocess.yaml new file mode 100644 index 000000000..2be5bdb2d --- /dev/null +++ b/deploy/kubernetes/overlays/noauth-debug/windows_hostprocess.yaml @@ -0,0 +1,40 @@ +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: csi-gce-pd-node-win +spec: + template: + spec: + hostNetwork: true + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" + containers: + - name: csi-driver-registrar + command: + - csi-node-driver-registrar.exe + args: + - --v=5 + - --csi-address=unix://c:\var\lib\kubelet\plugins\pd.csi.storage.gke.io\csi.sock + - --kubelet-registration-path=/var/lib/kubelet/plugins/pd.csi.storage.gke.io/csi.sock + - --plugin-registration-path=/var/lib/kubelet/plugins_registry + volumeMounts: + - name: registration-dir + mountPath: /registration + $patch: delete + - name: gce-pd-driver + command: + - gce-pd-csi-driver.exe + args: + - --v=5 + - --endpoint=unix:/c:\var\lib\kubelet\plugins\pd.csi.storage.gke.io\csi.sock + - --run-controller-service=false + volumeMounts: + - $patch: replace + volumes: + - name: plugin-dir + hostPath: + path: /var/lib/kubelet/plugins/pd.csi.storage.gke.io + type: DirectoryOrCreate + - $patch: replace diff --git a/go.mod b/go.mod index aa16e28cc..00d24d0ef 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0 github.com/container-storage-interface/spec v1.6.0 github.com/google/uuid v1.3.0 - github.com/kubernetes-csi/csi-proxy/client v1.1.1 + github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.0 github.com/kubernetes-csi/csi-test/v4 v4.4.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.20.0 @@ -32,7 +32,6 @@ require ( require ( cloud.google.com/go v0.103.0 // indirect cloud.google.com/go/iam v0.3.0 // indirect - github.com/Microsoft/go-winio v0.4.17 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -64,7 +63,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.8 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect diff --git a/go.sum b/go.sum index b56f2f4a2..da8ba47fc 100644 --- a/go.sum +++ b/go.sum @@ -191,8 +191,6 @@ github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHS github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= github.com/Microsoft/hcsshim v0.8.22/go.mod h1:91uVCVzvX2QD16sMCenoxxXo6L1wJnLMX2PSufFMtF0= @@ -1048,8 +1046,8 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/csi-proxy/client v1.1.1 h1:GagYqArF85E/pQuzldTEQ3WmrcNVU/bYPNG+Ha8tTC4= -github.com/kubernetes-csi/csi-proxy/client v1.1.1/go.mod h1:SfK4HVKQdMH5KrffivddAWgX5hl3P5KmnuOTBbDNboU= +github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.0 h1:9uY7OxvgKhDqqEuSCDW++cZcYlHFVTwhbEdZa5XqJCQ= +github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.0/go.mod h1:pacx+PW7lLlu6kAvpr8Lgq/5fdiAsKxOtXXFHMaLMb8= github.com/kubernetes-csi/csi-test/v4 v4.4.0 h1:r0mnAwDURI24Vw3a/LyA/ga11yD5ZGuU7+REO35Na9s= github.com/kubernetes-csi/csi-test/v4 v4.4.0/go.mod h1:t1RzseMZJKy313nezI/d7TolbbiKpUZM3SXQvXxOX0w= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= @@ -1273,7 +1271,6 @@ github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= @@ -2456,6 +2453,7 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-aggregator v0.24.1/go.mod h1:vZvRALCO32hrIuREhkYwLq5Crc0zh6SxzJDAKrQM1+k= diff --git a/manifest_osversion.sh b/manifest_osversion.sh deleted file mode 100755 index 4e16dcbf2..000000000 --- a/manifest_osversion.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -set -o xtrace - -# The following is a workaround for issue https://github.com/moby/moby/issues/41417 -# to manually inserver os.version information into docker manifest file -# TODO: once docker manifest annotation for os.versions is availabler for the installed docker here, -# replace the following with annotation approach. https://github.com/docker/cli/pull/2578 - -export DOCKER_CLI_EXPERIMENTAL=enabled -BASE="mcr.microsoft.com/windows/servercore" - -IFS=', ' read -r -a imagetags <<< "$WINDOWS_IMAGE_TAGS" -IFS=', ' read -r -a baseimages <<< "$WINDOWS_BASE_IMAGES" -MANIFEST_TAG=${STAGINGIMAGE}:${STAGINGVERSION} - -# translate from image tag to docker manifest foler format -# e.g., gcr.io_k8s-staging-csi_gce-pd-windows-v2 -manifest_folder=$(echo "${MANIFEST_TAG}" | sed "s|/|_|g" | sed "s/:/-/") -echo ${manifest_folder} -echo ${#imagetags[@]} -echo ${#baseimages[@]} - -for ((i=0;i<${#imagetags[@]};++i)); do - BASEIMAGE="${baseimages[i]}" - echo $BASEIIMAGE - - full_version=$(docker manifest inspect ${BASEIMAGE} | grep "os.version" | head -n 1 | awk '{print $2}') || true - echo $full_version - - IMAGETAG=${STAGINGIMAGE}:${STAGINGVERSION}_${imagetags[i]} - image_folder=$(echo "${IMAGETAG}" | sed "s|/|_|g" | sed "s/:/-/") - echo ${manifest_folder} - - # sed -i -r "s/(\"os\"\:\"windows\")/\0,\"os.version\":$full_version/" \ - # "${HOME}/.docker/manifests/${manifest_folder}/${image_folder}" - - # manifest after transformations - cat "${HOME}/.docker/manifests/${manifest_folder}/${image_folder}" -done - diff --git a/pkg/gce-pd-csi-driver/server.go b/pkg/gce-pd-csi-driver/server.go index eb5108611..48e29792e 100644 --- a/pkg/gce-pd-csi-driver/server.go +++ b/pkg/gce-pd-csi-driver/server.go @@ -16,7 +16,6 @@ package gceGCEDriver import ( "net" - "net/url" "os" "path/filepath" "sync" @@ -75,7 +74,7 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, ids csi.IdentityServer, c grpc.UnaryInterceptor(logGRPC), } - u, err := url.Parse(endpoint) + u, err := parseEndpoint(endpoint) if err != nil { klog.Fatal(err.Error()) diff --git a/pkg/gce-pd-csi-driver/utils_linux.go b/pkg/gce-pd-csi-driver/utils_linux.go index 9247b78b2..a613560e5 100644 --- a/pkg/gce-pd-csi-driver/utils_linux.go +++ b/pkg/gce-pd-csi-driver/utils_linux.go @@ -17,6 +17,7 @@ package gceGCEDriver import ( "fmt" + "net/url" "os" "strconv" "strings" @@ -79,3 +80,7 @@ func getBlockSizeBytes(devicePath string, m *mount.SafeFormatAndMount) (int64, e } return gotSizeBytes, nil } + +func parseEndpoint(endpoint string) (*url.URL, error) { + return url.Parse(endpoint) +} diff --git a/pkg/gce-pd-csi-driver/utils_windows.go b/pkg/gce-pd-csi-driver/utils_windows.go index 5d32ac7af..6d4ee5021 100644 --- a/pkg/gce-pd-csi-driver/utils_windows.go +++ b/pkg/gce-pd-csi-driver/utils_windows.go @@ -17,6 +17,7 @@ package gceGCEDriver import ( "fmt" + "net/url" "strings" "k8s.io/mount-utils" @@ -105,3 +106,17 @@ func getBlockSizeBytes(devicePath string, m *mount.SafeFormatAndMount) (int64, e } return proxy.GetDiskTotalBytes(devicePath) } + +func parseEndpoint(endpoint string) (*url.URL, error) { + u, err := url.Parse(endpoint) + if err != nil { + return nil, err + } + if u.Scheme == "unix" { + // remove leading slashes + if len(u.Path) > 0 && string(u.Path[0]) == "/" { + u.Path = u.Path[1:] + } + } + return u, err +} diff --git a/pkg/mount-manager/safe-mounter-v1_windows.go b/pkg/mount-manager/safe-mounter-v1_windows.go deleted file mode 100644 index 682338371..000000000 --- a/pkg/mount-manager/safe-mounter-v1_windows.go +++ /dev/null @@ -1,339 +0,0 @@ -//go:build windows - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mountmanager - -import ( - "context" - "errors" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - - diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" - diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1" - - fsapi "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" - fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1" - - volumeapi "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" - volumeclient "github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1" - - "k8s.io/klog/v2" - mount "k8s.io/mount-utils" -) - -// CSIProxyMounterV1 is the mounter implementation that uses the v1 API -type CSIProxyMounterV1 struct { - FsClient *fsclient.Client - DiskClient *diskclient.Client - VolumeClient *volumeclient.Client -} - -// check that CSIProxyMounterV1 implements CSIProxyMounter -var _ CSIProxyMounter = &CSIProxyMounterV1{} - -func NewCSIProxyMounterV1() (*CSIProxyMounterV1, error) { - fsClient, err := fsclient.NewClient() - if err != nil { - return nil, err - } - diskClient, err := diskclient.NewClient() - if err != nil { - return nil, err - } - volumeClient, err := volumeclient.NewClient() - if err != nil { - return nil, err - } - return &CSIProxyMounterV1{ - FsClient: fsClient, - DiskClient: diskClient, - VolumeClient: volumeClient, - }, nil -} - -// GetAPIVersions returns the versions of the client APIs this mounter is using. -func (mounter *CSIProxyMounterV1) GetAPIVersions() string { - return fmt.Sprintf( - "API Versions Disk: %s, Filesystem: %s, Volume: %s", - diskclient.Version, - fsclient.Version, - volumeclient.Version, - ) -} - -// Mount just creates a soft link at target pointing to source. -func (mounter *CSIProxyMounterV1) Mount(source string, target string, fstype string, options []string) error { - return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) -} - -// MountSensitive is the same as Mount() but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal -// mount options and ensures the sensitiveOptions are never logged. -// Since Mount here is just create a synlink, so options and sensitiveOptions -// are not used here -func (mounter *CSIProxyMounterV1) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - // Mount is called after the format is done. - // TODO: Confirm that fstype is empty. - // Call the LinkPath CSI proxy from the source path to the target path - parentDir := filepath.Dir(target) - if err := os.MkdirAll(parentDir, 0755); err != nil { - return err - } - createSymlinkRequest := &fsapi.CreateSymlinkRequest{ - SourcePath: mount.NormalizeWindowsPath(source), - TargetPath: mount.NormalizeWindowsPath(target), - } - _, err := mounter.FsClient.CreateSymlink(context.Background(), createSymlinkRequest) - if err != nil { - return err - } - return nil -} - -// Delete the given directory with Pod context. CSI proxy does a check for path prefix -// based on context -func (mounter *CSIProxyMounterV1) RemovePodDir(target string) error { - rmdirRequest := &fsapi.RmdirRequest{ - Path: mount.NormalizeWindowsPath(target), - Force: true, - } - _, err := mounter.FsClient.Rmdir(context.Background(), rmdirRequest) - if err != nil { - return err - } - return nil -} - -// UnmountDevice uses target path to find the volume id first, and then -// call DismountVolume through csi-proxy. If succeeded, it will delete the given path -// at last step. CSI proxy does a check for path prefix -// based on context -func (mounter *CSIProxyMounterV1) UnmountDevice(target string) error { - target = mount.NormalizeWindowsPath(target) - if exists, err := mounter.ExistsPath(target); !exists { - return err - } - idRequest := &volumeapi.GetVolumeIDFromTargetPathRequest{ - TargetPath: target, - } - idResponse, err := mounter.VolumeClient.GetVolumeIDFromTargetPath(context.Background(), idRequest) - if err != nil { - return err - } - volumeId := idResponse.GetVolumeId() - - unmountRequest := &volumeapi.UnmountVolumeRequest{ - TargetPath: target, - VolumeId: volumeId, - } - _, err = mounter.VolumeClient.UnmountVolume(context.Background(), unmountRequest) - if err != nil { - return err - } - rmdirRequest := &fsapi.RmdirRequest{ - Path: target, - Force: true, - } - _, err = mounter.FsClient.Rmdir(context.Background(), rmdirRequest) - if err != nil { - return err - } - - // Set disk to offline mode to have a clean state - getDiskNumberRequest := &volumeapi.GetDiskNumberFromVolumeIDRequest{ - VolumeId: volumeId, - } - getDiskNumberResponse, err := mounter.VolumeClient.GetDiskNumberFromVolumeID(context.Background(), getDiskNumberRequest) - if err != nil { - return err - } - diskNumber := getDiskNumberResponse.GetDiskNumber() - klog.V(4).Infof("get disk number %d from volume %s", diskNumber, volumeId) - setDiskStateRequest := &diskapi.SetDiskStateRequest{ - DiskNumber: diskNumber, - IsOnline: false, - } - if _, err = mounter.DiskClient.SetDiskState(context.Background(), setDiskStateRequest); err != nil { - return err - } - - return nil -} - -func (mounter *CSIProxyMounterV1) Unmount(target string) error { - return mounter.RemovePodDir(target) -} - -func (mounter *CSIProxyMounterV1) GetDiskNumber(deviceName string, partition string, volumeKey string) (string, error) { - listRequest := &diskapi.ListDiskIDsRequest{} - diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) - if err != nil { - return "", err - } - diskIDsMap := diskIDsResponse.GetDiskIDs() - for diskNum, diskInfo := range diskIDsMap { - klog.V(4).Infof("found disk number %d, disk info %v", diskNum, diskInfo) - idValue := diskInfo.Page83 - // The page83 id for gce pd has format of "Google pvc-xxxxxxx(the device name passed in here)" - if idValue == "" { - continue - } - klog.V(4).Infof("get page83 id %s", idValue) - names := strings.Fields(idValue) - if names[len(names)-1] == deviceName { - return strconv.FormatUint(uint64(diskNum), 10), nil - } - } - return "", fmt.Errorf("could not find disk number for device %s", deviceName) - -} - -// FormatAndMount accepts the source disk number, target path to mount, the fstype to format with and options to be used. -// After formatting, it will mount the disk to target path on the host -func (mounter *CSIProxyMounterV1) FormatAndMount(source string, target string, fstype string, options []string) error { - diskNumberUint64, err := strconv.ParseUint(source, 10, 64) - if err != nil { - return err - } - diskNumber := uint32(diskNumberUint64) - - // Call PartitionDisk CSI proxy call to partition the disk and return the volume id - partionDiskRequest := &diskapi.PartitionDiskRequest{ - DiskNumber: diskNumber, - } - - _, err = mounter.DiskClient.PartitionDisk(context.Background(), partionDiskRequest) - if err != nil { - return err - } - - // make sure disk is online. if disk is already online, this call should also succeed. - setDiskStateRequest := &diskapi.SetDiskStateRequest{ - DiskNumber: diskNumber, - IsOnline: true, - } - _, err = mounter.DiskClient.SetDiskState(context.Background(), setDiskStateRequest) - if err != nil { - return err - } - - volumeIDsRequest := &volumeapi.ListVolumesOnDiskRequest{ - DiskNumber: diskNumber, - } - volumeIdResponse, err := mounter.VolumeClient.ListVolumesOnDisk(context.Background(), volumeIDsRequest) - if err != nil { - return err - } - // TODO: consider partitions and choose the right partition. - if len(volumeIdResponse.VolumeIds) == 0 { - return fmt.Errorf("ListVolumesOnDisk does not return any volumes") - } - volumeID := volumeIdResponse.VolumeIds[0] - isVolumeFormattedRequest := &volumeapi.IsVolumeFormattedRequest{ - VolumeId: volumeID, - } - isVolumeFormattedResponse, err := mounter.VolumeClient.IsVolumeFormatted(context.Background(), isVolumeFormattedRequest) - if err != nil { - return err - } - if !isVolumeFormattedResponse.Formatted { - formatVolumeRequest := &volumeapi.FormatVolumeRequest{ - VolumeId: volumeID, - // TODO (jingxu97): Accept the filesystem and other options - } - _, err = mounter.VolumeClient.FormatVolume(context.Background(), formatVolumeRequest) - if err != nil { - return err - } - } - // Mount the volume by calling the CSI proxy call. - mountVolumeRequest := &volumeapi.MountVolumeRequest{ - VolumeId: volumeID, - TargetPath: target, - } - _, err = mounter.VolumeClient.MountVolume(context.Background(), mountVolumeRequest) - if err != nil { - return err - } - return nil -} - -func (mounter *CSIProxyMounterV1) GetMountRefs(pathname string) ([]string, error) { - return []string{}, fmt.Errorf("GetMountRefs not implemented for ProxyMounter") -} - -func (mounter *CSIProxyMounterV1) IsLikelyNotMountPoint(file string) (bool, error) { - isSymlinkRequest := &fsapi.IsSymlinkRequest{ - Path: file, - } - - isSymlinkResponse, err := mounter.FsClient.IsSymlink(context.Background(), isSymlinkRequest) - if err != nil { - return true, err - } - - return !isSymlinkResponse.IsSymlink, nil -} - -func (mounter *CSIProxyMounterV1) List() ([]mount.MountPoint, error) { - return []mount.MountPoint{}, nil -} - -func (mounter *CSIProxyMounterV1) IsMountPointMatch(mp mount.MountPoint, dir string) bool { - return mp.Path == dir -} - -// ExistsPath - Checks if a path exists. Unlike util ExistsPath, this call does not perform follow link. -func (mounter *CSIProxyMounterV1) ExistsPath(path string) (bool, error) { - isExistsResponse, err := mounter.FsClient.PathExists(context.Background(), - &fsapi.PathExistsRequest{ - Path: mount.NormalizeWindowsPath(path), - }) - if err != nil { - return false, err - } - return isExistsResponse.Exists, err -} - -func (mounter *CSIProxyMounterV1) GetDiskTotalBytes(devicePath string) (int64, error) { - diskNumberUint64, err := strconv.ParseUint(devicePath, 10, 64) - if err != nil { - return 0, err - } - diskNumber := uint32(diskNumberUint64) - - DiskStatsResponse, err := mounter.DiskClient.GetDiskStats(context.Background(), - &diskapi.GetDiskStatsRequest{ - DiskNumber: diskNumber, - }) - return DiskStatsResponse.TotalBytes, err -} - -// MountSensitiveWithoutSystemd is the same as MountSensitive() but this method disable using systemd mount. -// It's unimplemented in PD CSI Driver -func (mounter *CSIProxyMounterV1) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - return errors.New("MountSensitiveWithoutSystemd is not implemented") -} - -// MountSensitiveWithoutSystemdWithMountFlags is the same as MountSensitiveWithoutSystemd with additional mount flags. -// It's unimplemented in PD CSI Driver -func (mounter *CSIProxyMounterV1) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error { - return errors.New("MountSensitiveWithoutSystemd is not implemented") -} diff --git a/pkg/mount-manager/safe-mounter-v1beta_windows.go b/pkg/mount-manager/safe-mounter-v1beta_windows.go deleted file mode 100644 index 70ce52ee2..000000000 --- a/pkg/mount-manager/safe-mounter-v1beta_windows.go +++ /dev/null @@ -1,333 +0,0 @@ -//go:build windows - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mountmanager - -import ( - "context" - "errors" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - - diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" - diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" - - fsapi "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" - fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1" - - volumeapi "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" - volumeclient "github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1" - - "k8s.io/klog/v2" - mount "k8s.io/mount-utils" -) - -// CSIProxyMounterV1Beta is the mounter implementaiton that uses the v1beta API -type CSIProxyMounterV1Beta struct { - FsClient *fsclient.Client - DiskClient *diskclient.Client - VolumeClient *volumeclient.Client -} - -// check that CSIProxyMounterV1Beta implements CSIProxyMounter -var _ CSIProxyMounter = &CSIProxyMounterV1Beta{} - -func NewCSIProxyMounterV1Beta() (*CSIProxyMounterV1Beta, error) { - fsClient, err := fsclient.NewClient() - if err != nil { - return nil, err - } - diskClient, err := diskclient.NewClient() - if err != nil { - return nil, err - } - volumeClient, err := volumeclient.NewClient() - if err != nil { - return nil, err - } - return &CSIProxyMounterV1Beta{ - FsClient: fsClient, - DiskClient: diskClient, - VolumeClient: volumeClient, - }, nil -} - -// GetAPIVersions returns the versions of the client APIs this mounter is using. -func (mounter *CSIProxyMounterV1Beta) GetAPIVersions() string { - return fmt.Sprintf( - "API Versions Disk: %s, Filesystem: %s, Volume: %s", - diskclient.Version, - fsclient.Version, - volumeclient.Version, - ) -} - -// Mount just creates a soft link at target pointing to source. -func (mounter *CSIProxyMounterV1Beta) Mount(source string, target string, fstype string, options []string) error { - return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) -} - -// MountSensitive is the same as Mount() but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal -// mount options and ensures the sensitiveOptions are never logged. -// Since Mount here is just create a synlink, so options and sensitiveOptions -// are not used here -func (mounter *CSIProxyMounterV1Beta) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - // Mount is called after the format is done. - // TODO: Confirm that fstype is empty. - // Call the LinkPath CSI proxy from the source path to the target path - parentDir := filepath.Dir(target) - if err := os.MkdirAll(parentDir, 0755); err != nil { - return err - } - linkRequest := &fsapi.LinkPathRequest{ - SourcePath: mount.NormalizeWindowsPath(source), - TargetPath: mount.NormalizeWindowsPath(target), - } - response, err := mounter.FsClient.LinkPath(context.Background(), linkRequest) - if err != nil { - return err - } - if response.Error != "" { - return errors.New(response.Error) - } - return nil -} - -// Delete the given directory with Pod context. CSI proxy does a check for path prefix -// based on context -func (mounter *CSIProxyMounterV1Beta) RemovePodDir(target string) error { - rmdirRequest := &fsapi.RmdirRequest{ - Path: mount.NormalizeWindowsPath(target), - Context: fsapi.PathContext_POD, - Force: true, - } - _, err := mounter.FsClient.Rmdir(context.Background(), rmdirRequest) - if err != nil { - return err - } - return nil -} - -// UnmountDevice uses target path to find the volume id first, and then -// call DismountVolume through csi-proxy. If succeeded, it will delete the given path -// at last step. CSI proxy does a check for path prefix -// based on context -func (mounter *CSIProxyMounterV1Beta) UnmountDevice(target string) error { - target = mount.NormalizeWindowsPath(target) - if exists, err := mounter.ExistsPath(target); !exists { - return err - } - idRequest := &volumeapi.VolumeIDFromMountRequest{ - Mount: target, - } - idResponse, err := mounter.VolumeClient.GetVolumeIDFromMount(context.Background(), idRequest) - if err != nil { - return err - } - volumeId := idResponse.GetVolumeId() - - dismountRequest := &volumeapi.DismountVolumeRequest{ - Path: target, - VolumeId: volumeId, - } - _, err = mounter.VolumeClient.DismountVolume(context.Background(), dismountRequest) - if err != nil { - return err - } - rmdirRequest := &fsapi.RmdirRequest{ - Path: target, - Context: fsapi.PathContext_PLUGIN, - Force: true, - } - _, err = mounter.FsClient.Rmdir(context.Background(), rmdirRequest) - if err != nil { - return err - } - - // Set disk to offline mode to have a clean state - getDiskNumberRequest := &volumeapi.VolumeDiskNumberRequest{ - VolumeId: volumeId, - } - id, err := mounter.VolumeClient.GetVolumeDiskNumber(context.Background(), getDiskNumberRequest) - if err != nil { - return err - } - diskId := id.GetDiskNumber() - klog.V(4).Infof("get disk number %d from volume %s", diskId, volumeId) - setDiskRequest := &diskapi.SetAttachStateRequest{ - DiskID: strconv.FormatInt(diskId, 10), - IsOnline: false, - } - if _, err = mounter.DiskClient.SetAttachState(context.Background(), setDiskRequest); err != nil { - return err - } - - return nil -} - -func (mounter *CSIProxyMounterV1Beta) Unmount(target string) error { - return mounter.RemovePodDir(target) -} - -func (mounter *CSIProxyMounterV1Beta) GetDiskNumber(deviceName string, partition string, volumeKey string) (string, error) { - id := "page83" - listRequest := &diskapi.ListDiskIDsRequest{} - diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) - if err != nil { - return "", err - } - diskIDsMap := diskIDsResponse.GetDiskIDs() - for diskNum, diskInfo := range diskIDsMap { - klog.V(4).Infof("found disk number %s, disk info %v", diskNum, diskInfo) - idValue, found := diskInfo.Identifiers[id] - // The page83 id for gce pd has format of "Google pvc-xxxxxxx(the device name passed in here)" - if !found || idValue == "" { - continue - } - names := strings.Fields(idValue) - klog.V(4).Infof("get page83 id %s", idValue) - if names[len(names)-1] == deviceName { - return diskNum, nil - } - } - return "", fmt.Errorf("could not find disk number for device %s", deviceName) - -} - -// FormatAndMount accepts the source disk number, target path to mount, the fstype to format with and options to be used. -// After formatting, it will mount the disk to target path on the host -func (mounter *CSIProxyMounterV1Beta) FormatAndMount(source string, target string, fstype string, options []string) error { - // Call PartitionDisk CSI proxy call to partition the disk and return the volume id - partionDiskRequest := &diskapi.PartitionDiskRequest{ - DiskID: source, - } - - _, err := mounter.DiskClient.PartitionDisk(context.Background(), partionDiskRequest) - if err != nil { - return err - } - - // make sure disk is online. if disk is already online, this call should also succeed. - setDiskRequest := &diskapi.SetAttachStateRequest{ - DiskID: source, - IsOnline: true, - } - _, err = mounter.DiskClient.SetAttachState(context.Background(), setDiskRequest) - if err != nil { - return err - } - - volumeIDsRequest := &volumeapi.ListVolumesOnDiskRequest{ - DiskId: source, - } - volumeIdResponse, err := mounter.VolumeClient.ListVolumesOnDisk(context.Background(), volumeIDsRequest) - if err != nil { - return err - } - // TODO: consider partitions and choose the right partition. - if len(volumeIdResponse.VolumeIds) == 0 { - return fmt.Errorf("ListVolumesOnDisk does not return any volumes") - } - volumeID := volumeIdResponse.VolumeIds[0] - isVolumeFormattedRequest := &volumeapi.IsVolumeFormattedRequest{ - VolumeId: volumeID, - } - isVolumeFormattedResponse, err := mounter.VolumeClient.IsVolumeFormatted(context.Background(), isVolumeFormattedRequest) - if err != nil { - return err - } - if !isVolumeFormattedResponse.Formatted { - formatVolumeRequest := &volumeapi.FormatVolumeRequest{ - VolumeId: volumeID, - // TODO (jingxu97): Accept the filesystem and other options - } - _, err = mounter.VolumeClient.FormatVolume(context.Background(), formatVolumeRequest) - if err != nil { - return err - } - } - // Mount the volume by calling the CSI proxy call. - mountVolumeRequest := &volumeapi.MountVolumeRequest{ - VolumeId: volumeID, - Path: target, - } - _, err = mounter.VolumeClient.MountVolume(context.Background(), mountVolumeRequest) - if err != nil { - return err - } - return nil -} - -func (mounter *CSIProxyMounterV1Beta) GetMountRefs(pathname string) ([]string, error) { - return []string{}, fmt.Errorf("GetMountRefs not implemented for ProxyMounter") -} - -func (mounter *CSIProxyMounterV1Beta) IsLikelyNotMountPoint(file string) (bool, error) { - isMountRequest := &fsapi.IsMountPointRequest{ - Path: file, - } - - isMountResponse, err := mounter.FsClient.IsMountPoint(context.Background(), isMountRequest) - if err != nil { - return true, err - } - - return !isMountResponse.IsMountPoint, nil -} - -func (mounter *CSIProxyMounterV1Beta) List() ([]mount.MountPoint, error) { - return []mount.MountPoint{}, nil -} - -func (mounter *CSIProxyMounterV1Beta) IsMountPointMatch(mp mount.MountPoint, dir string) bool { - return mp.Path == dir -} - -// ExistsPath - Checks if a path exists. Unlike util ExistsPath, this call does not perform follow link. -func (mounter *CSIProxyMounterV1Beta) ExistsPath(path string) (bool, error) { - isExistsResponse, err := mounter.FsClient.PathExists(context.Background(), - &fsapi.PathExistsRequest{ - Path: mount.NormalizeWindowsPath(path), - }) - if err != nil { - return false, err - } - return isExistsResponse.Exists, err -} - -func (mounter *CSIProxyMounterV1Beta) GetDiskTotalBytes(devicePath string) (int64, error) { - DiskStatsResponse, err := mounter.DiskClient.DiskStats(context.Background(), - &diskapi.DiskStatsRequest{ - DiskID: devicePath, - }) - return DiskStatsResponse.DiskSize, err -} - -// MountSensitiveWithoutSystemd is the same as MountSensitive() but this method disable using systemd mount. -// It's unimplemented in PD CSI Driver -func (mounter *CSIProxyMounterV1Beta) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - return errors.New("MountSensitiveWithoutSystemd is not implemented") -} - -// MountSensitiveWithoutSystemdWithMountFlags is the same as MountSensitiveWithoutSystemd with additional mount flags. -// It's unimplemented in PD CSI Driver -func (mounter *CSIProxyMounterV1Beta) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error { - return errors.New("MountSensitiveWithoutSystemd is not implemented") -} diff --git a/pkg/mount-manager/safe-mounter_windows.go b/pkg/mount-manager/safe-mounter_windows.go index 4a5114d5a..5a75bf8c1 100644 --- a/pkg/mount-manager/safe-mounter_windows.go +++ b/pkg/mount-manager/safe-mounter_windows.go @@ -17,19 +17,46 @@ limitations under the License. package mountmanager import ( + "context" + "errors" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + + disk "github.com/kubernetes-csi/csi-proxy/v2/pkg/disk" + diskapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi" + + fs "github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem" + fsapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi" + + volume "github.com/kubernetes-csi/csi-proxy/v2/pkg/volume" + volumeapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi" + "k8s.io/klog/v2" "k8s.io/mount-utils" - utilexec "k8s.io/utils/exec" + "k8s.io/utils/exec" ) +func NewSafeMounter() (*mount.SafeFormatAndMount, error) { + realExec := exec.New() + csiProxyMounter, err := NewCSIProxyMounter() + if err != nil { + return nil, err + } + + return &mount.SafeFormatAndMount{ + Interface: csiProxyMounter, + Exec: realExec, + }, nil +} + // CSIProxyMounter is the mounter interface exposed as a utility to // internal methods type CSIProxyMounter interface { mount.Interface - // GetAPIVersions returns the versions of the client APIs this mounter is using. - GetAPIVersions() string - // Delete the given directory with Pod context. CSI proxy does a check for path prefix // based on context RemovePodDir(target string) error @@ -58,25 +85,292 @@ type CSIProxyMounter interface { GetDiskTotalBytes(devicePath string) (int64, error) } -func NewSafeMounter() (*mount.SafeFormatAndMount, error) { - csiProxyMounterV1, err := NewCSIProxyMounterV1() - if err == nil { - klog.V(4).Infof("using CSIProxyMounterV1, %s", csiProxyMounterV1.GetAPIVersions()) - return &mount.SafeFormatAndMount{ - Interface: csiProxyMounterV1, - Exec: utilexec.New(), - }, nil - } - klog.V(4).Infof("failed to connect to csi-proxy v1 with error=%v, will try with v1Beta", err) - - csiProxyMounterV1Beta, err := NewCSIProxyMounterV1Beta() - if err == nil { - klog.V(4).Infof("using CSIProxyMounterV1Beta, %s", csiProxyMounterV1Beta.GetAPIVersions()) - return &mount.SafeFormatAndMount{ - Interface: csiProxyMounterV1Beta, - Exec: utilexec.New(), - }, nil - } - klog.V(4).Infof("failed to connect to csi-proxy v1beta with error=%v", err) - return nil, err +// csiProxyMounter is the mounter implementation using csi proxy +type CSIProxyMounterImpl struct { + Fs fs.Interface + Disk disk.Interface + Volume volume.Interface +} + +// check that CSIProxyMounterImpl implements CSIProxyMounter +var _ CSIProxyMounter = &CSIProxyMounterImpl{} + +func NewCSIProxyMounter() (CSIProxyMounter, error) { + fsClient, err := fs.New(fsapi.New()) + if err != nil { + return nil, err + } + diskClient, err := disk.New(diskapi.New()) + if err != nil { + return nil, err + } + volumeClient, err := volume.New(volumeapi.New()) + if err != nil { + return nil, err + } + return &CSIProxyMounterImpl{ + Fs: fsClient, + Disk: diskClient, + Volume: volumeClient, + }, nil +} + +// Mount just creates a soft link at target pointing to source. +func (mounter *CSIProxyMounterImpl) Mount(source string, target string, fstype string, options []string) error { + return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) +} + +// MountSensitive is the same as Mount() but this method allows +// sensitiveOptions to be passed in a separate parameter from the normal +// mount options and ensures the sensitiveOptions are never logged. +// Since Mount here is just create a synlink, so options and sensitiveOptions +// are not used here +func (mounter *CSIProxyMounterImpl) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { + // Mount is called after the format is done. + // TODO: Confirm that fstype is empty. + // Call the LinkPath CSI proxy from the source path to the target path + parentDir := filepath.Dir(target) + if err := os.MkdirAll(parentDir, 0755); err != nil { + return err + } + createSymlinkRequest := &fs.CreateSymlinkRequest{ + SourcePath: mount.NormalizeWindowsPath(source), + TargetPath: mount.NormalizeWindowsPath(target), + } + _, err := mounter.Fs.CreateSymlink(context.Background(), createSymlinkRequest) + if err != nil { + return err + } + return nil +} + +// Delete the given directory with Pod context. CSI proxy does a check for path prefix +// based on context +func (mounter *CSIProxyMounterImpl) RemovePodDir(target string) error { + rmdirRequest := &fs.RmdirRequest{ + Path: mount.NormalizeWindowsPath(target), + Force: true, + } + _, err := mounter.Fs.Rmdir(context.Background(), rmdirRequest) + if err != nil { + return err + } + return nil +} + +// UnmountDevice uses target path to find the volume id first, and then +// call DismountVolume through csi-proxy. If succeeded, it will delete the given path +// at last step. CSI proxy does a check for path prefix +// based on context +func (mounter *CSIProxyMounterImpl) UnmountDevice(target string) error { + target = mount.NormalizeWindowsPath(target) + if exists, err := mounter.ExistsPath(target); !exists { + return err + } + idRequest := &volume.GetVolumeIDFromTargetPathRequest{ + TargetPath: target, + } + idResponse, err := mounter.Volume.GetVolumeIDFromTargetPath(context.Background(), idRequest) + if err != nil { + return err + } + volumeID := idResponse.VolumeID + + unmountRequest := &volume.UnmountVolumeRequest{ + TargetPath: target, + VolumeID: volumeID, + } + _, err = mounter.Volume.UnmountVolume(context.Background(), unmountRequest) + if err != nil { + return err + } + rmdirRequest := &fs.RmdirRequest{ + Path: target, + Force: true, + } + _, err = mounter.Fs.Rmdir(context.Background(), rmdirRequest) + if err != nil { + return err + } + + // Set disk to offline mode to have a clean state + getDiskNumberRequest := &volume.GetDiskNumberFromVolumeIDRequest{ + VolumeID: volumeID, + } + getDiskNumberResponse, err := mounter.Volume.GetDiskNumberFromVolumeID(context.Background(), getDiskNumberRequest) + if err != nil { + return err + } + diskNumber := getDiskNumberResponse.DiskNumber + klog.V(4).Infof("get disk number %d from volume %s", diskNumber, volumeID) + setDiskStateRequest := &disk.SetDiskStateRequest{ + DiskNumber: diskNumber, + IsOnline: false, + } + if _, err = mounter.Disk.SetDiskState(context.Background(), setDiskStateRequest); err != nil { + return err + } + + return nil +} + +func (mounter *CSIProxyMounterImpl) Unmount(target string) error { + return mounter.RemovePodDir(target) +} + +func (mounter *CSIProxyMounterImpl) GetDiskNumber(deviceName string, partition string, volumeKey string) (string, error) { + listRequest := &disk.ListDiskIDsRequest{} + diskIDsResponse, err := mounter.Disk.ListDiskIDs(context.Background(), listRequest) + if err != nil { + return "", err + } + diskIDsMap := diskIDsResponse.DiskIDs + for diskNum, diskInfo := range diskIDsMap { + klog.V(4).Infof("found disk number %d, disk info %v", diskNum, diskInfo) + idValue := diskInfo.Page83 + // The page83 id for gce pd has format of "Google pvc-xxxxxxx(the device name passed in here)" + if idValue == "" { + continue + } + klog.V(4).Infof("get page83 id %s", idValue) + names := strings.Fields(idValue) + if names[len(names)-1] == deviceName { + return strconv.FormatUint(uint64(diskNum), 10), nil + } + } + return "", fmt.Errorf("could not find disk number for device %s", deviceName) + +} + +// FormatAndMount accepts the source disk number, target path to mount, the fstype to format with and options to be used. +// After formatting, it will mount the disk to target path on the host +func (mounter *CSIProxyMounterImpl) FormatAndMount(source string, target string, fstype string, options []string) error { + diskNumberUint64, err := strconv.ParseUint(source, 10, 64) + if err != nil { + return err + } + diskNumber := uint32(diskNumberUint64) + + // Call PartitionDisk CSI proxy call to partition the disk and return the volume id + partionDiskRequest := &disk.PartitionDiskRequest{ + DiskNumber: diskNumber, + } + + _, err = mounter.Disk.PartitionDisk(context.Background(), partionDiskRequest) + if err != nil { + return err + } + + // make sure disk is online. if disk is already online, this call should also succeed. + setDiskStateRequest := &disk.SetDiskStateRequest{ + DiskNumber: diskNumber, + IsOnline: true, + } + _, err = mounter.Disk.SetDiskState(context.Background(), setDiskStateRequest) + if err != nil { + return err + } + + volumeIDsRequest := &volume.ListVolumesOnDiskRequest{ + DiskNumber: diskNumber, + } + volumeIDResponse, err := mounter.Volume.ListVolumesOnDisk(context.Background(), volumeIDsRequest) + if err != nil { + return err + } + // TODO: consider partitions and choose the right partition. + if len(volumeIDResponse.VolumeIDs) == 0 { + return fmt.Errorf("ListVolumesOnDisk does not return any volumes") + } + volumeID := volumeIDResponse.VolumeIDs[0] + isVolumeFormattedRequest := &volume.IsVolumeFormattedRequest{ + VolumeID: volumeID, + } + isVolumeFormattedResponse, err := mounter.Volume.IsVolumeFormatted(context.Background(), isVolumeFormattedRequest) + if err != nil { + return err + } + if !isVolumeFormattedResponse.Formatted { + formatVolumeRequest := &volume.FormatVolumeRequest{ + VolumeID: volumeID, + // TODO (jingxu97): Accept the filesystem and other options + } + _, err = mounter.Volume.FormatVolume(context.Background(), formatVolumeRequest) + if err != nil { + return err + } + } + // Mount the volume by calling the CSI proxy call. + mountVolumeRequest := &volume.MountVolumeRequest{ + VolumeID: volumeID, + TargetPath: target, + } + _, err = mounter.Volume.MountVolume(context.Background(), mountVolumeRequest) + if err != nil { + return err + } + return nil +} + +func (mounter *CSIProxyMounterImpl) GetMountRefs(pathname string) ([]string, error) { + return []string{}, fmt.Errorf("GetMountRefs not implemented for ProxyMounter") +} + +func (mounter *CSIProxyMounterImpl) IsLikelyNotMountPoint(file string) (bool, error) { + isSymlinkRequest := &fs.IsSymlinkRequest{ + Path: file, + } + + isSymlinkResponse, err := mounter.Fs.IsSymlink(context.Background(), isSymlinkRequest) + if err != nil { + return true, err + } + + return !isSymlinkResponse.IsSymlink, nil +} + +func (mounter *CSIProxyMounterImpl) List() ([]mount.MountPoint, error) { + return []mount.MountPoint{}, nil +} + +func (mounter *CSIProxyMounterImpl) IsMountPointMatch(mp mount.MountPoint, dir string) bool { + return mp.Path == dir +} + +// ExistsPath - Checks if a path exists. Unlike util ExistsPath, this call does not perform follow link. +func (mounter *CSIProxyMounterImpl) ExistsPath(path string) (bool, error) { + isExistsResponse, err := mounter.Fs.PathExists(context.Background(), + &fs.PathExistsRequest{ + Path: mount.NormalizeWindowsPath(path), + }) + if err != nil { + return false, err + } + return isExistsResponse.Exists, err +} + +func (mounter *CSIProxyMounterImpl) GetDiskTotalBytes(devicePath string) (int64, error) { + diskNumberUint64, err := strconv.ParseUint(devicePath, 10, 64) + if err != nil { + return 0, err + } + diskNumber := uint32(diskNumberUint64) + + DiskStatsResponse, err := mounter.Disk.GetDiskStats(context.Background(), + &disk.GetDiskStatsRequest{ + DiskNumber: diskNumber, + }) + return DiskStatsResponse.TotalBytes, err +} + +// MountSensitiveWithoutSystemd is the same as MountSensitive() but this method disable using systemd mount. +// It's unimplemented in PD CSI Driver +func (mounter *CSIProxyMounterImpl) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error { + return errors.New("MountSensitiveWithoutSystemd is not implemented") +} + +// MountSensitiveWithoutSystemdWithMountFlags is the same as MountSensitiveWithoutSystemd with additional mount flags. +// It's unimplemented in PD CSI Driver +func (mounter *CSIProxyMounterImpl) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error { + return errors.New("MountSensitiveWithoutSystemd is not implemented") } diff --git a/pkg/mount-manager/statter_windows.go b/pkg/mount-manager/statter_windows.go index a4c7452e2..9eea15aca 100644 --- a/pkg/mount-manager/statter_windows.go +++ b/pkg/mount-manager/statter_windows.go @@ -18,10 +18,8 @@ package mountmanager import ( "context" - "fmt" - volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" - volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" + volume "github.com/kubernetes-csi/csi-proxy/v2/pkg/volume" "k8s.io/mount-utils" ) @@ -42,65 +40,26 @@ func (r *realStatter) IsBlockDevice(fullPath string) (bool, error) { // StatFS returns volume usage information func (r *realStatter) StatFS(path string) (available, capacity, used, inodesFree, inodes, inodesUsed int64, err error) { - switch r.mounter.Interface.(type) { - case *CSIProxyMounterV1: - return r.StatFSV1(path) - case *CSIProxyMounterV1Beta: - return r.StatFSV1Beta(path) - } - - return 0, 0, 0, 0, 0, 0, fmt.Errorf("Invalid interface type=%v", r.mounter.Interface) -} - -func (r *realStatter) StatFSV1(path string) (available, capacity, used, inodesFree, inodes, inodesUsed int64, err error) { zero := int64(0) - proxy := r.mounter.Interface.(*CSIProxyMounterV1) - idRequest := &volumeapiv1.GetVolumeIDFromTargetPathRequest{ + proxy := r.mounter.Interface.(*CSIProxyMounterImpl) + idRequest := &volume.GetVolumeIDFromTargetPathRequest{ TargetPath: path, } - idResponse, err := proxy.VolumeClient.GetVolumeIDFromTargetPath(context.Background(), idRequest) - if err != nil { - return zero, zero, zero, zero, zero, zero, err - } - volumeID := idResponse.GetVolumeId() - - request := &volumeapiv1.GetVolumeStatsRequest{ - VolumeId: volumeID, - } - response, err := proxy.VolumeClient.GetVolumeStats(context.Background(), request) - if err != nil { - return zero, zero, zero, zero, zero, zero, err - } - capacity = response.GetTotalBytes() - used = response.GetUsedBytes() - available = capacity - used - return available, capacity, used, zero, zero, zero, nil -} - -func (r *realStatter) StatFSV1Beta(path string) (available, capacity, used, inodesFree, inodes, inodesUsed int64, err error) { - zero := int64(0) - - proxy := r.mounter.Interface.(*CSIProxyMounterV1Beta) - - idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{ - Mount: path, - } - idResponse, err := proxy.VolumeClient.GetVolumeIDFromMount(context.Background(), idRequest) + idResponse, err := proxy.Volume.GetVolumeIDFromTargetPath(context.Background(), idRequest) if err != nil { return zero, zero, zero, zero, zero, zero, err } - volumeID := idResponse.GetVolumeId() - request := &volumeapiv1beta1.VolumeStatsRequest{ - VolumeId: volumeID, + request := &volume.GetVolumeStatsRequest{ + VolumeID: idResponse.VolumeID, } - response, err := proxy.VolumeClient.VolumeStats(context.Background(), request) + response, err := proxy.Volume.GetVolumeStats(context.Background(), request) if err != nil { return zero, zero, zero, zero, zero, zero, err } - capacity = response.GetVolumeSize() - used = response.GetVolumeUsedSize() + capacity = response.TotalBytes + used = response.UsedBytes available = capacity - used return available, capacity, used, zero, zero, zero, nil } diff --git a/pkg/resizefs/resizefs_windows.go b/pkg/resizefs/resizefs_windows.go index a16438992..fe824358e 100644 --- a/pkg/resizefs/resizefs_windows.go +++ b/pkg/resizefs/resizefs_windows.go @@ -20,10 +20,8 @@ package resizefs import ( "context" - "fmt" - volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" - volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" + "github.com/kubernetes-csi/csi-proxy/v2/pkg/volume" "k8s.io/klog/v2" "k8s.io/mount-utils" @@ -44,58 +42,23 @@ func NewResizeFs(mounter *mount.SafeFormatAndMount) *resizeFs { // resize perform resize of file system func (resizefs *resizeFs) Resize(devicePath string, deviceMountPath string) (bool, error) { - switch resizefs.mounter.Interface.(type) { - case *mounter.CSIProxyMounterV1: - return resizefs.resizeV1(devicePath, deviceMountPath) - case *mounter.CSIProxyMounterV1Beta: - return resizefs.resizeV1Beta(devicePath, deviceMountPath) - } - return false, fmt.Errorf("resize.mounter.Interface is not valid") -} - -func (resizefs *resizeFs) resizeV1(devicePath string, deviceMountPath string) (bool, error) { klog.V(3).Infof("resizeFS.Resize - Expanding mounted volume %s", deviceMountPath) - proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1) + proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterImpl) - idRequest := &volumeapiv1.GetVolumeIDFromTargetPathRequest{ + idRequest := &volume.GetVolumeIDFromTargetPathRequest{ TargetPath: deviceMountPath, } - idResponse, err := proxy.VolumeClient.GetVolumeIDFromTargetPath(context.Background(), idRequest) - if err != nil { - return false, err - } - volumeId := idResponse.GetVolumeId() - - request := &volumeapiv1.ResizeVolumeRequest{ - VolumeId: volumeId, - } - _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) - if err != nil { - return false, err - } - return true, nil -} - -// resize perform resize of file system -func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string) (bool, error) { - klog.V(3).Infof("resizeFS.Resize - Expanding mounted volume %s", deviceMountPath) - - proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1Beta) - - idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{ - Mount: deviceMountPath, - } - idResponse, err := proxy.VolumeClient.GetVolumeIDFromMount(context.Background(), idRequest) + idResponse, err := proxy.Volume.GetVolumeIDFromTargetPath(context.Background(), idRequest) if err != nil { return false, err } - volumeId := idResponse.GetVolumeId() + volumeID := idResponse.VolumeID - request := &volumeapiv1beta1.ResizeVolumeRequest{ - VolumeId: volumeId, + request := &volume.ResizeVolumeRequest{ + VolumeID: volumeID, } - _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) + _, err = proxy.Volume.ResizeVolume(context.Background(), request) if err != nil { return false, err } diff --git a/vendor/github.com/Microsoft/go-winio/.gitignore b/vendor/github.com/Microsoft/go-winio/.gitignore deleted file mode 100644 index b883f1fdc..000000000 --- a/vendor/github.com/Microsoft/go-winio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.exe diff --git a/vendor/github.com/Microsoft/go-winio/CODEOWNERS b/vendor/github.com/Microsoft/go-winio/CODEOWNERS deleted file mode 100644 index ae1b4942b..000000000 --- a/vendor/github.com/Microsoft/go-winio/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ - * @microsoft/containerplat diff --git a/vendor/github.com/Microsoft/go-winio/LICENSE b/vendor/github.com/Microsoft/go-winio/LICENSE deleted file mode 100644 index b8b569d77..000000000 --- a/vendor/github.com/Microsoft/go-winio/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/Microsoft/go-winio/README.md b/vendor/github.com/Microsoft/go-winio/README.md deleted file mode 100644 index 568001057..000000000 --- a/vendor/github.com/Microsoft/go-winio/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# go-winio - -This repository contains utilities for efficiently performing Win32 IO operations in -Go. Currently, this is focused on accessing named pipes and other file handles, and -for using named pipes as a net transport. - -This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go -to reuse the thread to schedule another goroutine. This limits support to Windows Vista and -newer operating systems. This is similar to the implementation of network sockets in Go's net -package. - -Please see the LICENSE file for licensing information. - -This project has adopted the [Microsoft Open Source Code of -Conduct](https://opensource.microsoft.com/codeofconduct/). For more information -see the [Code of Conduct -FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional -questions or comments. - -Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe -for another named pipe implementation. diff --git a/vendor/github.com/Microsoft/go-winio/backup.go b/vendor/github.com/Microsoft/go-winio/backup.go deleted file mode 100644 index 2be34af43..000000000 --- a/vendor/github.com/Microsoft/go-winio/backup.go +++ /dev/null @@ -1,280 +0,0 @@ -// +build windows - -package winio - -import ( - "encoding/binary" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "runtime" - "syscall" - "unicode/utf16" -) - -//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead -//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite - -const ( - BackupData = uint32(iota + 1) - BackupEaData - BackupSecurity - BackupAlternateData - BackupLink - BackupPropertyData - BackupObjectId - BackupReparseData - BackupSparseBlock - BackupTxfsData -) - -const ( - StreamSparseAttributes = uint32(8) -) - -const ( - WRITE_DAC = 0x40000 - WRITE_OWNER = 0x80000 - ACCESS_SYSTEM_SECURITY = 0x1000000 -) - -// BackupHeader represents a backup stream of a file. -type BackupHeader struct { - Id uint32 // The backup stream ID - Attributes uint32 // Stream attributes - Size int64 // The size of the stream in bytes - Name string // The name of the stream (for BackupAlternateData only). - Offset int64 // The offset of the stream in the file (for BackupSparseBlock only). -} - -type win32StreamId struct { - StreamId uint32 - Attributes uint32 - Size uint64 - NameSize uint32 -} - -// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series -// of BackupHeader values. -type BackupStreamReader struct { - r io.Reader - bytesLeft int64 -} - -// NewBackupStreamReader produces a BackupStreamReader from any io.Reader. -func NewBackupStreamReader(r io.Reader) *BackupStreamReader { - return &BackupStreamReader{r, 0} -} - -// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if -// it was not completely read. -func (r *BackupStreamReader) Next() (*BackupHeader, error) { - if r.bytesLeft > 0 { - if s, ok := r.r.(io.Seeker); ok { - // Make sure Seek on io.SeekCurrent sometimes succeeds - // before trying the actual seek. - if _, err := s.Seek(0, io.SeekCurrent); err == nil { - if _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil { - return nil, err - } - r.bytesLeft = 0 - } - } - if _, err := io.Copy(ioutil.Discard, r); err != nil { - return nil, err - } - } - var wsi win32StreamId - if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil { - return nil, err - } - hdr := &BackupHeader{ - Id: wsi.StreamId, - Attributes: wsi.Attributes, - Size: int64(wsi.Size), - } - if wsi.NameSize != 0 { - name := make([]uint16, int(wsi.NameSize/2)) - if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { - return nil, err - } - hdr.Name = syscall.UTF16ToString(name) - } - if wsi.StreamId == BackupSparseBlock { - if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { - return nil, err - } - hdr.Size -= 8 - } - r.bytesLeft = hdr.Size - return hdr, nil -} - -// Read reads from the current backup stream. -func (r *BackupStreamReader) Read(b []byte) (int, error) { - if r.bytesLeft == 0 { - return 0, io.EOF - } - if int64(len(b)) > r.bytesLeft { - b = b[:r.bytesLeft] - } - n, err := r.r.Read(b) - r.bytesLeft -= int64(n) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } else if r.bytesLeft == 0 && err == nil { - err = io.EOF - } - return n, err -} - -// BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API. -type BackupStreamWriter struct { - w io.Writer - bytesLeft int64 -} - -// NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer. -func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter { - return &BackupStreamWriter{w, 0} -} - -// WriteHeader writes the next backup stream header and prepares for calls to Write(). -func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error { - if w.bytesLeft != 0 { - return fmt.Errorf("missing %d bytes", w.bytesLeft) - } - name := utf16.Encode([]rune(hdr.Name)) - wsi := win32StreamId{ - StreamId: hdr.Id, - Attributes: hdr.Attributes, - Size: uint64(hdr.Size), - NameSize: uint32(len(name) * 2), - } - if hdr.Id == BackupSparseBlock { - // Include space for the int64 block offset - wsi.Size += 8 - } - if err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil { - return err - } - if len(name) != 0 { - if err := binary.Write(w.w, binary.LittleEndian, name); err != nil { - return err - } - } - if hdr.Id == BackupSparseBlock { - if err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil { - return err - } - } - w.bytesLeft = hdr.Size - return nil -} - -// Write writes to the current backup stream. -func (w *BackupStreamWriter) Write(b []byte) (int, error) { - if w.bytesLeft < int64(len(b)) { - return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft) - } - n, err := w.w.Write(b) - w.bytesLeft -= int64(n) - return n, err -} - -// BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API. -type BackupFileReader struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true, -// Read will attempt to read the security descriptor of the file. -func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { - r := &BackupFileReader{f, includeSecurity, 0} - return r -} - -// Read reads a backup stream from the file by calling the Win32 API BackupRead(). -func (r *BackupFileReader) Read(b []byte) (int, error) { - var bytesRead uint32 - err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) - if err != nil { - return 0, &os.PathError{"BackupRead", r.f.Name(), err} - } - runtime.KeepAlive(r.f) - if bytesRead == 0 { - return 0, io.EOF - } - return int(bytesRead), nil -} - -// Close frees Win32 resources associated with the BackupFileReader. It does not close -// the underlying file. -func (r *BackupFileReader) Close() error { - if r.ctx != 0 { - backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) - runtime.KeepAlive(r.f) - r.ctx = 0 - } - return nil -} - -// BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API. -type BackupFileWriter struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true, -// Write() will attempt to restore the security descriptor from the stream. -func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { - w := &BackupFileWriter{f, includeSecurity, 0} - return w -} - -// Write restores a portion of the file using the provided backup stream. -func (w *BackupFileWriter) Write(b []byte) (int, error) { - var bytesWritten uint32 - err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) - if err != nil { - return 0, &os.PathError{"BackupWrite", w.f.Name(), err} - } - runtime.KeepAlive(w.f) - if int(bytesWritten) != len(b) { - return int(bytesWritten), errors.New("not all bytes could be written") - } - return len(b), nil -} - -// Close frees Win32 resources associated with the BackupFileWriter. It does not -// close the underlying file. -func (w *BackupFileWriter) Close() error { - if w.ctx != 0 { - backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) - runtime.KeepAlive(w.f) - w.ctx = 0 - } - return nil -} - -// OpenForBackup opens a file or directory, potentially skipping access checks if the backup -// or restore privileges have been acquired. -// -// If the file opened was a directory, it cannot be used with Readdir(). -func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { - winPath, err := syscall.UTF16FromString(path) - if err != nil { - return nil, err - } - h, err := syscall.CreateFile(&winPath[0], access, share, nil, createmode, syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, 0) - if err != nil { - err = &os.PathError{Op: "open", Path: path, Err: err} - return nil, err - } - return os.NewFile(uintptr(h), path), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/ea.go b/vendor/github.com/Microsoft/go-winio/ea.go deleted file mode 100644 index 4051c1b33..000000000 --- a/vendor/github.com/Microsoft/go-winio/ea.go +++ /dev/null @@ -1,137 +0,0 @@ -package winio - -import ( - "bytes" - "encoding/binary" - "errors" -) - -type fileFullEaInformation struct { - NextEntryOffset uint32 - Flags uint8 - NameLength uint8 - ValueLength uint16 -} - -var ( - fileFullEaInformationSize = binary.Size(&fileFullEaInformation{}) - - errInvalidEaBuffer = errors.New("invalid extended attribute buffer") - errEaNameTooLarge = errors.New("extended attribute name too large") - errEaValueTooLarge = errors.New("extended attribute value too large") -) - -// ExtendedAttribute represents a single Windows EA. -type ExtendedAttribute struct { - Name string - Value []byte - Flags uint8 -} - -func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) { - var info fileFullEaInformation - err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info) - if err != nil { - err = errInvalidEaBuffer - return - } - - nameOffset := fileFullEaInformationSize - nameLen := int(info.NameLength) - valueOffset := nameOffset + int(info.NameLength) + 1 - valueLen := int(info.ValueLength) - nextOffset := int(info.NextEntryOffset) - if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) { - err = errInvalidEaBuffer - return - } - - ea.Name = string(b[nameOffset : nameOffset+nameLen]) - ea.Value = b[valueOffset : valueOffset+valueLen] - ea.Flags = info.Flags - if info.NextEntryOffset != 0 { - nb = b[info.NextEntryOffset:] - } - return -} - -// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION -// buffer retrieved from BackupRead, ZwQueryEaFile, etc. -func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) { - for len(b) != 0 { - ea, nb, err := parseEa(b) - if err != nil { - return nil, err - } - - eas = append(eas, ea) - b = nb - } - return -} - -func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error { - if int(uint8(len(ea.Name))) != len(ea.Name) { - return errEaNameTooLarge - } - if int(uint16(len(ea.Value))) != len(ea.Value) { - return errEaValueTooLarge - } - entrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value)) - withPadding := (entrySize + 3) &^ 3 - nextOffset := uint32(0) - if !last { - nextOffset = withPadding - } - info := fileFullEaInformation{ - NextEntryOffset: nextOffset, - Flags: ea.Flags, - NameLength: uint8(len(ea.Name)), - ValueLength: uint16(len(ea.Value)), - } - - err := binary.Write(buf, binary.LittleEndian, &info) - if err != nil { - return err - } - - _, err = buf.Write([]byte(ea.Name)) - if err != nil { - return err - } - - err = buf.WriteByte(0) - if err != nil { - return err - } - - _, err = buf.Write(ea.Value) - if err != nil { - return err - } - - _, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize]) - if err != nil { - return err - } - - return nil -} - -// EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION -// buffer for use with BackupWrite, ZwSetEaFile, etc. -func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) { - var buf bytes.Buffer - for i := range eas { - last := false - if i == len(eas)-1 { - last = true - } - - err := writeEa(&buf, &eas[i], last) - if err != nil { - return nil, err - } - } - return buf.Bytes(), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/file.go b/vendor/github.com/Microsoft/go-winio/file.go deleted file mode 100644 index 0385e4108..000000000 --- a/vendor/github.com/Microsoft/go-winio/file.go +++ /dev/null @@ -1,323 +0,0 @@ -// +build windows - -package winio - -import ( - "errors" - "io" - "runtime" - "sync" - "sync/atomic" - "syscall" - "time" -) - -//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx -//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort -//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus -//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes -//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult - -type atomicBool int32 - -func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } -func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } -func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } -func (b *atomicBool) swap(new bool) bool { - var newInt int32 - if new { - newInt = 1 - } - return atomic.SwapInt32((*int32)(b), newInt) == 1 -} - -const ( - cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 - cFILE_SKIP_SET_EVENT_ON_HANDLE = 2 -) - -var ( - ErrFileClosed = errors.New("file has already been closed") - ErrTimeout = &timeoutError{} -) - -type timeoutError struct{} - -func (e *timeoutError) Error() string { return "i/o timeout" } -func (e *timeoutError) Timeout() bool { return true } -func (e *timeoutError) Temporary() bool { return true } - -type timeoutChan chan struct{} - -var ioInitOnce sync.Once -var ioCompletionPort syscall.Handle - -// ioResult contains the result of an asynchronous IO operation -type ioResult struct { - bytes uint32 - err error -} - -// ioOperation represents an outstanding asynchronous Win32 IO -type ioOperation struct { - o syscall.Overlapped - ch chan ioResult -} - -func initIo() { - h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff) - if err != nil { - panic(err) - } - ioCompletionPort = h - go ioCompletionProcessor(h) -} - -// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. -// It takes ownership of this handle and will close it if it is garbage collected. -type win32File struct { - handle syscall.Handle - wg sync.WaitGroup - wgLock sync.RWMutex - closing atomicBool - socket bool - readDeadline deadlineHandler - writeDeadline deadlineHandler -} - -type deadlineHandler struct { - setLock sync.Mutex - channel timeoutChan - channelLock sync.RWMutex - timer *time.Timer - timedout atomicBool -} - -// makeWin32File makes a new win32File from an existing file handle -func makeWin32File(h syscall.Handle) (*win32File, error) { - f := &win32File{handle: h} - ioInitOnce.Do(initIo) - _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) - if err != nil { - return nil, err - } - err = setFileCompletionNotificationModes(h, cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS|cFILE_SKIP_SET_EVENT_ON_HANDLE) - if err != nil { - return nil, err - } - f.readDeadline.channel = make(timeoutChan) - f.writeDeadline.channel = make(timeoutChan) - return f, nil -} - -func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { - // If we return the result of makeWin32File directly, it can result in an - // interface-wrapped nil, rather than a nil interface value. - f, err := makeWin32File(h) - if err != nil { - return nil, err - } - return f, nil -} - -// closeHandle closes the resources associated with a Win32 handle -func (f *win32File) closeHandle() { - f.wgLock.Lock() - // Atomically set that we are closing, releasing the resources only once. - if !f.closing.swap(true) { - f.wgLock.Unlock() - // cancel all IO and wait for it to complete - cancelIoEx(f.handle, nil) - f.wg.Wait() - // at this point, no new IO can start - syscall.Close(f.handle) - f.handle = 0 - } else { - f.wgLock.Unlock() - } -} - -// Close closes a win32File. -func (f *win32File) Close() error { - f.closeHandle() - return nil -} - -// prepareIo prepares for a new IO operation. -// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. -func (f *win32File) prepareIo() (*ioOperation, error) { - f.wgLock.RLock() - if f.closing.isSet() { - f.wgLock.RUnlock() - return nil, ErrFileClosed - } - f.wg.Add(1) - f.wgLock.RUnlock() - c := &ioOperation{} - c.ch = make(chan ioResult) - return c, nil -} - -// ioCompletionProcessor processes completed async IOs forever -func ioCompletionProcessor(h syscall.Handle) { - for { - var bytes uint32 - var key uintptr - var op *ioOperation - err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE) - if op == nil { - panic(err) - } - op.ch <- ioResult{bytes, err} - } -} - -// asyncIo processes the return value from ReadFile or WriteFile, blocking until -// the operation has actually completed. -func (f *win32File) asyncIo(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { - if err != syscall.ERROR_IO_PENDING { - return int(bytes), err - } - - if f.closing.isSet() { - cancelIoEx(f.handle, &c.o) - } - - var timeout timeoutChan - if d != nil { - d.channelLock.Lock() - timeout = d.channel - d.channelLock.Unlock() - } - - var r ioResult - select { - case r = <-c.ch: - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { - if f.closing.isSet() { - err = ErrFileClosed - } - } else if err != nil && f.socket { - // err is from Win32. Query the overlapped structure to get the winsock error. - var bytes, flags uint32 - err = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags) - } - case <-timeout: - cancelIoEx(f.handle, &c.o) - r = <-c.ch - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { - err = ErrTimeout - } - } - - // runtime.KeepAlive is needed, as c is passed via native - // code to ioCompletionProcessor, c must remain alive - // until the channel read is complete. - runtime.KeepAlive(c) - return int(r.bytes), err -} - -// Read reads from a file handle. -func (f *win32File) Read(b []byte) (int, error) { - c, err := f.prepareIo() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.readDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.ReadFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIo(c, &f.readDeadline, bytes, err) - runtime.KeepAlive(b) - - // Handle EOF conditions. - if err == nil && n == 0 && len(b) != 0 { - return 0, io.EOF - } else if err == syscall.ERROR_BROKEN_PIPE { - return 0, io.EOF - } else { - return n, err - } -} - -// Write writes to a file handle. -func (f *win32File) Write(b []byte) (int, error) { - c, err := f.prepareIo() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.writeDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.WriteFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIo(c, &f.writeDeadline, bytes, err) - runtime.KeepAlive(b) - return n, err -} - -func (f *win32File) SetReadDeadline(deadline time.Time) error { - return f.readDeadline.set(deadline) -} - -func (f *win32File) SetWriteDeadline(deadline time.Time) error { - return f.writeDeadline.set(deadline) -} - -func (f *win32File) Flush() error { - return syscall.FlushFileBuffers(f.handle) -} - -func (f *win32File) Fd() uintptr { - return uintptr(f.handle) -} - -func (d *deadlineHandler) set(deadline time.Time) error { - d.setLock.Lock() - defer d.setLock.Unlock() - - if d.timer != nil { - if !d.timer.Stop() { - <-d.channel - } - d.timer = nil - } - d.timedout.setFalse() - - select { - case <-d.channel: - d.channelLock.Lock() - d.channel = make(chan struct{}) - d.channelLock.Unlock() - default: - } - - if deadline.IsZero() { - return nil - } - - timeoutIO := func() { - d.timedout.setTrue() - close(d.channel) - } - - now := time.Now() - duration := deadline.Sub(now) - if deadline.After(now) { - // Deadline is in the future, set a timer to wait - d.timer = time.AfterFunc(duration, timeoutIO) - } else { - // Deadline is in the past. Cancel all pending IO now. - timeoutIO() - } - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/fileinfo.go b/vendor/github.com/Microsoft/go-winio/fileinfo.go deleted file mode 100644 index 3ab6bff69..000000000 --- a/vendor/github.com/Microsoft/go-winio/fileinfo.go +++ /dev/null @@ -1,73 +0,0 @@ -// +build windows - -package winio - -import ( - "os" - "runtime" - "unsafe" - - "golang.org/x/sys/windows" -) - -// FileBasicInfo contains file access time and file attributes information. -type FileBasicInfo struct { - CreationTime, LastAccessTime, LastWriteTime, ChangeTime windows.Filetime - FileAttributes uint32 - pad uint32 // padding -} - -// GetFileBasicInfo retrieves times and attributes for a file. -func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { - bi := &FileBasicInfo{} - if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), windows.FileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return bi, nil -} - -// SetFileBasicInfo sets times and attributes for a file. -func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { - if err := windows.SetFileInformationByHandle(windows.Handle(f.Fd()), windows.FileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil { - return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return nil -} - -// FileStandardInfo contains extended information for the file. -// FILE_STANDARD_INFO in WinBase.h -// https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_standard_info -type FileStandardInfo struct { - AllocationSize, EndOfFile int64 - NumberOfLinks uint32 - DeletePending, Directory bool -} - -// GetFileStandardInfo retrieves ended information for the file. -func GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) { - si := &FileStandardInfo{} - if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), windows.FileStandardInfo, (*byte)(unsafe.Pointer(si)), uint32(unsafe.Sizeof(*si))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return si, nil -} - -// FileIDInfo contains the volume serial number and file ID for a file. This pair should be -// unique on a system. -type FileIDInfo struct { - VolumeSerialNumber uint64 - FileID [16]byte -} - -// GetFileID retrieves the unique (volume, file ID) pair for a file. -func GetFileID(f *os.File) (*FileIDInfo, error) { - fileID := &FileIDInfo{} - if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), windows.FileIdInfo, (*byte)(unsafe.Pointer(fileID)), uint32(unsafe.Sizeof(*fileID))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return fileID, nil -} diff --git a/vendor/github.com/Microsoft/go-winio/hvsock.go b/vendor/github.com/Microsoft/go-winio/hvsock.go deleted file mode 100644 index b632f8f8b..000000000 --- a/vendor/github.com/Microsoft/go-winio/hvsock.go +++ /dev/null @@ -1,307 +0,0 @@ -// +build windows - -package winio - -import ( - "fmt" - "io" - "net" - "os" - "syscall" - "time" - "unsafe" - - "github.com/Microsoft/go-winio/pkg/guid" -) - -//sys bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind - -const ( - afHvSock = 34 // AF_HYPERV - - socketError = ^uintptr(0) -) - -// An HvsockAddr is an address for a AF_HYPERV socket. -type HvsockAddr struct { - VMID guid.GUID - ServiceID guid.GUID -} - -type rawHvsockAddr struct { - Family uint16 - _ uint16 - VMID guid.GUID - ServiceID guid.GUID -} - -// Network returns the address's network name, "hvsock". -func (addr *HvsockAddr) Network() string { - return "hvsock" -} - -func (addr *HvsockAddr) String() string { - return fmt.Sprintf("%s:%s", &addr.VMID, &addr.ServiceID) -} - -// VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port. -func VsockServiceID(port uint32) guid.GUID { - g, _ := guid.FromString("00000000-facb-11e6-bd58-64006a7986d3") - g.Data1 = port - return g -} - -func (addr *HvsockAddr) raw() rawHvsockAddr { - return rawHvsockAddr{ - Family: afHvSock, - VMID: addr.VMID, - ServiceID: addr.ServiceID, - } -} - -func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) { - addr.VMID = raw.VMID - addr.ServiceID = raw.ServiceID -} - -// HvsockListener is a socket listener for the AF_HYPERV address family. -type HvsockListener struct { - sock *win32File - addr HvsockAddr -} - -// HvsockConn is a connected socket of the AF_HYPERV address family. -type HvsockConn struct { - sock *win32File - local, remote HvsockAddr -} - -func newHvSocket() (*win32File, error) { - fd, err := syscall.Socket(afHvSock, syscall.SOCK_STREAM, 1) - if err != nil { - return nil, os.NewSyscallError("socket", err) - } - f, err := makeWin32File(fd) - if err != nil { - syscall.Close(fd) - return nil, err - } - f.socket = true - return f, nil -} - -// ListenHvsock listens for connections on the specified hvsock address. -func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { - l := &HvsockListener{addr: *addr} - sock, err := newHvSocket() - if err != nil { - return nil, l.opErr("listen", err) - } - sa := addr.raw() - err = bind(sock.handle, unsafe.Pointer(&sa), int32(unsafe.Sizeof(sa))) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("socket", err)) - } - err = syscall.Listen(sock.handle, 16) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("listen", err)) - } - return &HvsockListener{sock: sock, addr: *addr}, nil -} - -func (l *HvsockListener) opErr(op string, err error) error { - return &net.OpError{Op: op, Net: "hvsock", Addr: &l.addr, Err: err} -} - -// Addr returns the listener's network address. -func (l *HvsockListener) Addr() net.Addr { - return &l.addr -} - -// Accept waits for the next connection and returns it. -func (l *HvsockListener) Accept() (_ net.Conn, err error) { - sock, err := newHvSocket() - if err != nil { - return nil, l.opErr("accept", err) - } - defer func() { - if sock != nil { - sock.Close() - } - }() - c, err := l.sock.prepareIo() - if err != nil { - return nil, l.opErr("accept", err) - } - defer l.sock.wg.Done() - - // AcceptEx, per documentation, requires an extra 16 bytes per address. - const addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{})) - var addrbuf [addrlen * 2]byte - - var bytes uint32 - err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0, addrlen, addrlen, &bytes, &c.o) - _, err = l.sock.asyncIo(c, nil, bytes, err) - if err != nil { - return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) - } - conn := &HvsockConn{ - sock: sock, - } - conn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0]))) - conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) - sock = nil - return conn, nil -} - -// Close closes the listener, causing any pending Accept calls to fail. -func (l *HvsockListener) Close() error { - return l.sock.Close() -} - -/* Need to finish ConnectEx handling -func DialHvsock(ctx context.Context, addr *HvsockAddr) (*HvsockConn, error) { - sock, err := newHvSocket() - if err != nil { - return nil, err - } - defer func() { - if sock != nil { - sock.Close() - } - }() - c, err := sock.prepareIo() - if err != nil { - return nil, err - } - defer sock.wg.Done() - var bytes uint32 - err = windows.ConnectEx(windows.Handle(sock.handle), sa, nil, 0, &bytes, &c.o) - _, err = sock.asyncIo(ctx, c, nil, bytes, err) - if err != nil { - return nil, err - } - conn := &HvsockConn{ - sock: sock, - remote: *addr, - } - sock = nil - return conn, nil -} -*/ - -func (conn *HvsockConn) opErr(op string, err error) error { - return &net.OpError{Op: op, Net: "hvsock", Source: &conn.local, Addr: &conn.remote, Err: err} -} - -func (conn *HvsockConn) Read(b []byte) (int, error) { - c, err := conn.sock.prepareIo() - if err != nil { - return 0, conn.opErr("read", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var flags, bytes uint32 - err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) - n, err := conn.sock.asyncIo(c, &conn.sock.readDeadline, bytes, err) - if err != nil { - if _, ok := err.(syscall.Errno); ok { - err = os.NewSyscallError("wsarecv", err) - } - return 0, conn.opErr("read", err) - } else if n == 0 { - err = io.EOF - } - return n, err -} - -func (conn *HvsockConn) Write(b []byte) (int, error) { - t := 0 - for len(b) != 0 { - n, err := conn.write(b) - if err != nil { - return t + n, err - } - t += n - b = b[n:] - } - return t, nil -} - -func (conn *HvsockConn) write(b []byte) (int, error) { - c, err := conn.sock.prepareIo() - if err != nil { - return 0, conn.opErr("write", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var bytes uint32 - err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) - n, err := conn.sock.asyncIo(c, &conn.sock.writeDeadline, bytes, err) - if err != nil { - if _, ok := err.(syscall.Errno); ok { - err = os.NewSyscallError("wsasend", err) - } - return 0, conn.opErr("write", err) - } - return n, err -} - -// Close closes the socket connection, failing any pending read or write calls. -func (conn *HvsockConn) Close() error { - return conn.sock.Close() -} - -func (conn *HvsockConn) shutdown(how int) error { - err := syscall.Shutdown(conn.sock.handle, syscall.SHUT_RD) - if err != nil { - return os.NewSyscallError("shutdown", err) - } - return nil -} - -// CloseRead shuts down the read end of the socket. -func (conn *HvsockConn) CloseRead() error { - err := conn.shutdown(syscall.SHUT_RD) - if err != nil { - return conn.opErr("close", err) - } - return nil -} - -// CloseWrite shuts down the write end of the socket, notifying the other endpoint that -// no more data will be written. -func (conn *HvsockConn) CloseWrite() error { - err := conn.shutdown(syscall.SHUT_WR) - if err != nil { - return conn.opErr("close", err) - } - return nil -} - -// LocalAddr returns the local address of the connection. -func (conn *HvsockConn) LocalAddr() net.Addr { - return &conn.local -} - -// RemoteAddr returns the remote address of the connection. -func (conn *HvsockConn) RemoteAddr() net.Addr { - return &conn.remote -} - -// SetDeadline implements the net.Conn SetDeadline method. -func (conn *HvsockConn) SetDeadline(t time.Time) error { - conn.SetReadDeadline(t) - conn.SetWriteDeadline(t) - return nil -} - -// SetReadDeadline implements the net.Conn SetReadDeadline method. -func (conn *HvsockConn) SetReadDeadline(t time.Time) error { - return conn.sock.SetReadDeadline(t) -} - -// SetWriteDeadline implements the net.Conn SetWriteDeadline method. -func (conn *HvsockConn) SetWriteDeadline(t time.Time) error { - return conn.sock.SetWriteDeadline(t) -} diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go deleted file mode 100644 index 96700a73d..000000000 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ /dev/null @@ -1,517 +0,0 @@ -// +build windows - -package winio - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "os" - "runtime" - "syscall" - "time" - "unsafe" -) - -//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe -//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW -//sys createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateFileW -//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo -//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW -//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc -//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) = ntdll.NtCreateNamedPipeFile -//sys rtlNtStatusToDosError(status ntstatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb -//sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) = ntdll.RtlDosPathNameToNtPathName_U -//sys rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) = ntdll.RtlDefaultNpAcl - -type ioStatusBlock struct { - Status, Information uintptr -} - -type objectAttributes struct { - Length uintptr - RootDirectory uintptr - ObjectName *unicodeString - Attributes uintptr - SecurityDescriptor *securityDescriptor - SecurityQoS uintptr -} - -type unicodeString struct { - Length uint16 - MaximumLength uint16 - Buffer uintptr -} - -type securityDescriptor struct { - Revision byte - Sbz1 byte - Control uint16 - Owner uintptr - Group uintptr - Sacl uintptr - Dacl uintptr -} - -type ntstatus int32 - -func (status ntstatus) Err() error { - if status >= 0 { - return nil - } - return rtlNtStatusToDosError(status) -} - -const ( - cERROR_PIPE_BUSY = syscall.Errno(231) - cERROR_NO_DATA = syscall.Errno(232) - cERROR_PIPE_CONNECTED = syscall.Errno(535) - cERROR_SEM_TIMEOUT = syscall.Errno(121) - - cSECURITY_SQOS_PRESENT = 0x100000 - cSECURITY_ANONYMOUS = 0 - - cPIPE_TYPE_MESSAGE = 4 - - cPIPE_READMODE_MESSAGE = 2 - - cFILE_OPEN = 1 - cFILE_CREATE = 2 - - cFILE_PIPE_MESSAGE_TYPE = 1 - cFILE_PIPE_REJECT_REMOTE_CLIENTS = 2 - - cSE_DACL_PRESENT = 4 -) - -var ( - // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. - // This error should match net.errClosing since docker takes a dependency on its text. - ErrPipeListenerClosed = errors.New("use of closed network connection") - - errPipeWriteClosed = errors.New("pipe has been closed for write") -) - -type win32Pipe struct { - *win32File - path string -} - -type win32MessageBytePipe struct { - win32Pipe - writeClosed bool - readEOF bool -} - -type pipeAddress string - -func (f *win32Pipe) LocalAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) RemoteAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) SetDeadline(t time.Time) error { - f.SetReadDeadline(t) - f.SetWriteDeadline(t) - return nil -} - -// CloseWrite closes the write side of a message pipe in byte mode. -func (f *win32MessageBytePipe) CloseWrite() error { - if f.writeClosed { - return errPipeWriteClosed - } - err := f.win32File.Flush() - if err != nil { - return err - } - _, err = f.win32File.Write(nil) - if err != nil { - return err - } - f.writeClosed = true - return nil -} - -// Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since -// they are used to implement CloseWrite(). -func (f *win32MessageBytePipe) Write(b []byte) (int, error) { - if f.writeClosed { - return 0, errPipeWriteClosed - } - if len(b) == 0 { - return 0, nil - } - return f.win32File.Write(b) -} - -// Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message -// mode pipe will return io.EOF, as will all subsequent reads. -func (f *win32MessageBytePipe) Read(b []byte) (int, error) { - if f.readEOF { - return 0, io.EOF - } - n, err := f.win32File.Read(b) - if err == io.EOF { - // If this was the result of a zero-byte read, then - // it is possible that the read was due to a zero-size - // message. Since we are simulating CloseWrite with a - // zero-byte message, ensure that all future Read() calls - // also return EOF. - f.readEOF = true - } else if err == syscall.ERROR_MORE_DATA { - // ERROR_MORE_DATA indicates that the pipe's read mode is message mode - // and the message still has more bytes. Treat this as a success, since - // this package presents all named pipes as byte streams. - err = nil - } - return n, err -} - -func (s pipeAddress) Network() string { - return "pipe" -} - -func (s pipeAddress) String() string { - return string(s) -} - -// tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string, access uint32) (syscall.Handle, error) { - for { - - select { - case <-ctx.Done(): - return syscall.Handle(0), ctx.Err() - default: - h, err := createFile(*path, access, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRESENT|cSECURITY_ANONYMOUS, 0) - if err == nil { - return h, nil - } - if err != cERROR_PIPE_BUSY { - return h, &os.PathError{Err: err, Op: "open", Path: *path} - } - // Wait 10 msec and try again. This is a rather simplistic - // view, as we always try each 10 milliseconds. - time.Sleep(10 * time.Millisecond) - } - } -} - -// DialPipe connects to a named pipe by path, timing out if the connection -// takes longer than the specified duration. If timeout is nil, then we use -// a default timeout of 2 seconds. (We do not use WaitNamedPipe.) -func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { - var absTimeout time.Time - if timeout != nil { - absTimeout = time.Now().Add(*timeout) - } else { - absTimeout = time.Now().Add(2 * time.Second) - } - ctx, _ := context.WithDeadline(context.Background(), absTimeout) - conn, err := DialPipeContext(ctx, path) - if err == context.DeadlineExceeded { - return nil, ErrTimeout - } - return conn, err -} - -// DialPipeContext attempts to connect to a named pipe by `path` until `ctx` -// cancellation or timeout. -func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { - return DialPipeAccess(ctx, path, syscall.GENERIC_READ|syscall.GENERIC_WRITE) -} - -// DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` -// cancellation or timeout. -func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { - var err error - var h syscall.Handle - h, err = tryDialPipe(ctx, &path, access) - if err != nil { - return nil, err - } - - var flags uint32 - err = getNamedPipeInfo(h, &flags, nil, nil, nil) - if err != nil { - return nil, err - } - - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - - // If the pipe is in message mode, return a message byte pipe, which - // supports CloseWrite(). - if flags&cPIPE_TYPE_MESSAGE != 0 { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: f, path: path}, - }, nil - } - return &win32Pipe{win32File: f, path: path}, nil -} - -type acceptResponse struct { - f *win32File - err error -} - -type win32PipeListener struct { - firstHandle syscall.Handle - path string - config PipeConfig - acceptCh chan (chan acceptResponse) - closeCh chan int - doneCh chan int -} - -func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) { - path16, err := syscall.UTF16FromString(path) - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - var oa objectAttributes - oa.Length = unsafe.Sizeof(oa) - - var ntPath unicodeString - if err := rtlDosPathNameToNtPathName(&path16[0], &ntPath, 0, 0).Err(); err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - defer localFree(ntPath.Buffer) - oa.ObjectName = &ntPath - - // The security descriptor is only needed for the first pipe. - if first { - if sd != nil { - len := uint32(len(sd)) - sdb := localAlloc(0, len) - defer localFree(sdb) - copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) - oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) - } else { - // Construct the default named pipe security descriptor. - var dacl uintptr - if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { - return 0, fmt.Errorf("getting default named pipe ACL: %s", err) - } - defer localFree(dacl) - - sdb := &securityDescriptor{ - Revision: 1, - Control: cSE_DACL_PRESENT, - Dacl: dacl, - } - oa.SecurityDescriptor = sdb - } - } - - typ := uint32(cFILE_PIPE_REJECT_REMOTE_CLIENTS) - if c.MessageMode { - typ |= cFILE_PIPE_MESSAGE_TYPE - } - - disposition := uint32(cFILE_OPEN) - access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE) - if first { - disposition = cFILE_CREATE - // By not asking for read or write access, the named pipe file system - // will put this pipe into an initially disconnected state, blocking - // client connections until the next call with first == false. - access = syscall.SYNCHRONIZE - } - - timeout := int64(-50 * 10000) // 50ms - - var ( - h syscall.Handle - iosb ioStatusBlock - ) - err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, disposition, 0, typ, 0, 0, 0xffffffff, uint32(c.InputBufferSize), uint32(c.OutputBufferSize), &timeout).Err() - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - runtime.KeepAlive(ntPath) - return h, nil -} - -func (l *win32PipeListener) makeServerPipe() (*win32File, error) { - h, err := makeServerPipeHandle(l.path, nil, &l.config, false) - if err != nil { - return nil, err - } - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - return f, nil -} - -func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) { - p, err := l.makeServerPipe() - if err != nil { - return nil, err - } - - // Wait for the client to connect. - ch := make(chan error) - go func(p *win32File) { - ch <- connectPipe(p) - }(p) - - select { - case err = <-ch: - if err != nil { - p.Close() - p = nil - } - case <-l.closeCh: - // Abort the connect request by closing the handle. - p.Close() - p = nil - err = <-ch - if err == nil || err == ErrFileClosed { - err = ErrPipeListenerClosed - } - } - return p, err -} - -func (l *win32PipeListener) listenerRoutine() { - closed := false - for !closed { - select { - case <-l.closeCh: - closed = true - case responseCh := <-l.acceptCh: - var ( - p *win32File - err error - ) - for { - p, err = l.makeConnectedServerPipe() - // If the connection was immediately closed by the client, try - // again. - if err != cERROR_NO_DATA { - break - } - } - responseCh <- acceptResponse{p, err} - closed = err == ErrPipeListenerClosed - } - } - syscall.Close(l.firstHandle) - l.firstHandle = 0 - // Notify Close() and Accept() callers that the handle has been closed. - close(l.doneCh) -} - -// PipeConfig contain configuration for the pipe listener. -type PipeConfig struct { - // SecurityDescriptor contains a Windows security descriptor in SDDL format. - SecurityDescriptor string - - // MessageMode determines whether the pipe is in byte or message mode. In either - // case the pipe is read in byte mode by default. The only practical difference in - // this implementation is that CloseWrite() is only supported for message mode pipes; - // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only - // transferred to the reader (and returned as io.EOF in this implementation) - // when the pipe is in message mode. - MessageMode bool - - // InputBufferSize specifies the size of the input buffer, in bytes. - InputBufferSize int32 - - // OutputBufferSize specifies the size of the output buffer, in bytes. - OutputBufferSize int32 -} - -// ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe. -// The pipe must not already exist. -func ListenPipe(path string, c *PipeConfig) (net.Listener, error) { - var ( - sd []byte - err error - ) - if c == nil { - c = &PipeConfig{} - } - if c.SecurityDescriptor != "" { - sd, err = SddlToSecurityDescriptor(c.SecurityDescriptor) - if err != nil { - return nil, err - } - } - h, err := makeServerPipeHandle(path, sd, c, true) - if err != nil { - return nil, err - } - l := &win32PipeListener{ - firstHandle: h, - path: path, - config: *c, - acceptCh: make(chan (chan acceptResponse)), - closeCh: make(chan int), - doneCh: make(chan int), - } - go l.listenerRoutine() - return l, nil -} - -func connectPipe(p *win32File) error { - c, err := p.prepareIo() - if err != nil { - return err - } - defer p.wg.Done() - - err = connectNamedPipe(p.handle, &c.o) - _, err = p.asyncIo(c, nil, 0, err) - if err != nil && err != cERROR_PIPE_CONNECTED { - return err - } - return nil -} - -func (l *win32PipeListener) Accept() (net.Conn, error) { - ch := make(chan acceptResponse) - select { - case l.acceptCh <- ch: - response := <-ch - err := response.err - if err != nil { - return nil, err - } - if l.config.MessageMode { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: response.f, path: l.path}, - }, nil - } - return &win32Pipe{win32File: response.f, path: l.path}, nil - case <-l.doneCh: - return nil, ErrPipeListenerClosed - } -} - -func (l *win32PipeListener) Close() error { - select { - case l.closeCh <- 1: - <-l.doneCh - case <-l.doneCh: - } - return nil -} - -func (l *win32PipeListener) Addr() net.Addr { - return pipeAddress(l.path) -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go deleted file mode 100644 index f497c0e39..000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go +++ /dev/null @@ -1,237 +0,0 @@ -// +build windows - -// Package guid provides a GUID type. The backing structure for a GUID is -// identical to that used by the golang.org/x/sys/windows GUID type. -// There are two main binary encodings used for a GUID, the big-endian encoding, -// and the Windows (mixed-endian) encoding. See here for details: -// https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding -package guid - -import ( - "crypto/rand" - "crypto/sha1" - "encoding" - "encoding/binary" - "fmt" - "strconv" - - "golang.org/x/sys/windows" -) - -// Variant specifies which GUID variant (or "type") of the GUID. It determines -// how the entirety of the rest of the GUID is interpreted. -type Variant uint8 - -// The variants specified by RFC 4122. -const ( - // VariantUnknown specifies a GUID variant which does not conform to one of - // the variant encodings specified in RFC 4122. - VariantUnknown Variant = iota - VariantNCS - VariantRFC4122 - VariantMicrosoft - VariantFuture -) - -// Version specifies how the bits in the GUID were generated. For instance, a -// version 4 GUID is randomly generated, and a version 5 is generated from the -// hash of an input string. -type Version uint8 - -var _ = (encoding.TextMarshaler)(GUID{}) -var _ = (encoding.TextUnmarshaler)(&GUID{}) - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type so that stringification and -// marshaling can be supported. The representation matches that used by native -// Windows code. -type GUID windows.GUID - -// NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122. -func NewV4() (GUID, error) { - var b [16]byte - if _, err := rand.Read(b[:]); err != nil { - return GUID{}, err - } - - g := FromArray(b) - g.setVersion(4) // Version 4 means randomly generated. - g.setVariant(VariantRFC4122) - - return g, nil -} - -// NewV5 returns a new version 5 (generated from a string via SHA-1 hashing) -// GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name, -// and the sample code treats it as a series of bytes, so we do the same here. -// -// Some implementations, such as those found on Windows, treat the name as a -// big-endian UTF16 stream of bytes. If that is desired, the string can be -// encoded as such before being passed to this function. -func NewV5(namespace GUID, name []byte) (GUID, error) { - b := sha1.New() - namespaceBytes := namespace.ToArray() - b.Write(namespaceBytes[:]) - b.Write(name) - - a := [16]byte{} - copy(a[:], b.Sum(nil)) - - g := FromArray(a) - g.setVersion(5) // Version 5 means generated from a string. - g.setVariant(VariantRFC4122) - - return g, nil -} - -func fromArray(b [16]byte, order binary.ByteOrder) GUID { - var g GUID - g.Data1 = order.Uint32(b[0:4]) - g.Data2 = order.Uint16(b[4:6]) - g.Data3 = order.Uint16(b[6:8]) - copy(g.Data4[:], b[8:16]) - return g -} - -func (g GUID) toArray(order binary.ByteOrder) [16]byte { - b := [16]byte{} - order.PutUint32(b[0:4], g.Data1) - order.PutUint16(b[4:6], g.Data2) - order.PutUint16(b[6:8], g.Data3) - copy(b[8:16], g.Data4[:]) - return b -} - -// FromArray constructs a GUID from a big-endian encoding array of 16 bytes. -func FromArray(b [16]byte) GUID { - return fromArray(b, binary.BigEndian) -} - -// ToArray returns an array of 16 bytes representing the GUID in big-endian -// encoding. -func (g GUID) ToArray() [16]byte { - return g.toArray(binary.BigEndian) -} - -// FromWindowsArray constructs a GUID from a Windows encoding array of bytes. -func FromWindowsArray(b [16]byte) GUID { - return fromArray(b, binary.LittleEndian) -} - -// ToWindowsArray returns an array of 16 bytes representing the GUID in Windows -// encoding. -func (g GUID) ToWindowsArray() [16]byte { - return g.toArray(binary.LittleEndian) -} - -func (g GUID) String() string { - return fmt.Sprintf( - "%08x-%04x-%04x-%04x-%012x", - g.Data1, - g.Data2, - g.Data3, - g.Data4[:2], - g.Data4[2:]) -} - -// FromString parses a string containing a GUID and returns the GUID. The only -// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` -// format. -func FromString(s string) (GUID, error) { - if len(s) != 36 { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - - var g GUID - - data1, err := strconv.ParseUint(s[0:8], 16, 32) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data1 = uint32(data1) - - data2, err := strconv.ParseUint(s[9:13], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data2 = uint16(data2) - - data3, err := strconv.ParseUint(s[14:18], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data3 = uint16(data3) - - for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} { - v, err := strconv.ParseUint(s[x:x+2], 16, 8) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data4[i] = uint8(v) - } - - return g, nil -} - -func (g *GUID) setVariant(v Variant) { - d := g.Data4[0] - switch v { - case VariantNCS: - d = (d & 0x7f) - case VariantRFC4122: - d = (d & 0x3f) | 0x80 - case VariantMicrosoft: - d = (d & 0x1f) | 0xc0 - case VariantFuture: - d = (d & 0x0f) | 0xe0 - case VariantUnknown: - fallthrough - default: - panic(fmt.Sprintf("invalid variant: %d", v)) - } - g.Data4[0] = d -} - -// Variant returns the GUID variant, as defined in RFC 4122. -func (g GUID) Variant() Variant { - b := g.Data4[0] - if b&0x80 == 0 { - return VariantNCS - } else if b&0xc0 == 0x80 { - return VariantRFC4122 - } else if b&0xe0 == 0xc0 { - return VariantMicrosoft - } else if b&0xe0 == 0xe0 { - return VariantFuture - } - return VariantUnknown -} - -func (g *GUID) setVersion(v Version) { - g.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12) -} - -// Version returns the GUID version, as defined in RFC 4122. -func (g GUID) Version() Version { - return Version((g.Data3 & 0xF000) >> 12) -} - -// MarshalText returns the textual representation of the GUID. -func (g GUID) MarshalText() ([]byte, error) { - return []byte(g.String()), nil -} - -// UnmarshalText takes the textual representation of a GUID, and unmarhals it -// into this GUID. -func (g *GUID) UnmarshalText(text []byte) error { - g2, err := FromString(string(text)) - if err != nil { - return err - } - *g = g2 - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/privilege.go b/vendor/github.com/Microsoft/go-winio/privilege.go deleted file mode 100644 index 9c83d36fe..000000000 --- a/vendor/github.com/Microsoft/go-winio/privilege.go +++ /dev/null @@ -1,202 +0,0 @@ -// +build windows - -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "runtime" - "sync" - "syscall" - "unicode/utf16" - - "golang.org/x/sys/windows" -) - -//sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges -//sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf -//sys revertToSelf() (err error) = advapi32.RevertToSelf -//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken -//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread -//sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW -//sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW -//sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW - -const ( - SE_PRIVILEGE_ENABLED = 2 - - ERROR_NOT_ALL_ASSIGNED syscall.Errno = 1300 - - SeBackupPrivilege = "SeBackupPrivilege" - SeRestorePrivilege = "SeRestorePrivilege" -) - -const ( - securityAnonymous = iota - securityIdentification - securityImpersonation - securityDelegation -) - -var ( - privNames = make(map[string]uint64) - privNameMutex sync.Mutex -) - -// PrivilegeError represents an error enabling privileges. -type PrivilegeError struct { - privileges []uint64 -} - -func (e *PrivilegeError) Error() string { - s := "" - if len(e.privileges) > 1 { - s = "Could not enable privileges " - } else { - s = "Could not enable privilege " - } - for i, p := range e.privileges { - if i != 0 { - s += ", " - } - s += `"` - s += getPrivilegeName(p) - s += `"` - } - return s -} - -// RunWithPrivilege enables a single privilege for a function call. -func RunWithPrivilege(name string, fn func() error) error { - return RunWithPrivileges([]string{name}, fn) -} - -// RunWithPrivileges enables privileges for a function call. -func RunWithPrivileges(names []string, fn func() error) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - runtime.LockOSThread() - defer runtime.UnlockOSThread() - token, err := newThreadToken() - if err != nil { - return err - } - defer releaseThreadToken(token) - err = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED) - if err != nil { - return err - } - return fn() -} - -func mapPrivileges(names []string) ([]uint64, error) { - var privileges []uint64 - privNameMutex.Lock() - defer privNameMutex.Unlock() - for _, name := range names { - p, ok := privNames[name] - if !ok { - err := lookupPrivilegeValue("", name, &p) - if err != nil { - return nil, err - } - privNames[name] = p - } - privileges = append(privileges, p) - } - return privileges, nil -} - -// EnableProcessPrivileges enables privileges globally for the process. -func EnableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED) -} - -// DisableProcessPrivileges disables privileges globally for the process. -func DisableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, 0) -} - -func enableDisableProcessPrivilege(names []string, action uint32) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - - p, _ := windows.GetCurrentProcess() - var token windows.Token - err = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token) - if err != nil { - return err - } - - defer token.Close() - return adjustPrivileges(token, privileges, action) -} - -func adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error { - var b bytes.Buffer - binary.Write(&b, binary.LittleEndian, uint32(len(privileges))) - for _, p := range privileges { - binary.Write(&b, binary.LittleEndian, p) - binary.Write(&b, binary.LittleEndian, action) - } - prevState := make([]byte, b.Len()) - reqSize := uint32(0) - success, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize) - if !success { - return err - } - if err == ERROR_NOT_ALL_ASSIGNED { - return &PrivilegeError{privileges} - } - return nil -} - -func getPrivilegeName(luid uint64) string { - var nameBuffer [256]uint16 - bufSize := uint32(len(nameBuffer)) - err := lookupPrivilegeName("", &luid, &nameBuffer[0], &bufSize) - if err != nil { - return fmt.Sprintf("", luid) - } - - var displayNameBuffer [256]uint16 - displayBufSize := uint32(len(displayNameBuffer)) - var langID uint32 - err = lookupPrivilegeDisplayName("", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID) - if err != nil { - return fmt.Sprintf("", string(utf16.Decode(nameBuffer[:bufSize]))) - } - - return string(utf16.Decode(displayNameBuffer[:displayBufSize])) -} - -func newThreadToken() (windows.Token, error) { - err := impersonateSelf(securityImpersonation) - if err != nil { - return 0, err - } - - var token windows.Token - err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token) - if err != nil { - rerr := revertToSelf() - if rerr != nil { - panic(rerr) - } - return 0, err - } - return token, nil -} - -func releaseThreadToken(h windows.Token) { - err := revertToSelf() - if err != nil { - panic(err) - } - h.Close() -} diff --git a/vendor/github.com/Microsoft/go-winio/reparse.go b/vendor/github.com/Microsoft/go-winio/reparse.go deleted file mode 100644 index fc1ee4d3a..000000000 --- a/vendor/github.com/Microsoft/go-winio/reparse.go +++ /dev/null @@ -1,128 +0,0 @@ -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "strings" - "unicode/utf16" - "unsafe" -) - -const ( - reparseTagMountPoint = 0xA0000003 - reparseTagSymlink = 0xA000000C -) - -type reparseDataBuffer struct { - ReparseTag uint32 - ReparseDataLength uint16 - Reserved uint16 - SubstituteNameOffset uint16 - SubstituteNameLength uint16 - PrintNameOffset uint16 - PrintNameLength uint16 -} - -// ReparsePoint describes a Win32 symlink or mount point. -type ReparsePoint struct { - Target string - IsMountPoint bool -} - -// UnsupportedReparsePointError is returned when trying to decode a non-symlink or -// mount point reparse point. -type UnsupportedReparsePointError struct { - Tag uint32 -} - -func (e *UnsupportedReparsePointError) Error() string { - return fmt.Sprintf("unsupported reparse point %x", e.Tag) -} - -// DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink -// or a mount point. -func DecodeReparsePoint(b []byte) (*ReparsePoint, error) { - tag := binary.LittleEndian.Uint32(b[0:4]) - return DecodeReparsePointData(tag, b[8:]) -} - -func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) { - isMountPoint := false - switch tag { - case reparseTagMountPoint: - isMountPoint = true - case reparseTagSymlink: - default: - return nil, &UnsupportedReparsePointError{tag} - } - nameOffset := 8 + binary.LittleEndian.Uint16(b[4:6]) - if !isMountPoint { - nameOffset += 4 - } - nameLength := binary.LittleEndian.Uint16(b[6:8]) - name := make([]uint16, nameLength/2) - err := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name) - if err != nil { - return nil, err - } - return &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil -} - -func isDriveLetter(c byte) bool { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') -} - -// EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or -// mount point. -func EncodeReparsePoint(rp *ReparsePoint) []byte { - // Generate an NT path and determine if this is a relative path. - var ntTarget string - relative := false - if strings.HasPrefix(rp.Target, `\\?\`) { - ntTarget = `\??\` + rp.Target[4:] - } else if strings.HasPrefix(rp.Target, `\\`) { - ntTarget = `\??\UNC\` + rp.Target[2:] - } else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' { - ntTarget = `\??\` + rp.Target - } else { - ntTarget = rp.Target - relative = true - } - - // The paths must be NUL-terminated even though they are counted strings. - target16 := utf16.Encode([]rune(rp.Target + "\x00")) - ntTarget16 := utf16.Encode([]rune(ntTarget + "\x00")) - - size := int(unsafe.Sizeof(reparseDataBuffer{})) - 8 - size += len(ntTarget16)*2 + len(target16)*2 - - tag := uint32(reparseTagMountPoint) - if !rp.IsMountPoint { - tag = reparseTagSymlink - size += 4 // Add room for symlink flags - } - - data := reparseDataBuffer{ - ReparseTag: tag, - ReparseDataLength: uint16(size), - SubstituteNameOffset: 0, - SubstituteNameLength: uint16((len(ntTarget16) - 1) * 2), - PrintNameOffset: uint16(len(ntTarget16) * 2), - PrintNameLength: uint16((len(target16) - 1) * 2), - } - - var b bytes.Buffer - binary.Write(&b, binary.LittleEndian, &data) - if !rp.IsMountPoint { - flags := uint32(0) - if relative { - flags |= 1 - } - binary.Write(&b, binary.LittleEndian, flags) - } - - binary.Write(&b, binary.LittleEndian, ntTarget16) - binary.Write(&b, binary.LittleEndian, target16) - return b.Bytes() -} diff --git a/vendor/github.com/Microsoft/go-winio/sd.go b/vendor/github.com/Microsoft/go-winio/sd.go deleted file mode 100644 index db1b370a1..000000000 --- a/vendor/github.com/Microsoft/go-winio/sd.go +++ /dev/null @@ -1,98 +0,0 @@ -// +build windows - -package winio - -import ( - "syscall" - "unsafe" -) - -//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW -//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW -//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW -//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW -//sys localFree(mem uintptr) = LocalFree -//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength - -const ( - cERROR_NONE_MAPPED = syscall.Errno(1332) -) - -type AccountLookupError struct { - Name string - Err error -} - -func (e *AccountLookupError) Error() string { - if e.Name == "" { - return "lookup account: empty account name specified" - } - var s string - switch e.Err { - case cERROR_NONE_MAPPED: - s = "not found" - default: - s = e.Err.Error() - } - return "lookup account " + e.Name + ": " + s -} - -type SddlConversionError struct { - Sddl string - Err error -} - -func (e *SddlConversionError) Error() string { - return "convert " + e.Sddl + ": " + e.Err.Error() -} - -// LookupSidByName looks up the SID of an account by name -func LookupSidByName(name string) (sid string, err error) { - if name == "" { - return "", &AccountLookupError{name, cERROR_NONE_MAPPED} - } - - var sidSize, sidNameUse, refDomainSize uint32 - err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER { - return "", &AccountLookupError{name, err} - } - sidBuffer := make([]byte, sidSize) - refDomainBuffer := make([]uint16, refDomainSize) - err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) - if err != nil { - return "", &AccountLookupError{name, err} - } - var strBuffer *uint16 - err = convertSidToStringSid(&sidBuffer[0], &strBuffer) - if err != nil { - return "", &AccountLookupError{name, err} - } - sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) - localFree(uintptr(unsafe.Pointer(strBuffer))) - return sid, nil -} - -func SddlToSecurityDescriptor(sddl string) ([]byte, error) { - var sdBuffer uintptr - err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil) - if err != nil { - return nil, &SddlConversionError{sddl, err} - } - defer localFree(sdBuffer) - sd := make([]byte, getSecurityDescriptorLength(sdBuffer)) - copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)]) - return sd, nil -} - -func SecurityDescriptorToSddl(sd []byte) (string, error) { - var sddl *uint16 - // The returned string length seems to including an aribtrary number of terminating NULs. - // Don't use it. - err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil) - if err != nil { - return "", err - } - defer localFree(uintptr(unsafe.Pointer(sddl))) - return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/syscall.go b/vendor/github.com/Microsoft/go-winio/syscall.go deleted file mode 100644 index 5955c99fd..000000000 --- a/vendor/github.com/Microsoft/go-winio/syscall.go +++ /dev/null @@ -1,3 +0,0 @@ -package winio - -//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go hvsock.go diff --git a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go deleted file mode 100644 index 176ff75e3..000000000 --- a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go +++ /dev/null @@ -1,427 +0,0 @@ -// Code generated by 'go generate'; DO NOT EDIT. - -package winio - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modntdll = windows.NewLazySystemDLL("ntdll.dll") - modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - - procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") - procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") - procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") - procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") - procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") - procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") - procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") - procRevertToSelf = modadvapi32.NewProc("RevertToSelf") - procBackupRead = modkernel32.NewProc("BackupRead") - procBackupWrite = modkernel32.NewProc("BackupWrite") - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") - procCreateFileW = modkernel32.NewProc("CreateFileW") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") - procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") - procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") - procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procLocalAlloc = modkernel32.NewProc("LocalAlloc") - procLocalFree = modkernel32.NewProc("LocalFree") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") - procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") - procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") - procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") - procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") - procbind = modws2_32.NewProc("bind") -) - -func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { - var _p0 uint32 - if releaseAll { - _p0 = 1 - } - r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) - success = r0 != 0 - if true { - err = errnoErr(e1) - } - return -} - -func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertSidToStringSid(sid *byte, str **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(str) - if err != nil { - return - } - return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) -} - -func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getSecurityDescriptorLength(sd uintptr) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0) - len = uint32(r0) - return -} - -func impersonateSelf(level uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(accountName) - if err != nil { - return - } - return _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse) -} - -func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId) -} - -func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeName(_p0, luid, buffer, size) -} - -func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - var _p1 *uint16 - _p1, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _lookupPrivilegeValue(_p0, _p1, luid) -} - -func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { - var _p0 uint32 - if openAsSelf { - _p0 = 1 - } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func revertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } - r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } - r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _createFile(_p0, access, mode, sa, createmode, attrs, templatefile) -} - -func _createFile(name *uint16, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - err = errnoErr(e1) - } - return -} - -func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0) - newport = syscall.Handle(r0) - if newport == 0 { - err = errnoErr(e1) - } - return -} - -func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) -} - -func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - err = errnoErr(e1) - } - return -} - -func getCurrentThread() (h syscall.Handle) { - r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) - h = syscall.Handle(r0) - return -} - -func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func localAlloc(uFlags uint32, length uint32) (ptr uintptr) { - r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0) - ptr = uintptr(r0) - return -} - -func localFree(mem uintptr) { - syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0) - return -} - -func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) - status = ntstatus(r0) - return -} - -func rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0) - status = ntstatus(r0) - return -} - -func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0) - status = ntstatus(r0) - return -} - -func rtlNtStatusToDosError(status ntstatus) (winerr error) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0) - if r0 != 0 { - winerr = syscall.Errno(r0) - } - return -} - -func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { - var _p0 uint32 - if wait { - _p0 = 1 - } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socketError { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/README.md b/vendor/github.com/kubernetes-csi/csi-proxy/client/README.md deleted file mode 100644 index 147ae4ba9..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Client go module - -This separate go module is intended to be imported by clients that want to use the CSI-proxy. - -It should strive to keep as few dependencies as possible, to make it easy to import in other repositories. diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go deleted file mode 100644 index 70bb981e9..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go +++ /dev/null @@ -1,1476 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.12.4 -// source: github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ListDiskLocationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListDiskLocationsRequest) Reset() { - *x = ListDiskLocationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDiskLocationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDiskLocationsRequest) ProtoMessage() {} - -func (x *ListDiskLocationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDiskLocationsRequest.ProtoReflect.Descriptor instead. -func (*ListDiskLocationsRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{0} -} - -type DiskLocation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Adapter string `protobuf:"bytes,1,opt,name=Adapter,proto3" json:"Adapter,omitempty"` - Bus string `protobuf:"bytes,2,opt,name=Bus,proto3" json:"Bus,omitempty"` - Target string `protobuf:"bytes,3,opt,name=Target,proto3" json:"Target,omitempty"` - LUNID string `protobuf:"bytes,4,opt,name=LUNID,proto3" json:"LUNID,omitempty"` -} - -func (x *DiskLocation) Reset() { - *x = DiskLocation{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DiskLocation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiskLocation) ProtoMessage() {} - -func (x *DiskLocation) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DiskLocation.ProtoReflect.Descriptor instead. -func (*DiskLocation) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{1} -} - -func (x *DiskLocation) GetAdapter() string { - if x != nil { - return x.Adapter - } - return "" -} - -func (x *DiskLocation) GetBus() string { - if x != nil { - return x.Bus - } - return "" -} - -func (x *DiskLocation) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -func (x *DiskLocation) GetLUNID() string { - if x != nil { - return x.LUNID - } - return "" -} - -type ListDiskLocationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map of disk number and associated with each disk device. - DiskLocations map[uint32]*DiskLocation `protobuf:"bytes,1,rep,name=disk_locations,json=diskLocations,proto3" json:"disk_locations,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ListDiskLocationsResponse) Reset() { - *x = ListDiskLocationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDiskLocationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDiskLocationsResponse) ProtoMessage() {} - -func (x *ListDiskLocationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDiskLocationsResponse.ProtoReflect.Descriptor instead. -func (*ListDiskLocationsResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{2} -} - -func (x *ListDiskLocationsResponse) GetDiskLocations() map[uint32]*DiskLocation { - if x != nil { - return x.DiskLocations - } - return nil -} - -type PartitionDiskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Disk device number of the disk to partition. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` -} - -func (x *PartitionDiskRequest) Reset() { - *x = PartitionDiskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PartitionDiskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PartitionDiskRequest) ProtoMessage() {} - -func (x *PartitionDiskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PartitionDiskRequest.ProtoReflect.Descriptor instead. -func (*PartitionDiskRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{3} -} - -func (x *PartitionDiskRequest) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -type PartitionDiskResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PartitionDiskResponse) Reset() { - *x = PartitionDiskResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PartitionDiskResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PartitionDiskResponse) ProtoMessage() {} - -func (x *PartitionDiskResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PartitionDiskResponse.ProtoReflect.Descriptor instead. -func (*PartitionDiskResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{4} -} - -type RescanRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RescanRequest) Reset() { - *x = RescanRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RescanRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RescanRequest) ProtoMessage() {} - -func (x *RescanRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RescanRequest.ProtoReflect.Descriptor instead. -func (*RescanRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{5} -} - -type RescanResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RescanResponse) Reset() { - *x = RescanResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RescanResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RescanResponse) ProtoMessage() {} - -func (x *RescanResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RescanResponse.ProtoReflect.Descriptor instead. -func (*RescanResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{6} -} - -type ListDiskIDsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListDiskIDsRequest) Reset() { - *x = ListDiskIDsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDiskIDsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDiskIDsRequest) ProtoMessage() {} - -func (x *ListDiskIDsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDiskIDsRequest.ProtoReflect.Descriptor instead. -func (*ListDiskIDsRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{7} -} - -type DiskIDs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The disk page83 id. - Page83 string `protobuf:"bytes,1,opt,name=page83,proto3" json:"page83,omitempty"` - // The disk serial number. - SerialNumber string `protobuf:"bytes,2,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"` -} - -func (x *DiskIDs) Reset() { - *x = DiskIDs{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DiskIDs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiskIDs) ProtoMessage() {} - -func (x *DiskIDs) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DiskIDs.ProtoReflect.Descriptor instead. -func (*DiskIDs) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{8} -} - -func (x *DiskIDs) GetPage83() string { - if x != nil { - return x.Page83 - } - return "" -} - -func (x *DiskIDs) GetSerialNumber() string { - if x != nil { - return x.SerialNumber - } - return "" -} - -type ListDiskIDsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map of disk numbers and disk identifiers associated with each disk device. - DiskIDs map[uint32]*DiskIDs `protobuf:"bytes,1,rep,name=diskIDs,proto3" json:"diskIDs,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // the case is intentional for protoc to generate the field as DiskIDs -} - -func (x *ListDiskIDsResponse) Reset() { - *x = ListDiskIDsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDiskIDsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDiskIDsResponse) ProtoMessage() {} - -func (x *ListDiskIDsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDiskIDsResponse.ProtoReflect.Descriptor instead. -func (*ListDiskIDsResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{9} -} - -func (x *ListDiskIDsResponse) GetDiskIDs() map[uint32]*DiskIDs { - if x != nil { - return x.DiskIDs - } - return nil -} - -type GetDiskStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Disk device number of the disk to get the stats from. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` -} - -func (x *GetDiskStatsRequest) Reset() { - *x = GetDiskStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskStatsRequest) ProtoMessage() {} - -func (x *GetDiskStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskStatsRequest.ProtoReflect.Descriptor instead. -func (*GetDiskStatsRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{10} -} - -func (x *GetDiskStatsRequest) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -type GetDiskStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Total size of the volume. - TotalBytes int64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` -} - -func (x *GetDiskStatsResponse) Reset() { - *x = GetDiskStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskStatsResponse) ProtoMessage() {} - -func (x *GetDiskStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskStatsResponse.ProtoReflect.Descriptor instead. -func (*GetDiskStatsResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{11} -} - -func (x *GetDiskStatsResponse) GetTotalBytes() int64 { - if x != nil { - return x.TotalBytes - } - return 0 -} - -type SetDiskStateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Disk device number of the disk. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` - // Online state to set for the disk. true for online, false for offline. - IsOnline bool `protobuf:"varint,2,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` -} - -func (x *SetDiskStateRequest) Reset() { - *x = SetDiskStateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetDiskStateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDiskStateRequest) ProtoMessage() {} - -func (x *SetDiskStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetDiskStateRequest.ProtoReflect.Descriptor instead. -func (*SetDiskStateRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{12} -} - -func (x *SetDiskStateRequest) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -func (x *SetDiskStateRequest) GetIsOnline() bool { - if x != nil { - return x.IsOnline - } - return false -} - -type SetDiskStateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetDiskStateResponse) Reset() { - *x = SetDiskStateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetDiskStateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDiskStateResponse) ProtoMessage() {} - -func (x *SetDiskStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetDiskStateResponse.ProtoReflect.Descriptor instead. -func (*SetDiskStateResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{13} -} - -type GetDiskStateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Disk device number of the disk. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` -} - -func (x *GetDiskStateRequest) Reset() { - *x = GetDiskStateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskStateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskStateRequest) ProtoMessage() {} - -func (x *GetDiskStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskStateRequest.ProtoReflect.Descriptor instead. -func (*GetDiskStateRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{14} -} - -func (x *GetDiskStateRequest) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -type GetDiskStateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Online state of the disk. true for online, false for offline. - IsOnline bool `protobuf:"varint,1,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` -} - -func (x *GetDiskStateResponse) Reset() { - *x = GetDiskStateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskStateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskStateResponse) ProtoMessage() {} - -func (x *GetDiskStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskStateResponse.ProtoReflect.Descriptor instead. -func (*GetDiskStateResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP(), []int{15} -} - -func (x *GetDiskStateResponse) GetIsOnline() bool { - if x != nil { - return x.IsOnline - } - return false -} - -var File_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto protoreflect.FileDescriptor - -var file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDesc = []byte{ - 0x0a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x64, 0x69, 0x73, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x1a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, - 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x68, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, - 0x42, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x42, 0x75, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x55, 0x4e, 0x49, 0x44, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x55, 0x4e, 0x49, 0x44, 0x22, 0xc8, 0x01, 0x0a, - 0x19, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x64, 0x69, - 0x73, 0x6b, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x1a, 0x52, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x22, 0x17, 0x0a, 0x15, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x73, - 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, - 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, - 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x46, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x70, 0x61, 0x67, 0x65, 0x38, 0x33, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, - 0x61, 0x67, 0x65, 0x38, 0x33, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x9e, 0x01, 0x0a, 0x13, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, - 0x6b, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x69, 0x73, - 0x6b, 0x49, 0x44, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x64, 0x69, 0x73, 0x6b, 0x49, - 0x44, 0x73, 0x1a, 0x47, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x22, 0x37, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x53, 0x0a, 0x13, - 0x53, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, - 0x65, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x22, 0x33, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, - 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, - 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x32, 0xe6, 0x03, 0x0a, 0x04, 0x44, 0x69, 0x73, 0x6b, 0x12, - 0x52, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, - 0x73, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x69, 0x73, 0x6b, 0x12, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x06, 0x52, - 0x65, 0x73, 0x63, 0x61, 0x6e, 0x12, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x63, 0x61, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x12, 0x16, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, - 0x69, 0x73, 0x6b, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x69, - 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, - 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, - 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x64, 0x69, 0x73, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescOnce sync.Once - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescData = file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDesc -) - -func file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescGZIP() []byte { - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescOnce.Do(func() { - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescData) - }) - return file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDescData -} - -var file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_goTypes = []interface{}{ - (*ListDiskLocationsRequest)(nil), // 0: v1.ListDiskLocationsRequest - (*DiskLocation)(nil), // 1: v1.DiskLocation - (*ListDiskLocationsResponse)(nil), // 2: v1.ListDiskLocationsResponse - (*PartitionDiskRequest)(nil), // 3: v1.PartitionDiskRequest - (*PartitionDiskResponse)(nil), // 4: v1.PartitionDiskResponse - (*RescanRequest)(nil), // 5: v1.RescanRequest - (*RescanResponse)(nil), // 6: v1.RescanResponse - (*ListDiskIDsRequest)(nil), // 7: v1.ListDiskIDsRequest - (*DiskIDs)(nil), // 8: v1.DiskIDs - (*ListDiskIDsResponse)(nil), // 9: v1.ListDiskIDsResponse - (*GetDiskStatsRequest)(nil), // 10: v1.GetDiskStatsRequest - (*GetDiskStatsResponse)(nil), // 11: v1.GetDiskStatsResponse - (*SetDiskStateRequest)(nil), // 12: v1.SetDiskStateRequest - (*SetDiskStateResponse)(nil), // 13: v1.SetDiskStateResponse - (*GetDiskStateRequest)(nil), // 14: v1.GetDiskStateRequest - (*GetDiskStateResponse)(nil), // 15: v1.GetDiskStateResponse - nil, // 16: v1.ListDiskLocationsResponse.DiskLocationsEntry - nil, // 17: v1.ListDiskIDsResponse.DiskIDsEntry -} -var file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_depIdxs = []int32{ - 16, // 0: v1.ListDiskLocationsResponse.disk_locations:type_name -> v1.ListDiskLocationsResponse.DiskLocationsEntry - 17, // 1: v1.ListDiskIDsResponse.diskIDs:type_name -> v1.ListDiskIDsResponse.DiskIDsEntry - 1, // 2: v1.ListDiskLocationsResponse.DiskLocationsEntry.value:type_name -> v1.DiskLocation - 8, // 3: v1.ListDiskIDsResponse.DiskIDsEntry.value:type_name -> v1.DiskIDs - 0, // 4: v1.Disk.ListDiskLocations:input_type -> v1.ListDiskLocationsRequest - 3, // 5: v1.Disk.PartitionDisk:input_type -> v1.PartitionDiskRequest - 5, // 6: v1.Disk.Rescan:input_type -> v1.RescanRequest - 7, // 7: v1.Disk.ListDiskIDs:input_type -> v1.ListDiskIDsRequest - 10, // 8: v1.Disk.GetDiskStats:input_type -> v1.GetDiskStatsRequest - 12, // 9: v1.Disk.SetDiskState:input_type -> v1.SetDiskStateRequest - 14, // 10: v1.Disk.GetDiskState:input_type -> v1.GetDiskStateRequest - 2, // 11: v1.Disk.ListDiskLocations:output_type -> v1.ListDiskLocationsResponse - 4, // 12: v1.Disk.PartitionDisk:output_type -> v1.PartitionDiskResponse - 6, // 13: v1.Disk.Rescan:output_type -> v1.RescanResponse - 9, // 14: v1.Disk.ListDiskIDs:output_type -> v1.ListDiskIDsResponse - 11, // 15: v1.Disk.GetDiskStats:output_type -> v1.GetDiskStatsResponse - 13, // 16: v1.Disk.SetDiskState:output_type -> v1.SetDiskStateResponse - 15, // 17: v1.Disk.GetDiskState:output_type -> v1.GetDiskStateResponse - 11, // [11:18] is the sub-list for method output_type - 4, // [4:11] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_init() } -func file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_init() { - if File_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDiskLocationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DiskLocation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDiskLocationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PartitionDiskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PartitionDiskResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RescanRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RescanResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDiskIDsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DiskIDs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDiskIDsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetDiskStateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetDiskStateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskStateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskStateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 18, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_goTypes, - DependencyIndexes: file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_depIdxs, - MessageInfos: file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_msgTypes, - }.Build() - File_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto = out.File - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_rawDesc = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_goTypes = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_disk_v1_api_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// DiskClient is the client API for Disk service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type DiskClient interface { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host. - ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) - // PartitionDisk initializes and partitions a disk device with the GPT partition style - // (if the disk has not been partitioned already) and returns the resulting volume device ID. - PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) - // Rescan refreshes the host's storage cache. - Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) - // ListDiskIDs returns a map of DiskID objects where the key is the disk number. - ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) - // GetDiskStats returns the stats of a disk (currently it returns the disk size). - GetDiskStats(ctx context.Context, in *GetDiskStatsRequest, opts ...grpc.CallOption) (*GetDiskStatsResponse, error) - // SetDiskState sets the offline/online state of a disk. - SetDiskState(ctx context.Context, in *SetDiskStateRequest, opts ...grpc.CallOption) (*SetDiskStateResponse, error) - // GetDiskState gets the offline/online state of a disk. - GetDiskState(ctx context.Context, in *GetDiskStateRequest, opts ...grpc.CallOption) (*GetDiskStateResponse, error) -} - -type diskClient struct { - cc grpc.ClientConnInterface -} - -func NewDiskClient(cc grpc.ClientConnInterface) DiskClient { - return &diskClient{cc} -} - -func (c *diskClient) ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) { - out := new(ListDiskLocationsResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/ListDiskLocations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) { - out := new(PartitionDiskResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/PartitionDisk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) { - out := new(RescanResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/Rescan", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) { - out := new(ListDiskIDsResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/ListDiskIDs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) GetDiskStats(ctx context.Context, in *GetDiskStatsRequest, opts ...grpc.CallOption) (*GetDiskStatsResponse, error) { - out := new(GetDiskStatsResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/GetDiskStats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) SetDiskState(ctx context.Context, in *SetDiskStateRequest, opts ...grpc.CallOption) (*SetDiskStateResponse, error) { - out := new(SetDiskStateResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/SetDiskState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) GetDiskState(ctx context.Context, in *GetDiskStateRequest, opts ...grpc.CallOption) (*GetDiskStateResponse, error) { - out := new(GetDiskStateResponse) - err := c.cc.Invoke(ctx, "/v1.Disk/GetDiskState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DiskServer is the server API for Disk service. -type DiskServer interface { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host. - ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) - // PartitionDisk initializes and partitions a disk device with the GPT partition style - // (if the disk has not been partitioned already) and returns the resulting volume device ID. - PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error) - // Rescan refreshes the host's storage cache. - Rescan(context.Context, *RescanRequest) (*RescanResponse, error) - // ListDiskIDs returns a map of DiskID objects where the key is the disk number. - ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error) - // GetDiskStats returns the stats of a disk (currently it returns the disk size). - GetDiskStats(context.Context, *GetDiskStatsRequest) (*GetDiskStatsResponse, error) - // SetDiskState sets the offline/online state of a disk. - SetDiskState(context.Context, *SetDiskStateRequest) (*SetDiskStateResponse, error) - // GetDiskState gets the offline/online state of a disk. - GetDiskState(context.Context, *GetDiskStateRequest) (*GetDiskStateResponse, error) -} - -// UnimplementedDiskServer can be embedded to have forward compatible implementations. -type UnimplementedDiskServer struct { -} - -func (*UnimplementedDiskServer) ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDiskLocations not implemented") -} -func (*UnimplementedDiskServer) PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PartitionDisk not implemented") -} -func (*UnimplementedDiskServer) Rescan(context.Context, *RescanRequest) (*RescanResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rescan not implemented") -} -func (*UnimplementedDiskServer) ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDiskIDs not implemented") -} -func (*UnimplementedDiskServer) GetDiskStats(context.Context, *GetDiskStatsRequest) (*GetDiskStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDiskStats not implemented") -} -func (*UnimplementedDiskServer) SetDiskState(context.Context, *SetDiskStateRequest) (*SetDiskStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetDiskState not implemented") -} -func (*UnimplementedDiskServer) GetDiskState(context.Context, *GetDiskStateRequest) (*GetDiskStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDiskState not implemented") -} - -func RegisterDiskServer(s *grpc.Server, srv DiskServer) { - s.RegisterService(&_Disk_serviceDesc, srv) -} - -func _Disk_ListDiskLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDiskLocationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).ListDiskLocations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/ListDiskLocations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).ListDiskLocations(ctx, req.(*ListDiskLocationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_PartitionDisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PartitionDiskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).PartitionDisk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/PartitionDisk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).PartitionDisk(ctx, req.(*PartitionDiskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_Rescan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RescanRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).Rescan(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/Rescan", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).Rescan(ctx, req.(*RescanRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_ListDiskIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDiskIDsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).ListDiskIDs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/ListDiskIDs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).ListDiskIDs(ctx, req.(*ListDiskIDsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_GetDiskStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDiskStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).GetDiskStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/GetDiskStats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).GetDiskStats(ctx, req.(*GetDiskStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_SetDiskState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetDiskStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).SetDiskState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/SetDiskState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).SetDiskState(ctx, req.(*SetDiskStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_GetDiskState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDiskStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).GetDiskState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Disk/GetDiskState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).GetDiskState(ctx, req.(*GetDiskStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Disk_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Disk", - HandlerType: (*DiskServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListDiskLocations", - Handler: _Disk_ListDiskLocations_Handler, - }, - { - MethodName: "PartitionDisk", - Handler: _Disk_PartitionDisk_Handler, - }, - { - MethodName: "Rescan", - Handler: _Disk_Rescan_Handler, - }, - { - MethodName: "ListDiskIDs", - Handler: _Disk_ListDiskIDs_Handler, - }, - { - MethodName: "GetDiskStats", - Handler: _Disk_GetDiskStats_Handler, - }, - { - MethodName: "SetDiskState", - Handler: _Disk_SetDiskState_Handler, - }, - { - MethodName: "GetDiskState", - Handler: _Disk_GetDiskState_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto deleted file mode 100644 index f73f412d6..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto +++ /dev/null @@ -1,111 +0,0 @@ -syntax = "proto3"; - -package v1; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1"; - -service Disk { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host. - rpc ListDiskLocations(ListDiskLocationsRequest) returns (ListDiskLocationsResponse) {} - - // PartitionDisk initializes and partitions a disk device with the GPT partition style - // (if the disk has not been partitioned already) and returns the resulting volume device ID. - rpc PartitionDisk(PartitionDiskRequest) returns (PartitionDiskResponse) {} - - // Rescan refreshes the host's storage cache. - rpc Rescan(RescanRequest) returns (RescanResponse) {} - - // ListDiskIDs returns a map of DiskID objects where the key is the disk number. - rpc ListDiskIDs(ListDiskIDsRequest) returns (ListDiskIDsResponse) {} - - // GetDiskStats returns the stats of a disk (currently it returns the disk size). - rpc GetDiskStats(GetDiskStatsRequest) returns (GetDiskStatsResponse) {} - - // SetDiskState sets the offline/online state of a disk. - rpc SetDiskState(SetDiskStateRequest) returns (SetDiskStateResponse) {} - - // GetDiskState gets the offline/online state of a disk. - rpc GetDiskState(GetDiskStateRequest) returns (GetDiskStateResponse) {} -} - -message ListDiskLocationsRequest { - // Intentionally empty. -} - -message DiskLocation { - string Adapter = 1; - string Bus = 2; - string Target = 3; - string LUNID = 4; -} - -message ListDiskLocationsResponse { - // Map of disk number and associated with each disk device. - map disk_locations = 1; -} - -message PartitionDiskRequest { - // Disk device number of the disk to partition. - uint32 disk_number = 1; -} - -message PartitionDiskResponse { - // Intentionally empty. -} - -message RescanRequest { - // Intentionally empty. -} - -message RescanResponse { - // Intentionally empty. -} - -message ListDiskIDsRequest { - // Intentionally empty. -} - -message DiskIDs { - // The disk page83 id. - string page83 = 1; - // The disk serial number. - string serial_number = 2; -} - -message ListDiskIDsResponse { - // Map of disk numbers and disk identifiers associated with each disk device. - map diskIDs = 1; // the case is intentional for protoc to generate the field as DiskIDs -} - -message GetDiskStatsRequest { - // Disk device number of the disk to get the stats from. - uint32 disk_number = 1; -} - -message GetDiskStatsResponse { - // Total size of the volume. - int64 total_bytes = 1; -} - -message SetDiskStateRequest { - // Disk device number of the disk. - uint32 disk_number = 1; - - // Online state to set for the disk. true for online, false for offline. - bool is_online = 2; -} - -message SetDiskStateResponse { - // Intentionally empty. -} - -message GetDiskStateRequest { - // Disk device number of the disk. - uint32 disk_number = 1; -} - -message GetDiskStateResponse { - // Online state of the disk. true for online, false for offline. - bool is_online = 1; -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go deleted file mode 100644 index 27324f1ea..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go +++ /dev/null @@ -1,1028 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto - -package v1beta2 - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ListDiskLocationsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDiskLocationsRequest) Reset() { *m = ListDiskLocationsRequest{} } -func (m *ListDiskLocationsRequest) String() string { return proto.CompactTextString(m) } -func (*ListDiskLocationsRequest) ProtoMessage() {} -func (*ListDiskLocationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{0} -} - -func (m *ListDiskLocationsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDiskLocationsRequest.Unmarshal(m, b) -} -func (m *ListDiskLocationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDiskLocationsRequest.Marshal(b, m, deterministic) -} -func (m *ListDiskLocationsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDiskLocationsRequest.Merge(m, src) -} -func (m *ListDiskLocationsRequest) XXX_Size() int { - return xxx_messageInfo_ListDiskLocationsRequest.Size(m) -} -func (m *ListDiskLocationsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListDiskLocationsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDiskLocationsRequest proto.InternalMessageInfo - -type DiskLocation struct { - Adapter string `protobuf:"bytes,1,opt,name=Adapter,proto3" json:"Adapter,omitempty"` - Bus string `protobuf:"bytes,2,opt,name=Bus,proto3" json:"Bus,omitempty"` - Target string `protobuf:"bytes,3,opt,name=Target,proto3" json:"Target,omitempty"` - LUNID string `protobuf:"bytes,4,opt,name=LUNID,proto3" json:"LUNID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiskLocation) Reset() { *m = DiskLocation{} } -func (m *DiskLocation) String() string { return proto.CompactTextString(m) } -func (*DiskLocation) ProtoMessage() {} -func (*DiskLocation) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{1} -} - -func (m *DiskLocation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiskLocation.Unmarshal(m, b) -} -func (m *DiskLocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiskLocation.Marshal(b, m, deterministic) -} -func (m *DiskLocation) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskLocation.Merge(m, src) -} -func (m *DiskLocation) XXX_Size() int { - return xxx_messageInfo_DiskLocation.Size(m) -} -func (m *DiskLocation) XXX_DiscardUnknown() { - xxx_messageInfo_DiskLocation.DiscardUnknown(m) -} - -var xxx_messageInfo_DiskLocation proto.InternalMessageInfo - -func (m *DiskLocation) GetAdapter() string { - if m != nil { - return m.Adapter - } - return "" -} - -func (m *DiskLocation) GetBus() string { - if m != nil { - return m.Bus - } - return "" -} - -func (m *DiskLocation) GetTarget() string { - if m != nil { - return m.Target - } - return "" -} - -func (m *DiskLocation) GetLUNID() string { - if m != nil { - return m.LUNID - } - return "" -} - -type ListDiskLocationsResponse struct { - // Map of disk device IDs and associated with each disk device - DiskLocations map[string]*DiskLocation `protobuf:"bytes,1,rep,name=disk_locations,json=diskLocations,proto3" json:"disk_locations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDiskLocationsResponse) Reset() { *m = ListDiskLocationsResponse{} } -func (m *ListDiskLocationsResponse) String() string { return proto.CompactTextString(m) } -func (*ListDiskLocationsResponse) ProtoMessage() {} -func (*ListDiskLocationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{2} -} - -func (m *ListDiskLocationsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDiskLocationsResponse.Unmarshal(m, b) -} -func (m *ListDiskLocationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDiskLocationsResponse.Marshal(b, m, deterministic) -} -func (m *ListDiskLocationsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDiskLocationsResponse.Merge(m, src) -} -func (m *ListDiskLocationsResponse) XXX_Size() int { - return xxx_messageInfo_ListDiskLocationsResponse.Size(m) -} -func (m *ListDiskLocationsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListDiskLocationsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDiskLocationsResponse proto.InternalMessageInfo - -func (m *ListDiskLocationsResponse) GetDiskLocations() map[string]*DiskLocation { - if m != nil { - return m.DiskLocations - } - return nil -} - -type PartitionDiskRequest struct { - // Disk device ID of the disk to partition - DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionDiskRequest) Reset() { *m = PartitionDiskRequest{} } -func (m *PartitionDiskRequest) String() string { return proto.CompactTextString(m) } -func (*PartitionDiskRequest) ProtoMessage() {} -func (*PartitionDiskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{3} -} - -func (m *PartitionDiskRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionDiskRequest.Unmarshal(m, b) -} -func (m *PartitionDiskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionDiskRequest.Marshal(b, m, deterministic) -} -func (m *PartitionDiskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionDiskRequest.Merge(m, src) -} -func (m *PartitionDiskRequest) XXX_Size() int { - return xxx_messageInfo_PartitionDiskRequest.Size(m) -} -func (m *PartitionDiskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionDiskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionDiskRequest proto.InternalMessageInfo - -func (m *PartitionDiskRequest) GetDiskID() string { - if m != nil { - return m.DiskID - } - return "" -} - -type PartitionDiskResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionDiskResponse) Reset() { *m = PartitionDiskResponse{} } -func (m *PartitionDiskResponse) String() string { return proto.CompactTextString(m) } -func (*PartitionDiskResponse) ProtoMessage() {} -func (*PartitionDiskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{4} -} - -func (m *PartitionDiskResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionDiskResponse.Unmarshal(m, b) -} -func (m *PartitionDiskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionDiskResponse.Marshal(b, m, deterministic) -} -func (m *PartitionDiskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionDiskResponse.Merge(m, src) -} -func (m *PartitionDiskResponse) XXX_Size() int { - return xxx_messageInfo_PartitionDiskResponse.Size(m) -} -func (m *PartitionDiskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionDiskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionDiskResponse proto.InternalMessageInfo - -type RescanRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RescanRequest) Reset() { *m = RescanRequest{} } -func (m *RescanRequest) String() string { return proto.CompactTextString(m) } -func (*RescanRequest) ProtoMessage() {} -func (*RescanRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{5} -} - -func (m *RescanRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RescanRequest.Unmarshal(m, b) -} -func (m *RescanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RescanRequest.Marshal(b, m, deterministic) -} -func (m *RescanRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RescanRequest.Merge(m, src) -} -func (m *RescanRequest) XXX_Size() int { - return xxx_messageInfo_RescanRequest.Size(m) -} -func (m *RescanRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RescanRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RescanRequest proto.InternalMessageInfo - -type RescanResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RescanResponse) Reset() { *m = RescanResponse{} } -func (m *RescanResponse) String() string { return proto.CompactTextString(m) } -func (*RescanResponse) ProtoMessage() {} -func (*RescanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{6} -} - -func (m *RescanResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RescanResponse.Unmarshal(m, b) -} -func (m *RescanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RescanResponse.Marshal(b, m, deterministic) -} -func (m *RescanResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RescanResponse.Merge(m, src) -} -func (m *RescanResponse) XXX_Size() int { - return xxx_messageInfo_RescanResponse.Size(m) -} -func (m *RescanResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RescanResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RescanResponse proto.InternalMessageInfo - -type ListDiskIDsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDiskIDsRequest) Reset() { *m = ListDiskIDsRequest{} } -func (m *ListDiskIDsRequest) String() string { return proto.CompactTextString(m) } -func (*ListDiskIDsRequest) ProtoMessage() {} -func (*ListDiskIDsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{7} -} - -func (m *ListDiskIDsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDiskIDsRequest.Unmarshal(m, b) -} -func (m *ListDiskIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDiskIDsRequest.Marshal(b, m, deterministic) -} -func (m *ListDiskIDsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDiskIDsRequest.Merge(m, src) -} -func (m *ListDiskIDsRequest) XXX_Size() int { - return xxx_messageInfo_ListDiskIDsRequest.Size(m) -} -func (m *ListDiskIDsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListDiskIDsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDiskIDsRequest proto.InternalMessageInfo - -type DiskIDs struct { - // Map of Disk ID types and Disk ID values - Identifiers map[string]string `protobuf:"bytes,1,rep,name=identifiers,proto3" json:"identifiers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiskIDs) Reset() { *m = DiskIDs{} } -func (m *DiskIDs) String() string { return proto.CompactTextString(m) } -func (*DiskIDs) ProtoMessage() {} -func (*DiskIDs) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{8} -} - -func (m *DiskIDs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiskIDs.Unmarshal(m, b) -} -func (m *DiskIDs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiskIDs.Marshal(b, m, deterministic) -} -func (m *DiskIDs) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskIDs.Merge(m, src) -} -func (m *DiskIDs) XXX_Size() int { - return xxx_messageInfo_DiskIDs.Size(m) -} -func (m *DiskIDs) XXX_DiscardUnknown() { - xxx_messageInfo_DiskIDs.DiscardUnknown(m) -} - -var xxx_messageInfo_DiskIDs proto.InternalMessageInfo - -func (m *DiskIDs) GetIdentifiers() map[string]string { - if m != nil { - return m.Identifiers - } - return nil -} - -type ListDiskIDsResponse struct { - // Map of disk device numbers and IDs associated with each disk device - DiskIDs map[string]*DiskIDs `protobuf:"bytes,1,rep,name=diskIDs,proto3" json:"diskIDs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDiskIDsResponse) Reset() { *m = ListDiskIDsResponse{} } -func (m *ListDiskIDsResponse) String() string { return proto.CompactTextString(m) } -func (*ListDiskIDsResponse) ProtoMessage() {} -func (*ListDiskIDsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{9} -} - -func (m *ListDiskIDsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDiskIDsResponse.Unmarshal(m, b) -} -func (m *ListDiskIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDiskIDsResponse.Marshal(b, m, deterministic) -} -func (m *ListDiskIDsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDiskIDsResponse.Merge(m, src) -} -func (m *ListDiskIDsResponse) XXX_Size() int { - return xxx_messageInfo_ListDiskIDsResponse.Size(m) -} -func (m *ListDiskIDsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListDiskIDsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDiskIDsResponse proto.InternalMessageInfo - -func (m *ListDiskIDsResponse) GetDiskIDs() map[string]*DiskIDs { - if m != nil { - return m.DiskIDs - } - return nil -} - -type DiskStatsRequest struct { - // Disk device ID of the disk to get the size from - DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiskStatsRequest) Reset() { *m = DiskStatsRequest{} } -func (m *DiskStatsRequest) String() string { return proto.CompactTextString(m) } -func (*DiskStatsRequest) ProtoMessage() {} -func (*DiskStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{10} -} - -func (m *DiskStatsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiskStatsRequest.Unmarshal(m, b) -} -func (m *DiskStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiskStatsRequest.Marshal(b, m, deterministic) -} -func (m *DiskStatsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskStatsRequest.Merge(m, src) -} -func (m *DiskStatsRequest) XXX_Size() int { - return xxx_messageInfo_DiskStatsRequest.Size(m) -} -func (m *DiskStatsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DiskStatsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DiskStatsRequest proto.InternalMessageInfo - -func (m *DiskStatsRequest) GetDiskID() string { - if m != nil { - return m.DiskID - } - return "" -} - -type DiskStatsResponse struct { - //Total size of the volume - DiskSize int64 `protobuf:"varint,1,opt,name=diskSize,proto3" json:"diskSize,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiskStatsResponse) Reset() { *m = DiskStatsResponse{} } -func (m *DiskStatsResponse) String() string { return proto.CompactTextString(m) } -func (*DiskStatsResponse) ProtoMessage() {} -func (*DiskStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{11} -} - -func (m *DiskStatsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiskStatsResponse.Unmarshal(m, b) -} -func (m *DiskStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiskStatsResponse.Marshal(b, m, deterministic) -} -func (m *DiskStatsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiskStatsResponse.Merge(m, src) -} -func (m *DiskStatsResponse) XXX_Size() int { - return xxx_messageInfo_DiskStatsResponse.Size(m) -} -func (m *DiskStatsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DiskStatsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DiskStatsResponse proto.InternalMessageInfo - -func (m *DiskStatsResponse) GetDiskSize() int64 { - if m != nil { - return m.DiskSize - } - return 0 -} - -type SetAttachStateRequest struct { - // Disk device ID (number) of the disk which state will change - DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` - // Online state to set for the disk. true for online, false for offline - IsOnline bool `protobuf:"varint,2,opt,name=isOnline,proto3" json:"isOnline,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetAttachStateRequest) Reset() { *m = SetAttachStateRequest{} } -func (m *SetAttachStateRequest) String() string { return proto.CompactTextString(m) } -func (*SetAttachStateRequest) ProtoMessage() {} -func (*SetAttachStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{12} -} - -func (m *SetAttachStateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetAttachStateRequest.Unmarshal(m, b) -} -func (m *SetAttachStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetAttachStateRequest.Marshal(b, m, deterministic) -} -func (m *SetAttachStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetAttachStateRequest.Merge(m, src) -} -func (m *SetAttachStateRequest) XXX_Size() int { - return xxx_messageInfo_SetAttachStateRequest.Size(m) -} -func (m *SetAttachStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SetAttachStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SetAttachStateRequest proto.InternalMessageInfo - -func (m *SetAttachStateRequest) GetDiskID() string { - if m != nil { - return m.DiskID - } - return "" -} - -func (m *SetAttachStateRequest) GetIsOnline() bool { - if m != nil { - return m.IsOnline - } - return false -} - -type SetAttachStateResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetAttachStateResponse) Reset() { *m = SetAttachStateResponse{} } -func (m *SetAttachStateResponse) String() string { return proto.CompactTextString(m) } -func (*SetAttachStateResponse) ProtoMessage() {} -func (*SetAttachStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{13} -} - -func (m *SetAttachStateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetAttachStateResponse.Unmarshal(m, b) -} -func (m *SetAttachStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetAttachStateResponse.Marshal(b, m, deterministic) -} -func (m *SetAttachStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetAttachStateResponse.Merge(m, src) -} -func (m *SetAttachStateResponse) XXX_Size() int { - return xxx_messageInfo_SetAttachStateResponse.Size(m) -} -func (m *SetAttachStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SetAttachStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SetAttachStateResponse proto.InternalMessageInfo - -type GetAttachStateRequest struct { - // Disk device ID (number) of the disk - DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachStateRequest) Reset() { *m = GetAttachStateRequest{} } -func (m *GetAttachStateRequest) String() string { return proto.CompactTextString(m) } -func (*GetAttachStateRequest) ProtoMessage() {} -func (*GetAttachStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{14} -} - -func (m *GetAttachStateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachStateRequest.Unmarshal(m, b) -} -func (m *GetAttachStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachStateRequest.Marshal(b, m, deterministic) -} -func (m *GetAttachStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachStateRequest.Merge(m, src) -} -func (m *GetAttachStateRequest) XXX_Size() int { - return xxx_messageInfo_GetAttachStateRequest.Size(m) -} -func (m *GetAttachStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachStateRequest proto.InternalMessageInfo - -func (m *GetAttachStateRequest) GetDiskID() string { - if m != nil { - return m.DiskID - } - return "" -} - -type GetAttachStateResponse struct { - // Online state of the disk. true for online, false for offline - IsOnline bool `protobuf:"varint,1,opt,name=isOnline,proto3" json:"isOnline,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachStateResponse) Reset() { *m = GetAttachStateResponse{} } -func (m *GetAttachStateResponse) String() string { return proto.CompactTextString(m) } -func (*GetAttachStateResponse) ProtoMessage() {} -func (*GetAttachStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b8298108b4474af1, []int{15} -} - -func (m *GetAttachStateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachStateResponse.Unmarshal(m, b) -} -func (m *GetAttachStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachStateResponse.Marshal(b, m, deterministic) -} -func (m *GetAttachStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachStateResponse.Merge(m, src) -} -func (m *GetAttachStateResponse) XXX_Size() int { - return xxx_messageInfo_GetAttachStateResponse.Size(m) -} -func (m *GetAttachStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachStateResponse proto.InternalMessageInfo - -func (m *GetAttachStateResponse) GetIsOnline() bool { - if m != nil { - return m.IsOnline - } - return false -} - -func init() { - proto.RegisterType((*ListDiskLocationsRequest)(nil), "v1beta2.ListDiskLocationsRequest") - proto.RegisterType((*DiskLocation)(nil), "v1beta2.DiskLocation") - proto.RegisterType((*ListDiskLocationsResponse)(nil), "v1beta2.ListDiskLocationsResponse") - proto.RegisterMapType((map[string]*DiskLocation)(nil), "v1beta2.ListDiskLocationsResponse.DiskLocationsEntry") - proto.RegisterType((*PartitionDiskRequest)(nil), "v1beta2.PartitionDiskRequest") - proto.RegisterType((*PartitionDiskResponse)(nil), "v1beta2.PartitionDiskResponse") - proto.RegisterType((*RescanRequest)(nil), "v1beta2.RescanRequest") - proto.RegisterType((*RescanResponse)(nil), "v1beta2.RescanResponse") - proto.RegisterType((*ListDiskIDsRequest)(nil), "v1beta2.ListDiskIDsRequest") - proto.RegisterType((*DiskIDs)(nil), "v1beta2.DiskIDs") - proto.RegisterMapType((map[string]string)(nil), "v1beta2.DiskIDs.IdentifiersEntry") - proto.RegisterType((*ListDiskIDsResponse)(nil), "v1beta2.ListDiskIDsResponse") - proto.RegisterMapType((map[string]*DiskIDs)(nil), "v1beta2.ListDiskIDsResponse.DiskIDsEntry") - proto.RegisterType((*DiskStatsRequest)(nil), "v1beta2.DiskStatsRequest") - proto.RegisterType((*DiskStatsResponse)(nil), "v1beta2.DiskStatsResponse") - proto.RegisterType((*SetAttachStateRequest)(nil), "v1beta2.SetAttachStateRequest") - proto.RegisterType((*SetAttachStateResponse)(nil), "v1beta2.SetAttachStateResponse") - proto.RegisterType((*GetAttachStateRequest)(nil), "v1beta2.GetAttachStateRequest") - proto.RegisterType((*GetAttachStateResponse)(nil), "v1beta2.GetAttachStateResponse") -} - -func init() { - proto.RegisterFile("github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto", fileDescriptor_b8298108b4474af1) -} - -var fileDescriptor_b8298108b4474af1 = []byte{ - // 647 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xdd, 0x6e, 0xd3, 0x4c, - 0x10, 0xad, 0x9b, 0xb6, 0x69, 0x27, 0x5f, 0xf3, 0xa5, 0x4b, 0x92, 0xba, 0xe6, 0xaf, 0xdd, 0x0b, - 0x54, 0x40, 0xb5, 0x45, 0x00, 0x09, 0x51, 0x81, 0xd4, 0xd6, 0x55, 0x14, 0x88, 0xa0, 0x72, 0x40, - 0x48, 0xa8, 0x12, 0x72, 0x9c, 0xa5, 0x59, 0x25, 0xd8, 0xc1, 0xbb, 0xa9, 0x08, 0x0f, 0xc1, 0x73, - 0x70, 0xc7, 0xbb, 0xf0, 0x44, 0x68, 0xed, 0xb5, 0xbb, 0x4e, 0x9c, 0x46, 0x88, 0x3b, 0xcf, 0x99, - 0x99, 0xb3, 0x67, 0xfe, 0x64, 0x38, 0xbd, 0xa0, 0xbc, 0x3f, 0xee, 0x9a, 0x5e, 0xf0, 0xc5, 0x1a, - 0x8c, 0xbb, 0x24, 0xf4, 0x09, 0x27, 0xec, 0xc0, 0x63, 0xd4, 0xf2, 0x18, 0x3d, 0x18, 0x85, 0xc1, - 0xb7, 0x89, 0xe5, 0x0d, 0x29, 0xf1, 0xb9, 0xe5, 0x8e, 0xa8, 0xd5, 0xa3, 0x6c, 0x60, 0x5d, 0x3e, - 0xea, 0x12, 0xee, 0x36, 0x04, 0x60, 0x8e, 0xc2, 0x80, 0x07, 0xa8, 0x28, 0x21, 0x6c, 0x80, 0xde, - 0xa6, 0x8c, 0xdb, 0x94, 0x0d, 0xda, 0x81, 0xe7, 0x72, 0x1a, 0xf8, 0xcc, 0x21, 0x5f, 0xc7, 0x84, - 0x71, 0xdc, 0x87, 0xff, 0x54, 0x1c, 0xe9, 0x50, 0x3c, 0xea, 0xb9, 0x23, 0x4e, 0x42, 0x5d, 0xdb, - 0xd5, 0xf6, 0x37, 0x9c, 0xc4, 0x44, 0x15, 0x28, 0x1c, 0x8f, 0x99, 0xbe, 0x1c, 0xa1, 0xe2, 0x13, - 0xd5, 0x61, 0xed, 0x9d, 0x1b, 0x5e, 0x10, 0xae, 0x17, 0x22, 0x50, 0x5a, 0xa8, 0x0a, 0xab, 0xed, - 0xf7, 0x6f, 0x5a, 0xb6, 0xbe, 0x12, 0xc1, 0xb1, 0x81, 0x7f, 0x6b, 0xb0, 0x93, 0x23, 0x83, 0x8d, - 0x02, 0x9f, 0x11, 0x74, 0x0e, 0x65, 0x51, 0xc6, 0xa7, 0x61, 0xe2, 0xd1, 0xb5, 0xdd, 0xc2, 0x7e, - 0xa9, 0xf1, 0xd4, 0x94, 0x55, 0x98, 0x73, 0x73, 0xcd, 0x0c, 0x7a, 0xea, 0xf3, 0x70, 0xe2, 0x6c, - 0xf6, 0x54, 0xcc, 0xf8, 0x00, 0x68, 0x36, 0x48, 0x54, 0x34, 0x20, 0x13, 0x59, 0xa7, 0xf8, 0x44, - 0x0f, 0x61, 0xf5, 0xd2, 0x1d, 0x8e, 0x49, 0x54, 0x65, 0xa9, 0x51, 0x4b, 0x1f, 0x57, 0xb3, 0x9d, - 0x38, 0xe6, 0xf9, 0xf2, 0x33, 0x0d, 0x9b, 0x50, 0x3d, 0x73, 0x43, 0x4e, 0x05, 0x2e, 0x62, 0x64, - 0x5b, 0x45, 0x6b, 0x84, 0x82, 0x96, 0x2d, 0xd9, 0xa5, 0x85, 0xb7, 0xa1, 0x36, 0x15, 0x1f, 0xd7, - 0x80, 0xff, 0x87, 0x4d, 0x87, 0x30, 0xcf, 0xf5, 0x93, 0xc1, 0x54, 0xa0, 0x9c, 0x00, 0x32, 0xa4, - 0x0a, 0x28, 0xe9, 0x41, 0xcb, 0x4e, 0x07, 0xf8, 0x43, 0x83, 0xa2, 0x84, 0xd0, 0x09, 0x94, 0x68, - 0x8f, 0xf8, 0x9c, 0x7e, 0xa6, 0x24, 0x4c, 0x3a, 0xb8, 0x97, 0x29, 0xa2, 0x65, 0x33, 0xb3, 0x75, - 0x15, 0x13, 0x77, 0x4b, 0xcd, 0x32, 0x5e, 0x42, 0x65, 0x3a, 0x20, 0xa7, 0x53, 0x55, 0xb5, 0x53, - 0x1b, 0x6a, 0x4b, 0x7e, 0x6a, 0x70, 0x23, 0xa3, 0x53, 0x4e, 0xf8, 0x04, 0x8a, 0x71, 0x13, 0x12, - 0x61, 0xf7, 0x67, 0x46, 0xab, 0x84, 0x27, 0x62, 0x63, 0x81, 0x49, 0xa6, 0xd1, 0x8e, 0xd7, 0x35, - 0x71, 0xe4, 0x08, 0xbb, 0x97, 0x1d, 0x61, 0x65, 0xba, 0x7a, 0x55, 0xea, 0x03, 0xa8, 0x08, 0xb4, - 0xc3, 0x5d, 0xce, 0x16, 0x4d, 0xce, 0x82, 0x2d, 0x25, 0x56, 0xd6, 0x64, 0xc0, 0xba, 0x70, 0x77, - 0xe8, 0x77, 0x12, 0x85, 0x17, 0x9c, 0xd4, 0xc6, 0xaf, 0xa1, 0xd6, 0x21, 0xfc, 0x88, 0x73, 0xd7, - 0xeb, 0x8b, 0x2c, 0xb2, 0xe0, 0x05, 0x41, 0x46, 0xd9, 0x5b, 0x7f, 0x48, 0xfd, 0x58, 0xfc, 0xba, - 0x93, 0xda, 0x58, 0x87, 0xfa, 0x34, 0x99, 0xdc, 0x0a, 0x0b, 0x6a, 0xcd, 0xbf, 0x79, 0x06, 0x3f, - 0x81, 0x7a, 0x33, 0x97, 0x2a, 0x23, 0x40, 0xcb, 0x0a, 0x68, 0xfc, 0x5a, 0x81, 0x15, 0x51, 0x3f, - 0x3a, 0x87, 0xad, 0x99, 0x4b, 0x44, 0x7b, 0xd7, 0x5d, 0x69, 0x24, 0xc7, 0xc0, 0x8b, 0x0f, 0x19, - 0x2f, 0xa1, 0x33, 0xd8, 0xcc, 0xdc, 0x07, 0xba, 0x9d, 0xa6, 0xe5, 0xdd, 0x99, 0x71, 0x67, 0x9e, - 0x3b, 0x65, 0x3c, 0x84, 0xb5, 0xf8, 0x8e, 0x50, 0x3d, 0x8d, 0xcd, 0x5c, 0x9a, 0xb1, 0x3d, 0x83, - 0xa7, 0xc9, 0xaf, 0xa0, 0xa4, 0xec, 0x26, 0xba, 0x99, 0xbf, 0xb1, 0x31, 0xcd, 0xad, 0xeb, 0xd6, - 0x19, 0x2f, 0x21, 0x1b, 0x36, 0xd2, 0x05, 0x42, 0x3b, 0x99, 0xb5, 0x54, 0x17, 0xd0, 0x30, 0xf2, - 0x5c, 0x29, 0x4b, 0x07, 0xca, 0xd9, 0x45, 0x40, 0x57, 0x2d, 0xc8, 0x5d, 0x37, 0xe3, 0xee, 0x5c, - 0xbf, 0x4a, 0xda, 0x9c, 0x47, 0xda, 0x5c, 0x40, 0xda, 0x9c, 0x43, 0x7a, 0xfc, 0xe2, 0xe3, 0xe1, - 0x3f, 0xfc, 0xc7, 0xba, 0x6b, 0xd1, 0x4f, 0xec, 0xf1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, - 0x06, 0xb4, 0xd5, 0x0d, 0x07, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// DiskClient is the client API for Disk service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type DiskClient interface { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host - ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) - // PartitionDisk initializes and partitions a disk device (if the disk has not - // been partitioned already) and returns the resulting volume device ID - PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) - // Rescan refreshes the host's storage cache - Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) - // ListDiskIDs returns a map of DiskID objects where the key is the disk number - ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) - // DiskStats returns the stats for the disk - DiskStats(ctx context.Context, in *DiskStatsRequest, opts ...grpc.CallOption) (*DiskStatsResponse, error) - // SetAttachState sets the offline/online state of a disk - SetAttachState(ctx context.Context, in *SetAttachStateRequest, opts ...grpc.CallOption) (*SetAttachStateResponse, error) - // GetAttachState gets the offline/online state of a disk - GetAttachState(ctx context.Context, in *GetAttachStateRequest, opts ...grpc.CallOption) (*GetAttachStateResponse, error) -} - -type diskClient struct { - cc grpc.ClientConnInterface -} - -func NewDiskClient(cc grpc.ClientConnInterface) DiskClient { - return &diskClient{cc} -} - -func (c *diskClient) ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) { - out := new(ListDiskLocationsResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/ListDiskLocations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) { - out := new(PartitionDiskResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/PartitionDisk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) { - out := new(RescanResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/Rescan", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) { - out := new(ListDiskIDsResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/ListDiskIDs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) DiskStats(ctx context.Context, in *DiskStatsRequest, opts ...grpc.CallOption) (*DiskStatsResponse, error) { - out := new(DiskStatsResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/DiskStats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) SetAttachState(ctx context.Context, in *SetAttachStateRequest, opts ...grpc.CallOption) (*SetAttachStateResponse, error) { - out := new(SetAttachStateResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/SetAttachState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diskClient) GetAttachState(ctx context.Context, in *GetAttachStateRequest, opts ...grpc.CallOption) (*GetAttachStateResponse, error) { - out := new(GetAttachStateResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Disk/GetAttachState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DiskServer is the server API for Disk service. -type DiskServer interface { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host - ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) - // PartitionDisk initializes and partitions a disk device (if the disk has not - // been partitioned already) and returns the resulting volume device ID - PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error) - // Rescan refreshes the host's storage cache - Rescan(context.Context, *RescanRequest) (*RescanResponse, error) - // ListDiskIDs returns a map of DiskID objects where the key is the disk number - ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error) - // DiskStats returns the stats for the disk - DiskStats(context.Context, *DiskStatsRequest) (*DiskStatsResponse, error) - // SetAttachState sets the offline/online state of a disk - SetAttachState(context.Context, *SetAttachStateRequest) (*SetAttachStateResponse, error) - // GetAttachState gets the offline/online state of a disk - GetAttachState(context.Context, *GetAttachStateRequest) (*GetAttachStateResponse, error) -} - -// UnimplementedDiskServer can be embedded to have forward compatible implementations. -type UnimplementedDiskServer struct { -} - -func (*UnimplementedDiskServer) ListDiskLocations(ctx context.Context, req *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDiskLocations not implemented") -} -func (*UnimplementedDiskServer) PartitionDisk(ctx context.Context, req *PartitionDiskRequest) (*PartitionDiskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PartitionDisk not implemented") -} -func (*UnimplementedDiskServer) Rescan(ctx context.Context, req *RescanRequest) (*RescanResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rescan not implemented") -} -func (*UnimplementedDiskServer) ListDiskIDs(ctx context.Context, req *ListDiskIDsRequest) (*ListDiskIDsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDiskIDs not implemented") -} -func (*UnimplementedDiskServer) DiskStats(ctx context.Context, req *DiskStatsRequest) (*DiskStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DiskStats not implemented") -} -func (*UnimplementedDiskServer) SetAttachState(ctx context.Context, req *SetAttachStateRequest) (*SetAttachStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetAttachState not implemented") -} -func (*UnimplementedDiskServer) GetAttachState(ctx context.Context, req *GetAttachStateRequest) (*GetAttachStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAttachState not implemented") -} - -func RegisterDiskServer(s *grpc.Server, srv DiskServer) { - s.RegisterService(&_Disk_serviceDesc, srv) -} - -func _Disk_ListDiskLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDiskLocationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).ListDiskLocations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/ListDiskLocations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).ListDiskLocations(ctx, req.(*ListDiskLocationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_PartitionDisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PartitionDiskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).PartitionDisk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/PartitionDisk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).PartitionDisk(ctx, req.(*PartitionDiskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_Rescan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RescanRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).Rescan(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/Rescan", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).Rescan(ctx, req.(*RescanRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_ListDiskIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDiskIDsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).ListDiskIDs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/ListDiskIDs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).ListDiskIDs(ctx, req.(*ListDiskIDsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_DiskStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DiskStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).DiskStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/DiskStats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).DiskStats(ctx, req.(*DiskStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_SetAttachState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetAttachStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).SetAttachState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/SetAttachState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).SetAttachState(ctx, req.(*SetAttachStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Disk_GetAttachState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAttachStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiskServer).GetAttachState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta2.Disk/GetAttachState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiskServer).GetAttachState(ctx, req.(*GetAttachStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Disk_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1beta2.Disk", - HandlerType: (*DiskServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListDiskLocations", - Handler: _Disk_ListDiskLocations_Handler, - }, - { - MethodName: "PartitionDisk", - Handler: _Disk_PartitionDisk_Handler, - }, - { - MethodName: "Rescan", - Handler: _Disk_Rescan_Handler, - }, - { - MethodName: "ListDiskIDs", - Handler: _Disk_ListDiskIDs_Handler, - }, - { - MethodName: "DiskStats", - Handler: _Disk_DiskStats_Handler, - }, - { - MethodName: "SetAttachState", - Handler: _Disk_SetAttachState_Handler, - }, - { - MethodName: "GetAttachState", - Handler: _Disk_GetAttachState_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto deleted file mode 100644 index c9f6c8f8e..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; - -package v1beta2; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2"; - -service Disk { - // ListDiskLocations returns locations of all - // disk devices enumerated by the host - rpc ListDiskLocations(ListDiskLocationsRequest) returns (ListDiskLocationsResponse) {} - - // PartitionDisk initializes and partitions a disk device (if the disk has not - // been partitioned already) and returns the resulting volume device ID - rpc PartitionDisk(PartitionDiskRequest) returns (PartitionDiskResponse) {} - - // Rescan refreshes the host's storage cache - rpc Rescan(RescanRequest) returns (RescanResponse) {} - - // ListDiskIDs returns a map of DiskID objects where the key is the disk number - rpc ListDiskIDs(ListDiskIDsRequest) returns (ListDiskIDsResponse) {} - - // DiskStats returns the stats for the disk - rpc DiskStats(DiskStatsRequest) returns (DiskStatsResponse) {} - - // SetAttachState sets the offline/online state of a disk - rpc SetAttachState(SetAttachStateRequest) returns (SetAttachStateResponse) {} - - // GetAttachState gets the offline/online state of a disk - rpc GetAttachState(GetAttachStateRequest) returns (GetAttachStateResponse) {} -} - -message ListDiskLocationsRequest { - // Intentionally empty -} - -message DiskLocation { - string Adapter = 1; - string Bus = 2; - string Target = 3; - string LUNID = 4; -} - -message ListDiskLocationsResponse { - // Map of disk device IDs and associated with each disk device - map disk_locations = 1; -} - -message PartitionDiskRequest { - // Disk device ID of the disk to partition - string diskID = 1; -} - -message PartitionDiskResponse { - // Intentionally empty -} - -message RescanRequest { - // Intentionally empty -} - -message RescanResponse { - // Intentionally empty -} - -message ListDiskIDsRequest { - // Intentionally empty -} - -message DiskIDs { - // Map of Disk ID types and Disk ID values - map identifiers = 1; -} - -message ListDiskIDsResponse { - // Map of disk device numbers and IDs associated with each disk device - map diskIDs = 1; -} - -message DiskStatsRequest { - // Disk device ID of the disk to get the size from - string diskID = 1; -} - -message DiskStatsResponse { - //Total size of the volume - int64 diskSize = 1; -} - -message SetAttachStateRequest { - // Disk device ID (number) of the disk which state will change - string diskID = 1; - - // Online state to set for the disk. true for online, false for offline - bool isOnline = 2; -} - -message SetAttachStateResponse { -} - -message GetAttachStateRequest { - // Disk device ID (number) of the disk - string diskID = 1; -} - -message GetAttachStateResponse { - // Online state of the disk. true for online, false for offline - bool isOnline = 1; -} - diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go deleted file mode 100644 index 8bf9cd654..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go +++ /dev/null @@ -1,1041 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.12.4 -// source: github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type PathExistsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The path whose existence we want to check in the host's filesystem - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *PathExistsRequest) Reset() { - *x = PathExistsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathExistsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathExistsRequest) ProtoMessage() {} - -func (x *PathExistsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PathExistsRequest.ProtoReflect.Descriptor instead. -func (*PathExistsRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{0} -} - -func (x *PathExistsRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type PathExistsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` -} - -func (x *PathExistsResponse) Reset() { - *x = PathExistsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathExistsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathExistsResponse) ProtoMessage() {} - -func (x *PathExistsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PathExistsResponse.ProtoReflect.Descriptor instead. -func (*PathExistsResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{1} -} - -func (x *PathExistsResponse) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - -type MkdirRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The path to create in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // Non-existent parent directories in the path will be automatically created. - // Directories will be created with Read and Write privileges of the Windows - // User account under which csi-proxy is started (typically LocalSystem). - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // The path parameter cannot already exist in the host's filesystem. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Maximum path length will be capped to 260 characters. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *MkdirRequest) Reset() { - *x = MkdirRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MkdirRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MkdirRequest) ProtoMessage() {} - -func (x *MkdirRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MkdirRequest.ProtoReflect.Descriptor instead. -func (*MkdirRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{2} -} - -func (x *MkdirRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type MkdirResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MkdirResponse) Reset() { - *x = MkdirResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MkdirResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MkdirResponse) ProtoMessage() {} - -func (x *MkdirResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MkdirResponse.ProtoReflect.Descriptor instead. -func (*MkdirResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{3} -} - -type RmdirRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The path to remove in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Path cannot be a file of type symlink. - // Maximum path length will be capped to 260 characters. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Force remove all contents under path (if any). - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` -} - -func (x *RmdirRequest) Reset() { - *x = RmdirRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RmdirRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RmdirRequest) ProtoMessage() {} - -func (x *RmdirRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RmdirRequest.ProtoReflect.Descriptor instead. -func (*RmdirRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{4} -} - -func (x *RmdirRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *RmdirRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type RmdirResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RmdirResponse) Reset() { - *x = RmdirResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RmdirResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RmdirResponse) ProtoMessage() {} - -func (x *RmdirResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RmdirResponse.ProtoReflect.Descriptor instead. -func (*RmdirResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{5} -} - -type CreateSymlinkRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The path of the existing directory to be linked. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs needs to match the paths specified as - // kubelet-csi-plugins-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // source_path cannot already exist in the host filesystem. - // Maximum path length will be capped to 260 characters. - SourcePath string `protobuf:"bytes,1,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"` - // Target path is the location of the new directory entry to be created in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs to match the paths specified as - // kubelet-pod-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // target_path needs to exist as a directory in the host that is empty. - // target_path cannot be a symbolic link. - // Maximum path length will be capped to 260 characters. - TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` -} - -func (x *CreateSymlinkRequest) Reset() { - *x = CreateSymlinkRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSymlinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSymlinkRequest) ProtoMessage() {} - -func (x *CreateSymlinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateSymlinkRequest.ProtoReflect.Descriptor instead. -func (*CreateSymlinkRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateSymlinkRequest) GetSourcePath() string { - if x != nil { - return x.SourcePath - } - return "" -} - -func (x *CreateSymlinkRequest) GetTargetPath() string { - if x != nil { - return x.TargetPath - } - return "" -} - -type CreateSymlinkResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreateSymlinkResponse) Reset() { - *x = CreateSymlinkResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSymlinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSymlinkResponse) ProtoMessage() {} - -func (x *CreateSymlinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateSymlinkResponse.ProtoReflect.Descriptor instead. -func (*CreateSymlinkResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{7} -} - -type IsSymlinkRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The path whose existence as a symlink we want to check in the host's filesystem. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *IsSymlinkRequest) Reset() { - *x = IsSymlinkRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsSymlinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsSymlinkRequest) ProtoMessage() {} - -func (x *IsSymlinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsSymlinkRequest.ProtoReflect.Descriptor instead. -func (*IsSymlinkRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{8} -} - -func (x *IsSymlinkRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type IsSymlinkResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Indicates whether the path in IsSymlinkRequest is a symlink. - IsSymlink bool `protobuf:"varint,1,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` -} - -func (x *IsSymlinkResponse) Reset() { - *x = IsSymlinkResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsSymlinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsSymlinkResponse) ProtoMessage() {} - -func (x *IsSymlinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsSymlinkResponse.ProtoReflect.Descriptor instead. -func (*IsSymlinkResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP(), []int{9} -} - -func (x *IsSymlinkResponse) GetIsSymlink() bool { - if x != nil { - return x.IsSymlink - } - return false -} - -var File_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto protoreflect.FileDescriptor - -var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDesc = []byte{ - 0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x27, 0x0a, 0x11, - 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x2c, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x22, 0x22, 0x0a, 0x0c, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x6b, 0x64, 0x69, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x0a, 0x0c, 0x52, 0x6d, 0x64, 0x69, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, - 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x17, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x0a, 0x10, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, - 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x32, - 0x0a, 0x11, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, - 0x6e, 0x6b, 0x32, 0xaf, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x12, 0x3d, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, - 0x15, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x68, - 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x2e, 0x0a, 0x05, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x12, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x2e, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x46, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, - 0x6b, 0x12, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, - 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x09, 0x49, 0x73, 0x53, 0x79, - 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x14, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, - 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, - 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescOnce sync.Once - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescData = file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDesc -) - -func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescGZIP() []byte { - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescOnce.Do(func() { - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescData) - }) - return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDescData -} - -var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_goTypes = []interface{}{ - (*PathExistsRequest)(nil), // 0: v1.PathExistsRequest - (*PathExistsResponse)(nil), // 1: v1.PathExistsResponse - (*MkdirRequest)(nil), // 2: v1.MkdirRequest - (*MkdirResponse)(nil), // 3: v1.MkdirResponse - (*RmdirRequest)(nil), // 4: v1.RmdirRequest - (*RmdirResponse)(nil), // 5: v1.RmdirResponse - (*CreateSymlinkRequest)(nil), // 6: v1.CreateSymlinkRequest - (*CreateSymlinkResponse)(nil), // 7: v1.CreateSymlinkResponse - (*IsSymlinkRequest)(nil), // 8: v1.IsSymlinkRequest - (*IsSymlinkResponse)(nil), // 9: v1.IsSymlinkResponse -} -var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_depIdxs = []int32{ - 0, // 0: v1.Filesystem.PathExists:input_type -> v1.PathExistsRequest - 2, // 1: v1.Filesystem.Mkdir:input_type -> v1.MkdirRequest - 4, // 2: v1.Filesystem.Rmdir:input_type -> v1.RmdirRequest - 6, // 3: v1.Filesystem.CreateSymlink:input_type -> v1.CreateSymlinkRequest - 8, // 4: v1.Filesystem.IsSymlink:input_type -> v1.IsSymlinkRequest - 1, // 5: v1.Filesystem.PathExists:output_type -> v1.PathExistsResponse - 3, // 6: v1.Filesystem.Mkdir:output_type -> v1.MkdirResponse - 5, // 7: v1.Filesystem.Rmdir:output_type -> v1.RmdirResponse - 7, // 8: v1.Filesystem.CreateSymlink:output_type -> v1.CreateSymlinkResponse - 9, // 9: v1.Filesystem.IsSymlink:output_type -> v1.IsSymlinkResponse - 5, // [5:10] is the sub-list for method output_type - 0, // [0:5] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_init() } -func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_init() { - if File_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathExistsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathExistsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MkdirRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MkdirResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RmdirRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RmdirResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSymlinkRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSymlinkResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsSymlinkRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsSymlinkResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_goTypes, - DependencyIndexes: file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_depIdxs, - MessageInfos: file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_msgTypes, - }.Build() - File_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto = out.File - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_rawDesc = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_goTypes = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1_api_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// FilesystemClient is the client API for Filesystem service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type FilesystemClient interface { - // PathExists checks if the requested path exists in the host filesystem. - PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem. - Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through CreateSymlink. - Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) - // CreateSymlink creates a symbolic link called target_path that points to source_path - // in the host filesystem (target_path is the name of the symbolic link created, - // source_path is the existing path). - CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) - // IsSymlink checks if a given path is a symlink. - IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) -} - -type filesystemClient struct { - cc grpc.ClientConnInterface -} - -func NewFilesystemClient(cc grpc.ClientConnInterface) FilesystemClient { - return &filesystemClient{cc} -} - -func (c *filesystemClient) PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) { - out := new(PathExistsResponse) - err := c.cc.Invoke(ctx, "/v1.Filesystem/PathExists", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) { - out := new(MkdirResponse) - err := c.cc.Invoke(ctx, "/v1.Filesystem/Mkdir", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) { - out := new(RmdirResponse) - err := c.cc.Invoke(ctx, "/v1.Filesystem/Rmdir", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) { - out := new(CreateSymlinkResponse) - err := c.cc.Invoke(ctx, "/v1.Filesystem/CreateSymlink", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) { - out := new(IsSymlinkResponse) - err := c.cc.Invoke(ctx, "/v1.Filesystem/IsSymlink", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// FilesystemServer is the server API for Filesystem service. -type FilesystemServer interface { - // PathExists checks if the requested path exists in the host filesystem. - PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem. - Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through CreateSymlink. - Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) - // CreateSymlink creates a symbolic link called target_path that points to source_path - // in the host filesystem (target_path is the name of the symbolic link created, - // source_path is the existing path). - CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) - // IsSymlink checks if a given path is a symlink. - IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) -} - -// UnimplementedFilesystemServer can be embedded to have forward compatible implementations. -type UnimplementedFilesystemServer struct { -} - -func (*UnimplementedFilesystemServer) PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PathExists not implemented") -} -func (*UnimplementedFilesystemServer) Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Mkdir not implemented") -} -func (*UnimplementedFilesystemServer) Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rmdir not implemented") -} -func (*UnimplementedFilesystemServer) CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSymlink not implemented") -} -func (*UnimplementedFilesystemServer) IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsSymlink not implemented") -} - -func RegisterFilesystemServer(s *grpc.Server, srv FilesystemServer) { - s.RegisterService(&_Filesystem_serviceDesc, srv) -} - -func _Filesystem_PathExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PathExistsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).PathExists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Filesystem/PathExists", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).PathExists(ctx, req.(*PathExistsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_Mkdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MkdirRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).Mkdir(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Filesystem/Mkdir", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).Mkdir(ctx, req.(*MkdirRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_Rmdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RmdirRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).Rmdir(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Filesystem/Rmdir", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).Rmdir(ctx, req.(*RmdirRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_CreateSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSymlinkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).CreateSymlink(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Filesystem/CreateSymlink", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).CreateSymlink(ctx, req.(*CreateSymlinkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_IsSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsSymlinkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).IsSymlink(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Filesystem/IsSymlink", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).IsSymlink(ctx, req.(*IsSymlinkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Filesystem_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Filesystem", - HandlerType: (*FilesystemServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PathExists", - Handler: _Filesystem_PathExists_Handler, - }, - { - MethodName: "Mkdir", - Handler: _Filesystem_Mkdir_Handler, - }, - { - MethodName: "Rmdir", - Handler: _Filesystem_Rmdir_Handler, - }, - { - MethodName: "CreateSymlink", - Handler: _Filesystem_CreateSymlink_Handler, - }, - { - MethodName: "IsSymlink", - Handler: _Filesystem_IsSymlink_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto deleted file mode 100644 index 151a1ffd4..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto +++ /dev/null @@ -1,136 +0,0 @@ -syntax = "proto3"; - -package v1; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1"; - -service Filesystem { - // PathExists checks if the requested path exists in the host filesystem. - rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - - // Mkdir creates a directory at the requested path in the host filesystem. - rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} - - // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through CreateSymlink. - rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} - - // CreateSymlink creates a symbolic link called target_path that points to source_path - // in the host filesystem (target_path is the name of the symbolic link created, - // source_path is the existing path). - rpc CreateSymlink(CreateSymlinkRequest) returns (CreateSymlinkResponse) {} - - // IsSymlink checks if a given path is a symlink. - rpc IsSymlink(IsSymlinkRequest) returns (IsSymlinkResponse) {} -} - -message PathExistsRequest { - // The path whose existence we want to check in the host's filesystem - string path = 1; -} - -message PathExistsResponse { - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool exists = 1; -} - -message MkdirRequest { - // The path to create in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // Non-existent parent directories in the path will be automatically created. - // Directories will be created with Read and Write privileges of the Windows - // User account under which csi-proxy is started (typically LocalSystem). - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // The path parameter cannot already exist in the host's filesystem. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Maximum path length will be capped to 260 characters. - string path = 1; -} - -message MkdirResponse { - // Intentionally empty. -} - -message RmdirRequest { - // The path to remove in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Path cannot be a file of type symlink. - // Maximum path length will be capped to 260 characters. - string path = 1; - - // Force remove all contents under path (if any). - bool force = 2; -} - -message RmdirResponse { - // Intentionally empty. -} - -message CreateSymlinkRequest { - // The path of the existing directory to be linked. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs needs to match the paths specified as - // kubelet-csi-plugins-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // source_path cannot already exist in the host filesystem. - // Maximum path length will be capped to 260 characters. - string source_path = 1; - - // Target path is the location of the new directory entry to be created in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs to match the paths specified as - // kubelet-pod-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // target_path needs to exist as a directory in the host that is empty. - // target_path cannot be a symbolic link. - // Maximum path length will be capped to 260 characters. - string target_path = 2; -} - -message CreateSymlinkResponse { - // Intentionally empty. -} - -message IsSymlinkRequest { - // The path whose existence as a symlink we want to check in the host's filesystem. - string path = 1; -} - -message IsSymlinkResponse { - // Indicates whether the path in IsSymlinkRequest is a symlink. - bool is_symlink = 1; -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.pb.go deleted file mode 100644 index 9b8f897bd..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.pb.go +++ /dev/null @@ -1,872 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto - -package v1beta1 - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Context of the paths used for path prefix validation -type PathContext int32 - -const ( - // Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as - // the path context. This may be used while handling NodeStageVolume where - // a volume may need to be mounted at a plugin-specific path like: - // kubelet\plugins\kubernetes.io\csi\pv\\globalmount - PathContext_PLUGIN PathContext = 0 - // Indicates the kubelet-pod-path parameter of csi-proxy be used as the path - // context. This may be used while handling NodePublishVolume where a staged - // volume may be need to be symlinked to a pod-specific path like: - // kubelet\pods\\volumes\kubernetes.io~csi\\mount - PathContext_POD PathContext = 1 -) - -var PathContext_name = map[int32]string{ - 0: "PLUGIN", - 1: "POD", -} - -var PathContext_value = map[string]int32{ - "PLUGIN": 0, - "POD": 1, -} - -func (x PathContext) String() string { - return proto.EnumName(PathContext_name, int32(x)) -} - -func (PathContext) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{0} -} - -type PathExistsRequest struct { - // The path whose existence we want to check in the host's filesystem - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - Context PathContext `protobuf:"varint,2,opt,name=context,proto3,enum=v1beta1.PathContext" json:"context,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PathExistsRequest) Reset() { *m = PathExistsRequest{} } -func (m *PathExistsRequest) String() string { return proto.CompactTextString(m) } -func (*PathExistsRequest) ProtoMessage() {} -func (*PathExistsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{0} -} - -func (m *PathExistsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathExistsRequest.Unmarshal(m, b) -} -func (m *PathExistsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathExistsRequest.Marshal(b, m, deterministic) -} -func (m *PathExistsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathExistsRequest.Merge(m, src) -} -func (m *PathExistsRequest) XXX_Size() int { - return xxx_messageInfo_PathExistsRequest.Size(m) -} -func (m *PathExistsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PathExistsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PathExistsRequest proto.InternalMessageInfo - -func (m *PathExistsRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *PathExistsRequest) GetContext() PathContext { - if m != nil { - return m.Context - } - return PathContext_PLUGIN -} - -type PathExistsResponse struct { - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PathExistsResponse) Reset() { *m = PathExistsResponse{} } -func (m *PathExistsResponse) String() string { return proto.CompactTextString(m) } -func (*PathExistsResponse) ProtoMessage() {} -func (*PathExistsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{1} -} - -func (m *PathExistsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathExistsResponse.Unmarshal(m, b) -} -func (m *PathExistsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathExistsResponse.Marshal(b, m, deterministic) -} -func (m *PathExistsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathExistsResponse.Merge(m, src) -} -func (m *PathExistsResponse) XXX_Size() int { - return xxx_messageInfo_PathExistsResponse.Size(m) -} -func (m *PathExistsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PathExistsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PathExistsResponse proto.InternalMessageInfo - -func (m *PathExistsResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *PathExistsResponse) GetExists() bool { - if m != nil { - return m.Exists - } - return false -} - -type MkdirRequest struct { - // The path to create in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // Non-existent parent directories in the path will be automatically created. - // Directories will be created with Read and Write privileges of the Windows - // User account under which csi-proxy is started (typically LocalSystem). - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // The path parameter cannot already exist in the host's filesystem. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Maximum path length will be capped to 260 characters. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - Context PathContext `protobuf:"varint,2,opt,name=context,proto3,enum=v1beta1.PathContext" json:"context,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MkdirRequest) Reset() { *m = MkdirRequest{} } -func (m *MkdirRequest) String() string { return proto.CompactTextString(m) } -func (*MkdirRequest) ProtoMessage() {} -func (*MkdirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{2} -} - -func (m *MkdirRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MkdirRequest.Unmarshal(m, b) -} -func (m *MkdirRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MkdirRequest.Marshal(b, m, deterministic) -} -func (m *MkdirRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MkdirRequest.Merge(m, src) -} -func (m *MkdirRequest) XXX_Size() int { - return xxx_messageInfo_MkdirRequest.Size(m) -} -func (m *MkdirRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MkdirRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MkdirRequest proto.InternalMessageInfo - -func (m *MkdirRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *MkdirRequest) GetContext() PathContext { - if m != nil { - return m.Context - } - return PathContext_PLUGIN -} - -type MkdirResponse struct { - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MkdirResponse) Reset() { *m = MkdirResponse{} } -func (m *MkdirResponse) String() string { return proto.CompactTextString(m) } -func (*MkdirResponse) ProtoMessage() {} -func (*MkdirResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{3} -} - -func (m *MkdirResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MkdirResponse.Unmarshal(m, b) -} -func (m *MkdirResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MkdirResponse.Marshal(b, m, deterministic) -} -func (m *MkdirResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MkdirResponse.Merge(m, src) -} -func (m *MkdirResponse) XXX_Size() int { - return xxx_messageInfo_MkdirResponse.Size(m) -} -func (m *MkdirResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MkdirResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MkdirResponse proto.InternalMessageInfo - -func (m *MkdirResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type RmdirRequest struct { - // The path to remove in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Path cannot be a file of type symlink. - // Maximum path length will be capped to 260 characters. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - Context PathContext `protobuf:"varint,2,opt,name=context,proto3,enum=v1beta1.PathContext" json:"context,omitempty"` - // Force remove all contents under path (if any). - Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RmdirRequest) Reset() { *m = RmdirRequest{} } -func (m *RmdirRequest) String() string { return proto.CompactTextString(m) } -func (*RmdirRequest) ProtoMessage() {} -func (*RmdirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{4} -} - -func (m *RmdirRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RmdirRequest.Unmarshal(m, b) -} -func (m *RmdirRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RmdirRequest.Marshal(b, m, deterministic) -} -func (m *RmdirRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RmdirRequest.Merge(m, src) -} -func (m *RmdirRequest) XXX_Size() int { - return xxx_messageInfo_RmdirRequest.Size(m) -} -func (m *RmdirRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RmdirRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RmdirRequest proto.InternalMessageInfo - -func (m *RmdirRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *RmdirRequest) GetContext() PathContext { - if m != nil { - return m.Context - } - return PathContext_PLUGIN -} - -func (m *RmdirRequest) GetForce() bool { - if m != nil { - return m.Force - } - return false -} - -type RmdirResponse struct { - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RmdirResponse) Reset() { *m = RmdirResponse{} } -func (m *RmdirResponse) String() string { return proto.CompactTextString(m) } -func (*RmdirResponse) ProtoMessage() {} -func (*RmdirResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{5} -} - -func (m *RmdirResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RmdirResponse.Unmarshal(m, b) -} -func (m *RmdirResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RmdirResponse.Marshal(b, m, deterministic) -} -func (m *RmdirResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RmdirResponse.Merge(m, src) -} -func (m *RmdirResponse) XXX_Size() int { - return xxx_messageInfo_RmdirResponse.Size(m) -} -func (m *RmdirResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RmdirResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RmdirResponse proto.InternalMessageInfo - -func (m *RmdirResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type LinkPathRequest struct { - // The path where the symlink is created in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs needs to match the paths specified as - // kubelet-csi-plugins-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // source_path cannot already exist in the host filesystem. - // Maximum path length will be capped to 260 characters. - SourcePath string `protobuf:"bytes,1,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"` - // Target path in the host's filesystem used for the symlink creation. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs to match the paths specified as - // kubelet-pod-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // target_path needs to exist as a directory in the host that is empty. - // target_path cannot be a symbolic link. - // Maximum path length will be capped to 260 characters. - TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LinkPathRequest) Reset() { *m = LinkPathRequest{} } -func (m *LinkPathRequest) String() string { return proto.CompactTextString(m) } -func (*LinkPathRequest) ProtoMessage() {} -func (*LinkPathRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{6} -} - -func (m *LinkPathRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LinkPathRequest.Unmarshal(m, b) -} -func (m *LinkPathRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LinkPathRequest.Marshal(b, m, deterministic) -} -func (m *LinkPathRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LinkPathRequest.Merge(m, src) -} -func (m *LinkPathRequest) XXX_Size() int { - return xxx_messageInfo_LinkPathRequest.Size(m) -} -func (m *LinkPathRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LinkPathRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LinkPathRequest proto.InternalMessageInfo - -func (m *LinkPathRequest) GetSourcePath() string { - if m != nil { - return m.SourcePath - } - return "" -} - -func (m *LinkPathRequest) GetTargetPath() string { - if m != nil { - return m.TargetPath - } - return "" -} - -type LinkPathResponse struct { - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LinkPathResponse) Reset() { *m = LinkPathResponse{} } -func (m *LinkPathResponse) String() string { return proto.CompactTextString(m) } -func (*LinkPathResponse) ProtoMessage() {} -func (*LinkPathResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{7} -} - -func (m *LinkPathResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LinkPathResponse.Unmarshal(m, b) -} -func (m *LinkPathResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LinkPathResponse.Marshal(b, m, deterministic) -} -func (m *LinkPathResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LinkPathResponse.Merge(m, src) -} -func (m *LinkPathResponse) XXX_Size() int { - return xxx_messageInfo_LinkPathResponse.Size(m) -} -func (m *LinkPathResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LinkPathResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LinkPathResponse proto.InternalMessageInfo - -func (m *LinkPathResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type IsMountPointRequest struct { - // The path whose existence we want to check in the host's filesystem - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsMountPointRequest) Reset() { *m = IsMountPointRequest{} } -func (m *IsMountPointRequest) String() string { return proto.CompactTextString(m) } -func (*IsMountPointRequest) ProtoMessage() {} -func (*IsMountPointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{8} -} - -func (m *IsMountPointRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsMountPointRequest.Unmarshal(m, b) -} -func (m *IsMountPointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsMountPointRequest.Marshal(b, m, deterministic) -} -func (m *IsMountPointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsMountPointRequest.Merge(m, src) -} -func (m *IsMountPointRequest) XXX_Size() int { - return xxx_messageInfo_IsMountPointRequest.Size(m) -} -func (m *IsMountPointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IsMountPointRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_IsMountPointRequest proto.InternalMessageInfo - -func (m *IsMountPointRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -type IsMountPointResponse struct { - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - IsMountPoint bool `protobuf:"varint,2,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsMountPointResponse) Reset() { *m = IsMountPointResponse{} } -func (m *IsMountPointResponse) String() string { return proto.CompactTextString(m) } -func (*IsMountPointResponse) ProtoMessage() {} -func (*IsMountPointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b03a6091226f91c2, []int{9} -} - -func (m *IsMountPointResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsMountPointResponse.Unmarshal(m, b) -} -func (m *IsMountPointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsMountPointResponse.Marshal(b, m, deterministic) -} -func (m *IsMountPointResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsMountPointResponse.Merge(m, src) -} -func (m *IsMountPointResponse) XXX_Size() int { - return xxx_messageInfo_IsMountPointResponse.Size(m) -} -func (m *IsMountPointResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IsMountPointResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IsMountPointResponse proto.InternalMessageInfo - -func (m *IsMountPointResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *IsMountPointResponse) GetIsMountPoint() bool { - if m != nil { - return m.IsMountPoint - } - return false -} - -func init() { - proto.RegisterEnum("v1beta1.PathContext", PathContext_name, PathContext_value) - proto.RegisterType((*PathExistsRequest)(nil), "v1beta1.PathExistsRequest") - proto.RegisterType((*PathExistsResponse)(nil), "v1beta1.PathExistsResponse") - proto.RegisterType((*MkdirRequest)(nil), "v1beta1.MkdirRequest") - proto.RegisterType((*MkdirResponse)(nil), "v1beta1.MkdirResponse") - proto.RegisterType((*RmdirRequest)(nil), "v1beta1.RmdirRequest") - proto.RegisterType((*RmdirResponse)(nil), "v1beta1.RmdirResponse") - proto.RegisterType((*LinkPathRequest)(nil), "v1beta1.LinkPathRequest") - proto.RegisterType((*LinkPathResponse)(nil), "v1beta1.LinkPathResponse") - proto.RegisterType((*IsMountPointRequest)(nil), "v1beta1.IsMountPointRequest") - proto.RegisterType((*IsMountPointResponse)(nil), "v1beta1.IsMountPointResponse") -} - -func init() { - proto.RegisterFile("github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto", fileDescriptor_b03a6091226f91c2) -} - -var fileDescriptor_b03a6091226f91c2 = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x6f, 0xd3, 0x40, - 0x10, 0xc5, 0x93, 0x94, 0x26, 0x65, 0x1a, 0x4a, 0x18, 0x42, 0x15, 0x0c, 0x88, 0x6a, 0x05, 0x52, - 0x40, 0xaa, 0xad, 0x96, 0x0b, 0x57, 0xfe, 0x56, 0x15, 0x0d, 0x44, 0x46, 0x88, 0x63, 0xe4, 0x98, - 0x69, 0xb3, 0x4a, 0xe3, 0x35, 0xbb, 0x63, 0x94, 0x7e, 0x56, 0xbe, 0x0c, 0x5a, 0xdb, 0x71, 0x37, - 0x55, 0xf0, 0xa9, 0xb7, 0xec, 0xcc, 0x6f, 0xdf, 0xbc, 0xec, 0x3c, 0x19, 0xbe, 0x5c, 0x48, 0x9e, - 0x65, 0x53, 0x3f, 0x56, 0x8b, 0x60, 0x9e, 0x4d, 0x49, 0x27, 0xc4, 0x64, 0x0e, 0x63, 0x23, 0x83, - 0xd8, 0xc8, 0xc3, 0x54, 0xab, 0xe5, 0x55, 0x10, 0x5f, 0x4a, 0x4a, 0x38, 0x88, 0x52, 0x19, 0x9c, - 0xcb, 0x4b, 0x32, 0x57, 0x86, 0x69, 0x11, 0xfc, 0x39, 0x9a, 0x12, 0x47, 0x47, 0xb6, 0xec, 0xa7, - 0x5a, 0xb1, 0xc2, 0x4e, 0x59, 0x12, 0x3f, 0xe1, 0xc1, 0x38, 0xe2, 0xd9, 0xa7, 0xa5, 0x34, 0x6c, - 0x42, 0xfa, 0x9d, 0x91, 0x61, 0x44, 0xb8, 0x93, 0x46, 0x3c, 0x1b, 0x34, 0x0f, 0x9a, 0xc3, 0xbb, - 0x61, 0xfe, 0x1b, 0x7d, 0xe8, 0xc4, 0x2a, 0x61, 0x5a, 0xf2, 0xa0, 0x75, 0xd0, 0x1c, 0xee, 0x1d, - 0xf7, 0xfd, 0x52, 0xc3, 0xb7, 0x02, 0x1f, 0x8a, 0x5e, 0xb8, 0x82, 0xc4, 0x7b, 0x40, 0x57, 0xd8, - 0xa4, 0x2a, 0x31, 0x84, 0x7d, 0xd8, 0x26, 0xad, 0x95, 0x2e, 0xa5, 0x8b, 0x03, 0xee, 0x43, 0x9b, - 0x72, 0x2e, 0x97, 0xde, 0x09, 0xcb, 0x93, 0x08, 0xa1, 0x3b, 0x9a, 0xff, 0x92, 0xfa, 0x36, 0x7d, - 0xbd, 0x84, 0x7b, 0xa5, 0x66, 0x9d, 0x25, 0x31, 0x83, 0x6e, 0xb8, 0xb8, 0xdd, 0xd1, 0x76, 0xd2, - 0xb9, 0xd2, 0x31, 0x0d, 0xb6, 0xf2, 0x7f, 0x59, 0x1c, 0xac, 0xa1, 0x72, 0x52, 0xad, 0xa1, 0xef, - 0x70, 0xff, 0x4c, 0x26, 0x73, 0x2b, 0xbc, 0xf2, 0xf4, 0x1c, 0x76, 0x8d, 0xca, 0x74, 0x4c, 0x13, - 0xc7, 0x1a, 0x14, 0x25, 0xcb, 0x59, 0x80, 0x23, 0x7d, 0x41, 0x5c, 0x00, 0xad, 0x02, 0x28, 0x4a, - 0x16, 0x10, 0x43, 0xe8, 0x5d, 0x8b, 0xd6, 0x8e, 0x7f, 0x05, 0x0f, 0x4f, 0xcd, 0x48, 0x65, 0x09, - 0x8f, 0x95, 0x4c, 0xb8, 0xe6, 0x59, 0x44, 0x08, 0xfd, 0x75, 0xb4, 0x76, 0xf7, 0x2f, 0x60, 0x4f, - 0x9a, 0xc9, 0xc2, 0xe2, 0x93, 0xd4, 0xf2, 0x65, 0x06, 0xba, 0xd2, 0xd1, 0x78, 0x2d, 0x60, 0xd7, - 0x79, 0x52, 0x04, 0x68, 0x8f, 0xcf, 0x7e, 0x9c, 0x9c, 0x7e, 0xed, 0x35, 0xb0, 0x03, 0x5b, 0xe3, - 0x6f, 0x1f, 0x7b, 0xcd, 0xe3, 0xbf, 0x2d, 0x80, 0xcf, 0x55, 0xe8, 0xf1, 0x04, 0xe0, 0x3a, 0x80, - 0xe8, 0xad, 0xad, 0x66, 0x2d, 0xee, 0xde, 0x93, 0x8d, 0xbd, 0xc2, 0xb5, 0x68, 0xe0, 0x5b, 0xd8, - 0xce, 0x13, 0x83, 0x8f, 0x2a, 0xce, 0x4d, 0xa5, 0xb7, 0x7f, 0xb3, 0xec, 0xde, 0xcc, 0x57, 0xeb, - 0xdc, 0x74, 0x43, 0xe5, 0xdc, 0x5c, 0x4b, 0x80, 0x68, 0xe0, 0x3b, 0xd8, 0x59, 0x2d, 0x06, 0x07, - 0x15, 0x75, 0x23, 0x00, 0xde, 0xe3, 0x0d, 0x9d, 0x4a, 0x62, 0x04, 0x5d, 0x77, 0x0d, 0xf8, 0xb4, - 0x82, 0x37, 0x2c, 0xd2, 0x7b, 0xf6, 0x9f, 0xee, 0x4a, 0x6e, 0xda, 0xce, 0x3f, 0x1c, 0x6f, 0xfe, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x54, 0x94, 0x73, 0xfe, 0x87, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// FilesystemClient is the client API for Filesystem service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type FilesystemClient interface { - // PathExists checks if the requested path exists in the host's filesystem - PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem - Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath - Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem - LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not - IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) -} - -type filesystemClient struct { - cc *grpc.ClientConn -} - -func NewFilesystemClient(cc *grpc.ClientConn) FilesystemClient { - return &filesystemClient{cc} -} - -func (c *filesystemClient) PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) { - out := new(PathExistsResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Filesystem/PathExists", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) { - out := new(MkdirResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Filesystem/Mkdir", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) { - out := new(RmdirResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Filesystem/Rmdir", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) { - out := new(LinkPathResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Filesystem/LinkPath", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) { - out := new(IsMountPointResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Filesystem/IsMountPoint", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// FilesystemServer is the server API for Filesystem service. -type FilesystemServer interface { - // PathExists checks if the requested path exists in the host's filesystem - PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem - Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath - Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem - LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not - IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) -} - -// UnimplementedFilesystemServer can be embedded to have forward compatible implementations. -type UnimplementedFilesystemServer struct { -} - -func (*UnimplementedFilesystemServer) PathExists(ctx context.Context, req *PathExistsRequest) (*PathExistsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PathExists not implemented") -} -func (*UnimplementedFilesystemServer) Mkdir(ctx context.Context, req *MkdirRequest) (*MkdirResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Mkdir not implemented") -} -func (*UnimplementedFilesystemServer) Rmdir(ctx context.Context, req *RmdirRequest) (*RmdirResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rmdir not implemented") -} -func (*UnimplementedFilesystemServer) LinkPath(ctx context.Context, req *LinkPathRequest) (*LinkPathResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LinkPath not implemented") -} -func (*UnimplementedFilesystemServer) IsMountPoint(ctx context.Context, req *IsMountPointRequest) (*IsMountPointResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsMountPoint not implemented") -} - -func RegisterFilesystemServer(s *grpc.Server, srv FilesystemServer) { - s.RegisterService(&_Filesystem_serviceDesc, srv) -} - -func _Filesystem_PathExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PathExistsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).PathExists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Filesystem/PathExists", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).PathExists(ctx, req.(*PathExistsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_Mkdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MkdirRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).Mkdir(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Filesystem/Mkdir", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).Mkdir(ctx, req.(*MkdirRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_Rmdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RmdirRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).Rmdir(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Filesystem/Rmdir", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).Rmdir(ctx, req.(*RmdirRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_LinkPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LinkPathRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).LinkPath(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Filesystem/LinkPath", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).LinkPath(ctx, req.(*LinkPathRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Filesystem_IsMountPoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsMountPointRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FilesystemServer).IsMountPoint(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Filesystem/IsMountPoint", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).IsMountPoint(ctx, req.(*IsMountPointRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Filesystem_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1beta1.Filesystem", - HandlerType: (*FilesystemServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PathExists", - Handler: _Filesystem_PathExists_Handler, - }, - { - MethodName: "Mkdir", - Handler: _Filesystem_Mkdir_Handler, - }, - { - MethodName: "Rmdir", - Handler: _Filesystem_Rmdir_Handler, - }, - { - MethodName: "LinkPath", - Handler: _Filesystem_LinkPath_Handler, - }, - { - MethodName: "IsMountPoint", - Handler: _Filesystem_IsMountPoint_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto deleted file mode 100644 index 3b4c0ab2f..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto +++ /dev/null @@ -1,168 +0,0 @@ -syntax = "proto3"; - -package v1beta1; - -service Filesystem { - // PathExists checks if the requested path exists in the host's filesystem - rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - - // Mkdir creates a directory at the requested path in the host's filesystem - rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} - - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath - rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} - - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem - rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {} - - //IsMountPoint checks if a given path is mount or not - rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {} -} - -// Context of the paths used for path prefix validation -enum PathContext { - // Indicates the kubelet-csi-plugins-path parameter of csi-proxy be used as - // the path context. This may be used while handling NodeStageVolume where - // a volume may need to be mounted at a plugin-specific path like: - // kubelet\plugins\kubernetes.io\csi\pv\\globalmount - PLUGIN = 0; - // Indicates the kubelet-pod-path parameter of csi-proxy be used as the path - // context. This may be used while handling NodePublishVolume where a staged - // volume may be need to be symlinked to a pod-specific path like: - // kubelet\pods\\volumes\kubernetes.io~csi\\mount - POD = 1; -} - -message PathExistsRequest { - // The path whose existence we want to check in the host's filesystem - string path = 1; - - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - PathContext context = 2; -} - -message PathExistsResponse { - // Error message if any. Empty string indicates success - string error = 1; - - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool exists = 2; -} - -message MkdirRequest { - // The path to create in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // Non-existent parent directories in the path will be automatically created. - // Directories will be created with Read and Write privileges of the Windows - // User account under which csi-proxy is started (typically LocalSystem). - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // The path parameter cannot already exist in the host's filesystem. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Maximum path length will be capped to 260 characters. - string path = 1; - - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - PathContext context = 2; -} - -message MkdirResponse { - // Error message if any. Empty string indicates success - string error = 1; -} - -message RmdirRequest { - // The path to remove in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // Depending on the context parameter of this function, the path prefix needs - // to match the paths specified either as kubelet-csi-plugins-path - // or as kubelet-pod-path parameters of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // Path cannot be a file of type symlink. - // Maximum path length will be capped to 260 characters. - string path = 1; - - // Context of the path parameter. - // This is used to validate prefix for absolute paths passed - PathContext context = 2; - - // Force remove all contents under path (if any). - bool force = 3; -} - -message RmdirResponse { - // Error message if any. Empty string indicates success - string error = 1; -} - -message LinkPathRequest { - // The path where the symlink is created in the host's filesystem. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs needs to match the paths specified as - // kubelet-csi-plugins-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // source_path cannot already exist in the host filesystem. - // Maximum path length will be capped to 260 characters. - string source_path = 1; - - // Target path in the host's filesystem used for the symlink creation. - // All special characters allowed by Windows in path names will be allowed - // except for restrictions noted below. For details, please check: - // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - // - // Restrictions: - // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. - // The path prefix needs to match the paths specified as - // kubelet-pod-path parameter of csi-proxy. - // UNC paths of the form "\\server\share\path\file" are not allowed. - // All directory separators need to be backslash character: "\". - // Characters: .. / : | ? * in the path are not allowed. - // target_path needs to exist as a directory in the host that is empty. - // target_path cannot be a symbolic link. - // Maximum path length will be capped to 260 characters. - string target_path = 2; -} - -message LinkPathResponse { - // Error message if any. Empty string indicates success - string error = 1; -} - -message IsMountPointRequest { - // The path whose existence we want to check in the host's filesystem - string path = 1; -} - -message IsMountPointResponse { - // Error message if any. Empty string indicates success - string error = 1; - - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool is_mount_point = 2; -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go deleted file mode 100644 index 2a7a9be18..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go +++ /dev/null @@ -1,1876 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.12.4 -// source: github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ListVolumesOnDiskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Disk device number of the disk to query for volumes. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` - // The partition number (optional), by default it uses the first partition of the disk. - PartitionNumber uint32 `protobuf:"varint,2,opt,name=partition_number,json=partitionNumber,proto3" json:"partition_number,omitempty"` -} - -func (x *ListVolumesOnDiskRequest) Reset() { - *x = ListVolumesOnDiskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListVolumesOnDiskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListVolumesOnDiskRequest) ProtoMessage() {} - -func (x *ListVolumesOnDiskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListVolumesOnDiskRequest.ProtoReflect.Descriptor instead. -func (*ListVolumesOnDiskRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{0} -} - -func (x *ListVolumesOnDiskRequest) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -func (x *ListVolumesOnDiskRequest) GetPartitionNumber() uint32 { - if x != nil { - return x.PartitionNumber - } - return 0 -} - -type ListVolumesOnDiskResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device IDs of volumes on the specified disk. - VolumeIds []string `protobuf:"bytes,1,rep,name=volume_ids,json=volumeIds,proto3" json:"volume_ids,omitempty"` -} - -func (x *ListVolumesOnDiskResponse) Reset() { - *x = ListVolumesOnDiskResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListVolumesOnDiskResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListVolumesOnDiskResponse) ProtoMessage() {} - -func (x *ListVolumesOnDiskResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListVolumesOnDiskResponse.ProtoReflect.Descriptor instead. -func (*ListVolumesOnDiskResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{1} -} - -func (x *ListVolumesOnDiskResponse) GetVolumeIds() []string { - if x != nil { - return x.VolumeIds - } - return nil -} - -type MountVolumeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to mount. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Path in the host's file system where the volume needs to be mounted. - TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` -} - -func (x *MountVolumeRequest) Reset() { - *x = MountVolumeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MountVolumeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MountVolumeRequest) ProtoMessage() {} - -func (x *MountVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MountVolumeRequest.ProtoReflect.Descriptor instead. -func (*MountVolumeRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{2} -} - -func (x *MountVolumeRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -func (x *MountVolumeRequest) GetTargetPath() string { - if x != nil { - return x.TargetPath - } - return "" -} - -type MountVolumeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MountVolumeResponse) Reset() { - *x = MountVolumeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MountVolumeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MountVolumeResponse) ProtoMessage() {} - -func (x *MountVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MountVolumeResponse.ProtoReflect.Descriptor instead. -func (*MountVolumeResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{3} -} - -type UnmountVolumeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to dismount. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Path where the volume has been mounted. - TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` -} - -func (x *UnmountVolumeRequest) Reset() { - *x = UnmountVolumeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnmountVolumeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnmountVolumeRequest) ProtoMessage() {} - -func (x *UnmountVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnmountVolumeRequest.ProtoReflect.Descriptor instead. -func (*UnmountVolumeRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{4} -} - -func (x *UnmountVolumeRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -func (x *UnmountVolumeRequest) GetTargetPath() string { - if x != nil { - return x.TargetPath - } - return "" -} - -type UnmountVolumeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UnmountVolumeResponse) Reset() { - *x = UnmountVolumeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnmountVolumeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnmountVolumeResponse) ProtoMessage() {} - -func (x *UnmountVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnmountVolumeResponse.ProtoReflect.Descriptor instead. -func (*UnmountVolumeResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{5} -} - -type IsVolumeFormattedRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to check. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *IsVolumeFormattedRequest) Reset() { - *x = IsVolumeFormattedRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsVolumeFormattedRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsVolumeFormattedRequest) ProtoMessage() {} - -func (x *IsVolumeFormattedRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsVolumeFormattedRequest.ProtoReflect.Descriptor instead. -func (*IsVolumeFormattedRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{6} -} - -func (x *IsVolumeFormattedRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type IsVolumeFormattedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Is the volume formatted with NTFS. - Formatted bool `protobuf:"varint,1,opt,name=formatted,proto3" json:"formatted,omitempty"` -} - -func (x *IsVolumeFormattedResponse) Reset() { - *x = IsVolumeFormattedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsVolumeFormattedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsVolumeFormattedResponse) ProtoMessage() {} - -func (x *IsVolumeFormattedResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsVolumeFormattedResponse.ProtoReflect.Descriptor instead. -func (*IsVolumeFormattedResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{7} -} - -func (x *IsVolumeFormattedResponse) GetFormatted() bool { - if x != nil { - return x.Formatted - } - return false -} - -type FormatVolumeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to format. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *FormatVolumeRequest) Reset() { - *x = FormatVolumeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FormatVolumeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FormatVolumeRequest) ProtoMessage() {} - -func (x *FormatVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FormatVolumeRequest.ProtoReflect.Descriptor instead. -func (*FormatVolumeRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{8} -} - -func (x *FormatVolumeRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type FormatVolumeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FormatVolumeResponse) Reset() { - *x = FormatVolumeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FormatVolumeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FormatVolumeResponse) ProtoMessage() {} - -func (x *FormatVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FormatVolumeResponse.ProtoReflect.Descriptor instead. -func (*FormatVolumeResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{9} -} - -type ResizeVolumeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to resize. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // New size in bytes of the volume. - SizeBytes int64 `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"` -} - -func (x *ResizeVolumeRequest) Reset() { - *x = ResizeVolumeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResizeVolumeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResizeVolumeRequest) ProtoMessage() {} - -func (x *ResizeVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResizeVolumeRequest.ProtoReflect.Descriptor instead. -func (*ResizeVolumeRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{10} -} - -func (x *ResizeVolumeRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -func (x *ResizeVolumeRequest) GetSizeBytes() int64 { - if x != nil { - return x.SizeBytes - } - return 0 -} - -type ResizeVolumeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ResizeVolumeResponse) Reset() { - *x = ResizeVolumeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResizeVolumeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResizeVolumeResponse) ProtoMessage() {} - -func (x *ResizeVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResizeVolumeResponse.ProtoReflect.Descriptor instead. -func (*ResizeVolumeResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{11} -} - -type GetVolumeStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device Id of the volume to get the stats for. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *GetVolumeStatsRequest) Reset() { - *x = GetVolumeStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetVolumeStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVolumeStatsRequest) ProtoMessage() {} - -func (x *GetVolumeStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVolumeStatsRequest.ProtoReflect.Descriptor instead. -func (*GetVolumeStatsRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{12} -} - -func (x *GetVolumeStatsRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type GetVolumeStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Total bytes - TotalBytes int64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` - // Used bytes - UsedBytes int64 `protobuf:"varint,2,opt,name=used_bytes,json=usedBytes,proto3" json:"used_bytes,omitempty"` -} - -func (x *GetVolumeStatsResponse) Reset() { - *x = GetVolumeStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetVolumeStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVolumeStatsResponse) ProtoMessage() {} - -func (x *GetVolumeStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVolumeStatsResponse.ProtoReflect.Descriptor instead. -func (*GetVolumeStatsResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{13} -} - -func (x *GetVolumeStatsResponse) GetTotalBytes() int64 { - if x != nil { - return x.TotalBytes - } - return 0 -} - -func (x *GetVolumeStatsResponse) GetUsedBytes() int64 { - if x != nil { - return x.UsedBytes - } - return 0 -} - -type GetDiskNumberFromVolumeIDRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to get the disk number for. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *GetDiskNumberFromVolumeIDRequest) Reset() { - *x = GetDiskNumberFromVolumeIDRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskNumberFromVolumeIDRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskNumberFromVolumeIDRequest) ProtoMessage() {} - -func (x *GetDiskNumberFromVolumeIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskNumberFromVolumeIDRequest.ProtoReflect.Descriptor instead. -func (*GetDiskNumberFromVolumeIDRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{14} -} - -func (x *GetDiskNumberFromVolumeIDRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type GetDiskNumberFromVolumeIDResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Corresponding disk number. - DiskNumber uint32 `protobuf:"varint,1,opt,name=disk_number,json=diskNumber,proto3" json:"disk_number,omitempty"` -} - -func (x *GetDiskNumberFromVolumeIDResponse) Reset() { - *x = GetDiskNumberFromVolumeIDResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDiskNumberFromVolumeIDResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDiskNumberFromVolumeIDResponse) ProtoMessage() {} - -func (x *GetDiskNumberFromVolumeIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDiskNumberFromVolumeIDResponse.ProtoReflect.Descriptor instead. -func (*GetDiskNumberFromVolumeIDResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{15} -} - -func (x *GetDiskNumberFromVolumeIDResponse) GetDiskNumber() uint32 { - if x != nil { - return x.DiskNumber - } - return 0 -} - -type GetVolumeIDFromTargetPathRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The target path. - TargetPath string `protobuf:"bytes,1,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` -} - -func (x *GetVolumeIDFromTargetPathRequest) Reset() { - *x = GetVolumeIDFromTargetPathRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetVolumeIDFromTargetPathRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVolumeIDFromTargetPathRequest) ProtoMessage() {} - -func (x *GetVolumeIDFromTargetPathRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVolumeIDFromTargetPathRequest.ProtoReflect.Descriptor instead. -func (*GetVolumeIDFromTargetPathRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{16} -} - -func (x *GetVolumeIDFromTargetPathRequest) GetTargetPath() string { - if x != nil { - return x.TargetPath - } - return "" -} - -type GetVolumeIDFromTargetPathResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The volume device ID. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *GetVolumeIDFromTargetPathResponse) Reset() { - *x = GetVolumeIDFromTargetPathResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetVolumeIDFromTargetPathResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVolumeIDFromTargetPathResponse) ProtoMessage() {} - -func (x *GetVolumeIDFromTargetPathResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVolumeIDFromTargetPathResponse.ProtoReflect.Descriptor instead. -func (*GetVolumeIDFromTargetPathResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{17} -} - -func (x *GetVolumeIDFromTargetPathResponse) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type WriteVolumeCacheRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Volume device ID of the volume to flush the cache. - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (x *WriteVolumeCacheRequest) Reset() { - *x = WriteVolumeCacheRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteVolumeCacheRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteVolumeCacheRequest) ProtoMessage() {} - -func (x *WriteVolumeCacheRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WriteVolumeCacheRequest.ProtoReflect.Descriptor instead. -func (*WriteVolumeCacheRequest) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{18} -} - -func (x *WriteVolumeCacheRequest) GetVolumeId() string { - if x != nil { - return x.VolumeId - } - return "" -} - -type WriteVolumeCacheResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *WriteVolumeCacheResponse) Reset() { - *x = WriteVolumeCacheResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteVolumeCacheResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteVolumeCacheResponse) ProtoMessage() {} - -func (x *WriteVolumeCacheResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WriteVolumeCacheResponse.ProtoReflect.Descriptor instead. -func (*WriteVolumeCacheResponse) Descriptor() ([]byte, []int) { - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP(), []int{19} -} - -var File_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto protoreflect.FileDescriptor - -var file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDesc = []byte{ - 0x0a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x22, 0x3a, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4f, - 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x73, 0x22, 0x52, 0x0a, 0x12, - 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, - 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x0a, 0x14, 0x55, 0x6e, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x17, 0x0a, - 0x15, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x0a, 0x18, 0x49, 0x73, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, - 0x39, 0x0a, 0x19, 0x49, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x22, 0x32, 0x0a, 0x13, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x16, - 0x0a, 0x14, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, - 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x73, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x73, - 0x69, 0x7a, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x73, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x3f, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x49, 0x64, 0x22, 0x44, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x6b, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x69, - 0x73, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x43, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x40, 0x0a, - 0x21, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, - 0x36, 0x0a, 0x17, 0x57, 0x72, 0x69, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x06, 0x0a, 0x06, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x52, - 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x44, - 0x69, 0x73, 0x6b, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x73, 0x4f, 0x6e, 0x44, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x12, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0d, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x11, - 0x49, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, - 0x64, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x43, 0x0a, 0x0c, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, - 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6a, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x49, 0x44, 0x12, 0x24, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, - 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x44, 0x69, 0x73, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x6a, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, - 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x24, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x44, 0x46, - 0x72, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, - 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, - 0x10, 0x57, 0x72, 0x69, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x61, 0x63, 0x68, - 0x65, 0x12, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, - 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescOnce sync.Once - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescData = file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDesc -) - -func file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescGZIP() []byte { - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescOnce.Do(func() { - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescData) - }) - return file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDescData -} - -var file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_goTypes = []interface{}{ - (*ListVolumesOnDiskRequest)(nil), // 0: v1.ListVolumesOnDiskRequest - (*ListVolumesOnDiskResponse)(nil), // 1: v1.ListVolumesOnDiskResponse - (*MountVolumeRequest)(nil), // 2: v1.MountVolumeRequest - (*MountVolumeResponse)(nil), // 3: v1.MountVolumeResponse - (*UnmountVolumeRequest)(nil), // 4: v1.UnmountVolumeRequest - (*UnmountVolumeResponse)(nil), // 5: v1.UnmountVolumeResponse - (*IsVolumeFormattedRequest)(nil), // 6: v1.IsVolumeFormattedRequest - (*IsVolumeFormattedResponse)(nil), // 7: v1.IsVolumeFormattedResponse - (*FormatVolumeRequest)(nil), // 8: v1.FormatVolumeRequest - (*FormatVolumeResponse)(nil), // 9: v1.FormatVolumeResponse - (*ResizeVolumeRequest)(nil), // 10: v1.ResizeVolumeRequest - (*ResizeVolumeResponse)(nil), // 11: v1.ResizeVolumeResponse - (*GetVolumeStatsRequest)(nil), // 12: v1.GetVolumeStatsRequest - (*GetVolumeStatsResponse)(nil), // 13: v1.GetVolumeStatsResponse - (*GetDiskNumberFromVolumeIDRequest)(nil), // 14: v1.GetDiskNumberFromVolumeIDRequest - (*GetDiskNumberFromVolumeIDResponse)(nil), // 15: v1.GetDiskNumberFromVolumeIDResponse - (*GetVolumeIDFromTargetPathRequest)(nil), // 16: v1.GetVolumeIDFromTargetPathRequest - (*GetVolumeIDFromTargetPathResponse)(nil), // 17: v1.GetVolumeIDFromTargetPathResponse - (*WriteVolumeCacheRequest)(nil), // 18: v1.WriteVolumeCacheRequest - (*WriteVolumeCacheResponse)(nil), // 19: v1.WriteVolumeCacheResponse -} -var file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_depIdxs = []int32{ - 0, // 0: v1.Volume.ListVolumesOnDisk:input_type -> v1.ListVolumesOnDiskRequest - 2, // 1: v1.Volume.MountVolume:input_type -> v1.MountVolumeRequest - 4, // 2: v1.Volume.UnmountVolume:input_type -> v1.UnmountVolumeRequest - 6, // 3: v1.Volume.IsVolumeFormatted:input_type -> v1.IsVolumeFormattedRequest - 8, // 4: v1.Volume.FormatVolume:input_type -> v1.FormatVolumeRequest - 10, // 5: v1.Volume.ResizeVolume:input_type -> v1.ResizeVolumeRequest - 12, // 6: v1.Volume.GetVolumeStats:input_type -> v1.GetVolumeStatsRequest - 14, // 7: v1.Volume.GetDiskNumberFromVolumeID:input_type -> v1.GetDiskNumberFromVolumeIDRequest - 16, // 8: v1.Volume.GetVolumeIDFromTargetPath:input_type -> v1.GetVolumeIDFromTargetPathRequest - 18, // 9: v1.Volume.WriteVolumeCache:input_type -> v1.WriteVolumeCacheRequest - 1, // 10: v1.Volume.ListVolumesOnDisk:output_type -> v1.ListVolumesOnDiskResponse - 3, // 11: v1.Volume.MountVolume:output_type -> v1.MountVolumeResponse - 5, // 12: v1.Volume.UnmountVolume:output_type -> v1.UnmountVolumeResponse - 7, // 13: v1.Volume.IsVolumeFormatted:output_type -> v1.IsVolumeFormattedResponse - 9, // 14: v1.Volume.FormatVolume:output_type -> v1.FormatVolumeResponse - 11, // 15: v1.Volume.ResizeVolume:output_type -> v1.ResizeVolumeResponse - 13, // 16: v1.Volume.GetVolumeStats:output_type -> v1.GetVolumeStatsResponse - 15, // 17: v1.Volume.GetDiskNumberFromVolumeID:output_type -> v1.GetDiskNumberFromVolumeIDResponse - 17, // 18: v1.Volume.GetVolumeIDFromTargetPath:output_type -> v1.GetVolumeIDFromTargetPathResponse - 19, // 19: v1.Volume.WriteVolumeCache:output_type -> v1.WriteVolumeCacheResponse - 10, // [10:20] is the sub-list for method output_type - 0, // [0:10] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_init() } -func file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_init() { - if File_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListVolumesOnDiskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListVolumesOnDiskResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MountVolumeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MountVolumeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnmountVolumeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnmountVolumeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsVolumeFormattedRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsVolumeFormattedResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FormatVolumeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FormatVolumeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResizeVolumeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResizeVolumeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVolumeStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVolumeStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskNumberFromVolumeIDRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiskNumberFromVolumeIDResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVolumeIDFromTargetPathRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVolumeIDFromTargetPathResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteVolumeCacheRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteVolumeCacheResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_goTypes, - DependencyIndexes: file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_depIdxs, - MessageInfos: file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_msgTypes, - }.Build() - File_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto = out.File - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_rawDesc = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_goTypes = nil - file_github_com_kubernetes_csi_csi_proxy_client_api_volume_v1_api_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// VolumeClient is the client API for Volume service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type VolumeClient interface { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a - // given disk number and partition number (optional) - ListVolumesOnDisk(ctx context.Context, in *ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*ListVolumesOnDiskResponse, error) - // MountVolume mounts the volume at the requested global staging path. - MountVolume(ctx context.Context, in *MountVolumeRequest, opts ...grpc.CallOption) (*MountVolumeResponse, error) - // UnmountVolume flushes data cache to disk and removes the global staging path. - UnmountVolume(ctx context.Context, in *UnmountVolumeRequest, opts ...grpc.CallOption) (*UnmountVolumeResponse, error) - // IsVolumeFormatted checks if a volume is formatted. - IsVolumeFormatted(ctx context.Context, in *IsVolumeFormattedRequest, opts ...grpc.CallOption) (*IsVolumeFormattedResponse, error) - // FormatVolume formats a volume with NTFS. - FormatVolume(ctx context.Context, in *FormatVolumeRequest, opts ...grpc.CallOption) (*FormatVolumeResponse, error) - // ResizeVolume performs resizing of the partition and file system for a block based volume. - ResizeVolume(ctx context.Context, in *ResizeVolumeRequest, opts ...grpc.CallOption) (*ResizeVolumeResponse, error) - // GetVolumeStats gathers total bytes and used bytes for a volume. - GetVolumeStats(ctx context.Context, in *GetVolumeStatsRequest, opts ...grpc.CallOption) (*GetVolumeStatsResponse, error) - // GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located. - GetDiskNumberFromVolumeID(ctx context.Context, in *GetDiskNumberFromVolumeIDRequest, opts ...grpc.CallOption) (*GetDiskNumberFromVolumeIDResponse, error) - // GetVolumeIDFromTargetPath gets the volume id for a given target path. - GetVolumeIDFromTargetPath(ctx context.Context, in *GetVolumeIDFromTargetPathRequest, opts ...grpc.CallOption) (*GetVolumeIDFromTargetPathResponse, error) - // WriteVolumeCache write volume cache to disk. - WriteVolumeCache(ctx context.Context, in *WriteVolumeCacheRequest, opts ...grpc.CallOption) (*WriteVolumeCacheResponse, error) -} - -type volumeClient struct { - cc grpc.ClientConnInterface -} - -func NewVolumeClient(cc grpc.ClientConnInterface) VolumeClient { - return &volumeClient{cc} -} - -func (c *volumeClient) ListVolumesOnDisk(ctx context.Context, in *ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*ListVolumesOnDiskResponse, error) { - out := new(ListVolumesOnDiskResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/ListVolumesOnDisk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) MountVolume(ctx context.Context, in *MountVolumeRequest, opts ...grpc.CallOption) (*MountVolumeResponse, error) { - out := new(MountVolumeResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/MountVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) UnmountVolume(ctx context.Context, in *UnmountVolumeRequest, opts ...grpc.CallOption) (*UnmountVolumeResponse, error) { - out := new(UnmountVolumeResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/UnmountVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) IsVolumeFormatted(ctx context.Context, in *IsVolumeFormattedRequest, opts ...grpc.CallOption) (*IsVolumeFormattedResponse, error) { - out := new(IsVolumeFormattedResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/IsVolumeFormatted", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) FormatVolume(ctx context.Context, in *FormatVolumeRequest, opts ...grpc.CallOption) (*FormatVolumeResponse, error) { - out := new(FormatVolumeResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/FormatVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) ResizeVolume(ctx context.Context, in *ResizeVolumeRequest, opts ...grpc.CallOption) (*ResizeVolumeResponse, error) { - out := new(ResizeVolumeResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/ResizeVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) GetVolumeStats(ctx context.Context, in *GetVolumeStatsRequest, opts ...grpc.CallOption) (*GetVolumeStatsResponse, error) { - out := new(GetVolumeStatsResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/GetVolumeStats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) GetDiskNumberFromVolumeID(ctx context.Context, in *GetDiskNumberFromVolumeIDRequest, opts ...grpc.CallOption) (*GetDiskNumberFromVolumeIDResponse, error) { - out := new(GetDiskNumberFromVolumeIDResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/GetDiskNumberFromVolumeID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) GetVolumeIDFromTargetPath(ctx context.Context, in *GetVolumeIDFromTargetPathRequest, opts ...grpc.CallOption) (*GetVolumeIDFromTargetPathResponse, error) { - out := new(GetVolumeIDFromTargetPathResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/GetVolumeIDFromTargetPath", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) WriteVolumeCache(ctx context.Context, in *WriteVolumeCacheRequest, opts ...grpc.CallOption) (*WriteVolumeCacheResponse, error) { - out := new(WriteVolumeCacheResponse) - err := c.cc.Invoke(ctx, "/v1.Volume/WriteVolumeCache", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// VolumeServer is the server API for Volume service. -type VolumeServer interface { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a - // given disk number and partition number (optional) - ListVolumesOnDisk(context.Context, *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) - // MountVolume mounts the volume at the requested global staging path. - MountVolume(context.Context, *MountVolumeRequest) (*MountVolumeResponse, error) - // UnmountVolume flushes data cache to disk and removes the global staging path. - UnmountVolume(context.Context, *UnmountVolumeRequest) (*UnmountVolumeResponse, error) - // IsVolumeFormatted checks if a volume is formatted. - IsVolumeFormatted(context.Context, *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) - // FormatVolume formats a volume with NTFS. - FormatVolume(context.Context, *FormatVolumeRequest) (*FormatVolumeResponse, error) - // ResizeVolume performs resizing of the partition and file system for a block based volume. - ResizeVolume(context.Context, *ResizeVolumeRequest) (*ResizeVolumeResponse, error) - // GetVolumeStats gathers total bytes and used bytes for a volume. - GetVolumeStats(context.Context, *GetVolumeStatsRequest) (*GetVolumeStatsResponse, error) - // GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located. - GetDiskNumberFromVolumeID(context.Context, *GetDiskNumberFromVolumeIDRequest) (*GetDiskNumberFromVolumeIDResponse, error) - // GetVolumeIDFromTargetPath gets the volume id for a given target path. - GetVolumeIDFromTargetPath(context.Context, *GetVolumeIDFromTargetPathRequest) (*GetVolumeIDFromTargetPathResponse, error) - // WriteVolumeCache write volume cache to disk. - WriteVolumeCache(context.Context, *WriteVolumeCacheRequest) (*WriteVolumeCacheResponse, error) -} - -// UnimplementedVolumeServer can be embedded to have forward compatible implementations. -type UnimplementedVolumeServer struct { -} - -func (*UnimplementedVolumeServer) ListVolumesOnDisk(context.Context, *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListVolumesOnDisk not implemented") -} -func (*UnimplementedVolumeServer) MountVolume(context.Context, *MountVolumeRequest) (*MountVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MountVolume not implemented") -} -func (*UnimplementedVolumeServer) UnmountVolume(context.Context, *UnmountVolumeRequest) (*UnmountVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnmountVolume not implemented") -} -func (*UnimplementedVolumeServer) IsVolumeFormatted(context.Context, *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsVolumeFormatted not implemented") -} -func (*UnimplementedVolumeServer) FormatVolume(context.Context, *FormatVolumeRequest) (*FormatVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FormatVolume not implemented") -} -func (*UnimplementedVolumeServer) ResizeVolume(context.Context, *ResizeVolumeRequest) (*ResizeVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResizeVolume not implemented") -} -func (*UnimplementedVolumeServer) GetVolumeStats(context.Context, *GetVolumeStatsRequest) (*GetVolumeStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVolumeStats not implemented") -} -func (*UnimplementedVolumeServer) GetDiskNumberFromVolumeID(context.Context, *GetDiskNumberFromVolumeIDRequest) (*GetDiskNumberFromVolumeIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDiskNumberFromVolumeID not implemented") -} -func (*UnimplementedVolumeServer) GetVolumeIDFromTargetPath(context.Context, *GetVolumeIDFromTargetPathRequest) (*GetVolumeIDFromTargetPathResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVolumeIDFromTargetPath not implemented") -} -func (*UnimplementedVolumeServer) WriteVolumeCache(context.Context, *WriteVolumeCacheRequest) (*WriteVolumeCacheResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WriteVolumeCache not implemented") -} - -func RegisterVolumeServer(s *grpc.Server, srv VolumeServer) { - s.RegisterService(&_Volume_serviceDesc, srv) -} - -func _Volume_ListVolumesOnDisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListVolumesOnDiskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).ListVolumesOnDisk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/ListVolumesOnDisk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).ListVolumesOnDisk(ctx, req.(*ListVolumesOnDiskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_MountVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MountVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).MountVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/MountVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).MountVolume(ctx, req.(*MountVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_UnmountVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnmountVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).UnmountVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/UnmountVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).UnmountVolume(ctx, req.(*UnmountVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_IsVolumeFormatted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsVolumeFormattedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).IsVolumeFormatted(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/IsVolumeFormatted", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).IsVolumeFormatted(ctx, req.(*IsVolumeFormattedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_FormatVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FormatVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).FormatVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/FormatVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).FormatVolume(ctx, req.(*FormatVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_ResizeVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResizeVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).ResizeVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/ResizeVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).ResizeVolume(ctx, req.(*ResizeVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_GetVolumeStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVolumeStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).GetVolumeStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/GetVolumeStats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetVolumeStats(ctx, req.(*GetVolumeStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_GetDiskNumberFromVolumeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDiskNumberFromVolumeIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).GetDiskNumberFromVolumeID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/GetDiskNumberFromVolumeID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetDiskNumberFromVolumeID(ctx, req.(*GetDiskNumberFromVolumeIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_GetVolumeIDFromTargetPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVolumeIDFromTargetPathRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).GetVolumeIDFromTargetPath(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/GetVolumeIDFromTargetPath", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetVolumeIDFromTargetPath(ctx, req.(*GetVolumeIDFromTargetPathRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_WriteVolumeCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteVolumeCacheRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).WriteVolumeCache(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.Volume/WriteVolumeCache", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).WriteVolumeCache(ctx, req.(*WriteVolumeCacheRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Volume_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Volume", - HandlerType: (*VolumeServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListVolumesOnDisk", - Handler: _Volume_ListVolumesOnDisk_Handler, - }, - { - MethodName: "MountVolume", - Handler: _Volume_MountVolume_Handler, - }, - { - MethodName: "UnmountVolume", - Handler: _Volume_UnmountVolume_Handler, - }, - { - MethodName: "IsVolumeFormatted", - Handler: _Volume_IsVolumeFormatted_Handler, - }, - { - MethodName: "FormatVolume", - Handler: _Volume_FormatVolume_Handler, - }, - { - MethodName: "ResizeVolume", - Handler: _Volume_ResizeVolume_Handler, - }, - { - MethodName: "GetVolumeStats", - Handler: _Volume_GetVolumeStats_Handler, - }, - { - MethodName: "GetDiskNumberFromVolumeID", - Handler: _Volume_GetDiskNumberFromVolumeID_Handler, - }, - { - MethodName: "GetVolumeIDFromTargetPath", - Handler: _Volume_GetVolumeIDFromTargetPath_Handler, - }, - { - MethodName: "WriteVolumeCache", - Handler: _Volume_WriteVolumeCache_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto deleted file mode 100644 index a06538104..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto +++ /dev/null @@ -1,143 +0,0 @@ -syntax = "proto3"; - -package v1; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1"; - -service Volume { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a - // given disk number and partition number (optional) - rpc ListVolumesOnDisk(ListVolumesOnDiskRequest) returns (ListVolumesOnDiskResponse) {} - - // MountVolume mounts the volume at the requested global staging path. - rpc MountVolume(MountVolumeRequest) returns (MountVolumeResponse) {} - - // UnmountVolume flushes data cache to disk and removes the global staging path. - rpc UnmountVolume(UnmountVolumeRequest) returns (UnmountVolumeResponse) {} - - // IsVolumeFormatted checks if a volume is formatted. - rpc IsVolumeFormatted(IsVolumeFormattedRequest) returns (IsVolumeFormattedResponse) {} - - // FormatVolume formats a volume with NTFS. - rpc FormatVolume(FormatVolumeRequest) returns (FormatVolumeResponse) {} - - // ResizeVolume performs resizing of the partition and file system for a block based volume. - rpc ResizeVolume(ResizeVolumeRequest) returns (ResizeVolumeResponse) {} - - // GetVolumeStats gathers total bytes and used bytes for a volume. - rpc GetVolumeStats(GetVolumeStatsRequest) returns (GetVolumeStatsResponse) {} - - // GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located. - rpc GetDiskNumberFromVolumeID(GetDiskNumberFromVolumeIDRequest) returns (GetDiskNumberFromVolumeIDResponse ) {} - - // GetVolumeIDFromTargetPath gets the volume id for a given target path. - rpc GetVolumeIDFromTargetPath(GetVolumeIDFromTargetPathRequest) returns (GetVolumeIDFromTargetPathResponse) {} - - // WriteVolumeCache write volume cache to disk. - rpc WriteVolumeCache(WriteVolumeCacheRequest) returns (WriteVolumeCacheResponse) {} -} - -message ListVolumesOnDiskRequest { - // Disk device number of the disk to query for volumes. - uint32 disk_number = 1; - // The partition number (optional), by default it uses the first partition of the disk. - uint32 partition_number = 2; -} - -message ListVolumesOnDiskResponse { - // Volume device IDs of volumes on the specified disk. - repeated string volume_ids = 1; -} - -message MountVolumeRequest { - // Volume device ID of the volume to mount. - string volume_id = 1; - // Path in the host's file system where the volume needs to be mounted. - string target_path = 2; -} - -message MountVolumeResponse { - // Intentionally empty. -} - -message UnmountVolumeRequest { - // Volume device ID of the volume to dismount. - string volume_id = 1; - // Path where the volume has been mounted. - string target_path = 2; -} - -message UnmountVolumeResponse { - // Intentionally empty. -} - -message IsVolumeFormattedRequest { - // Volume device ID of the volume to check. - string volume_id = 1; -} - -message IsVolumeFormattedResponse { - // Is the volume formatted with NTFS. - bool formatted = 1; -} - -message FormatVolumeRequest { - // Volume device ID of the volume to format. - string volume_id = 1; -} - -message FormatVolumeResponse { - // Intentionally empty. -} - -message ResizeVolumeRequest { - // Volume device ID of the volume to resize. - string volume_id = 1; - // New size in bytes of the volume. - int64 size_bytes = 2; -} - -message ResizeVolumeResponse { - // Intentionally empty. -} - -message GetVolumeStatsRequest{ - // Volume device Id of the volume to get the stats for. - string volume_id = 1; -} - -message GetVolumeStatsResponse{ - // Total bytes - int64 total_bytes = 1; - // Used bytes - int64 used_bytes = 2; -} - -message GetDiskNumberFromVolumeIDRequest { - // Volume device ID of the volume to get the disk number for. - string volume_id = 1; -} - -message GetDiskNumberFromVolumeIDResponse { - // Corresponding disk number. - uint32 disk_number = 1; -} - -message GetVolumeIDFromTargetPathRequest { - // The target path. - string target_path = 1; -} - -message GetVolumeIDFromTargetPathResponse { - // The volume device ID. - string volume_id = 1; -} - -message WriteVolumeCacheRequest { - // Volume device ID of the volume to flush the cache. - string volume_id = 1; -} - -message WriteVolumeCacheResponse { - // Intentionally empty. -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.pb.go deleted file mode 100644 index 3213b4b56..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.pb.go +++ /dev/null @@ -1,1197 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: volume/v1beta1/api.proto - -package v1beta1 - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ListVolumesOnDiskRequest struct { - // Disk device ID of the disk to query for volumes - DiskId string `protobuf:"bytes,1,opt,name=disk_id,json=diskId,proto3" json:"disk_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListVolumesOnDiskRequest) Reset() { *m = ListVolumesOnDiskRequest{} } -func (m *ListVolumesOnDiskRequest) String() string { return proto.CompactTextString(m) } -func (*ListVolumesOnDiskRequest) ProtoMessage() {} -func (*ListVolumesOnDiskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{0} -} - -func (m *ListVolumesOnDiskRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListVolumesOnDiskRequest.Unmarshal(m, b) -} -func (m *ListVolumesOnDiskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListVolumesOnDiskRequest.Marshal(b, m, deterministic) -} -func (m *ListVolumesOnDiskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListVolumesOnDiskRequest.Merge(m, src) -} -func (m *ListVolumesOnDiskRequest) XXX_Size() int { - return xxx_messageInfo_ListVolumesOnDiskRequest.Size(m) -} -func (m *ListVolumesOnDiskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListVolumesOnDiskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListVolumesOnDiskRequest proto.InternalMessageInfo - -func (m *ListVolumesOnDiskRequest) GetDiskId() string { - if m != nil { - return m.DiskId - } - return "" -} - -type ListVolumesOnDiskResponse struct { - // Volume device IDs of volumes on the specified disk - VolumeIds []string `protobuf:"bytes,1,rep,name=volume_ids,json=volumeIds,proto3" json:"volume_ids,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListVolumesOnDiskResponse) Reset() { *m = ListVolumesOnDiskResponse{} } -func (m *ListVolumesOnDiskResponse) String() string { return proto.CompactTextString(m) } -func (*ListVolumesOnDiskResponse) ProtoMessage() {} -func (*ListVolumesOnDiskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{1} -} - -func (m *ListVolumesOnDiskResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListVolumesOnDiskResponse.Unmarshal(m, b) -} -func (m *ListVolumesOnDiskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListVolumesOnDiskResponse.Marshal(b, m, deterministic) -} -func (m *ListVolumesOnDiskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListVolumesOnDiskResponse.Merge(m, src) -} -func (m *ListVolumesOnDiskResponse) XXX_Size() int { - return xxx_messageInfo_ListVolumesOnDiskResponse.Size(m) -} -func (m *ListVolumesOnDiskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListVolumesOnDiskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListVolumesOnDiskResponse proto.InternalMessageInfo - -func (m *ListVolumesOnDiskResponse) GetVolumeIds() []string { - if m != nil { - return m.VolumeIds - } - return nil -} - -type MountVolumeRequest struct { - // Volume device ID of the volume to mount - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Path in the host's file system where the volume needs to be mounted - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MountVolumeRequest) Reset() { *m = MountVolumeRequest{} } -func (m *MountVolumeRequest) String() string { return proto.CompactTextString(m) } -func (*MountVolumeRequest) ProtoMessage() {} -func (*MountVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{2} -} - -func (m *MountVolumeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MountVolumeRequest.Unmarshal(m, b) -} -func (m *MountVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MountVolumeRequest.Marshal(b, m, deterministic) -} -func (m *MountVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MountVolumeRequest.Merge(m, src) -} -func (m *MountVolumeRequest) XXX_Size() int { - return xxx_messageInfo_MountVolumeRequest.Size(m) -} -func (m *MountVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MountVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MountVolumeRequest proto.InternalMessageInfo - -func (m *MountVolumeRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -func (m *MountVolumeRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -type MountVolumeResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MountVolumeResponse) Reset() { *m = MountVolumeResponse{} } -func (m *MountVolumeResponse) String() string { return proto.CompactTextString(m) } -func (*MountVolumeResponse) ProtoMessage() {} -func (*MountVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{3} -} - -func (m *MountVolumeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MountVolumeResponse.Unmarshal(m, b) -} -func (m *MountVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MountVolumeResponse.Marshal(b, m, deterministic) -} -func (m *MountVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MountVolumeResponse.Merge(m, src) -} -func (m *MountVolumeResponse) XXX_Size() int { - return xxx_messageInfo_MountVolumeResponse.Size(m) -} -func (m *MountVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MountVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MountVolumeResponse proto.InternalMessageInfo - -type DismountVolumeRequest struct { - // Volume device ID of the volume to dismount - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Path where the volume has been mounted. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DismountVolumeRequest) Reset() { *m = DismountVolumeRequest{} } -func (m *DismountVolumeRequest) String() string { return proto.CompactTextString(m) } -func (*DismountVolumeRequest) ProtoMessage() {} -func (*DismountVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{4} -} - -func (m *DismountVolumeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DismountVolumeRequest.Unmarshal(m, b) -} -func (m *DismountVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DismountVolumeRequest.Marshal(b, m, deterministic) -} -func (m *DismountVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DismountVolumeRequest.Merge(m, src) -} -func (m *DismountVolumeRequest) XXX_Size() int { - return xxx_messageInfo_DismountVolumeRequest.Size(m) -} -func (m *DismountVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DismountVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DismountVolumeRequest proto.InternalMessageInfo - -func (m *DismountVolumeRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -func (m *DismountVolumeRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -type DismountVolumeResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DismountVolumeResponse) Reset() { *m = DismountVolumeResponse{} } -func (m *DismountVolumeResponse) String() string { return proto.CompactTextString(m) } -func (*DismountVolumeResponse) ProtoMessage() {} -func (*DismountVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{5} -} - -func (m *DismountVolumeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DismountVolumeResponse.Unmarshal(m, b) -} -func (m *DismountVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DismountVolumeResponse.Marshal(b, m, deterministic) -} -func (m *DismountVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DismountVolumeResponse.Merge(m, src) -} -func (m *DismountVolumeResponse) XXX_Size() int { - return xxx_messageInfo_DismountVolumeResponse.Size(m) -} -func (m *DismountVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DismountVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DismountVolumeResponse proto.InternalMessageInfo - -type IsVolumeFormattedRequest struct { - // Volume device ID of the volume to check - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsVolumeFormattedRequest) Reset() { *m = IsVolumeFormattedRequest{} } -func (m *IsVolumeFormattedRequest) String() string { return proto.CompactTextString(m) } -func (*IsVolumeFormattedRequest) ProtoMessage() {} -func (*IsVolumeFormattedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{6} -} - -func (m *IsVolumeFormattedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsVolumeFormattedRequest.Unmarshal(m, b) -} -func (m *IsVolumeFormattedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsVolumeFormattedRequest.Marshal(b, m, deterministic) -} -func (m *IsVolumeFormattedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsVolumeFormattedRequest.Merge(m, src) -} -func (m *IsVolumeFormattedRequest) XXX_Size() int { - return xxx_messageInfo_IsVolumeFormattedRequest.Size(m) -} -func (m *IsVolumeFormattedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IsVolumeFormattedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_IsVolumeFormattedRequest proto.InternalMessageInfo - -func (m *IsVolumeFormattedRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -type IsVolumeFormattedResponse struct { - // Is the volume formatted with NTFS - Formatted bool `protobuf:"varint,1,opt,name=formatted,proto3" json:"formatted,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsVolumeFormattedResponse) Reset() { *m = IsVolumeFormattedResponse{} } -func (m *IsVolumeFormattedResponse) String() string { return proto.CompactTextString(m) } -func (*IsVolumeFormattedResponse) ProtoMessage() {} -func (*IsVolumeFormattedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{7} -} - -func (m *IsVolumeFormattedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsVolumeFormattedResponse.Unmarshal(m, b) -} -func (m *IsVolumeFormattedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsVolumeFormattedResponse.Marshal(b, m, deterministic) -} -func (m *IsVolumeFormattedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsVolumeFormattedResponse.Merge(m, src) -} -func (m *IsVolumeFormattedResponse) XXX_Size() int { - return xxx_messageInfo_IsVolumeFormattedResponse.Size(m) -} -func (m *IsVolumeFormattedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IsVolumeFormattedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IsVolumeFormattedResponse proto.InternalMessageInfo - -func (m *IsVolumeFormattedResponse) GetFormatted() bool { - if m != nil { - return m.Formatted - } - return false -} - -type FormatVolumeRequest struct { - // Volume device ID of the volume to format - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FormatVolumeRequest) Reset() { *m = FormatVolumeRequest{} } -func (m *FormatVolumeRequest) String() string { return proto.CompactTextString(m) } -func (*FormatVolumeRequest) ProtoMessage() {} -func (*FormatVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{8} -} - -func (m *FormatVolumeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FormatVolumeRequest.Unmarshal(m, b) -} -func (m *FormatVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FormatVolumeRequest.Marshal(b, m, deterministic) -} -func (m *FormatVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FormatVolumeRequest.Merge(m, src) -} -func (m *FormatVolumeRequest) XXX_Size() int { - return xxx_messageInfo_FormatVolumeRequest.Size(m) -} -func (m *FormatVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FormatVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FormatVolumeRequest proto.InternalMessageInfo - -func (m *FormatVolumeRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -type FormatVolumeResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FormatVolumeResponse) Reset() { *m = FormatVolumeResponse{} } -func (m *FormatVolumeResponse) String() string { return proto.CompactTextString(m) } -func (*FormatVolumeResponse) ProtoMessage() {} -func (*FormatVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{9} -} - -func (m *FormatVolumeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FormatVolumeResponse.Unmarshal(m, b) -} -func (m *FormatVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FormatVolumeResponse.Marshal(b, m, deterministic) -} -func (m *FormatVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FormatVolumeResponse.Merge(m, src) -} -func (m *FormatVolumeResponse) XXX_Size() int { - return xxx_messageInfo_FormatVolumeResponse.Size(m) -} -func (m *FormatVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FormatVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_FormatVolumeResponse proto.InternalMessageInfo - -type ResizeVolumeRequest struct { - // Volume device ID of the volume to dismount - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // New size of the volume - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResizeVolumeRequest) Reset() { *m = ResizeVolumeRequest{} } -func (m *ResizeVolumeRequest) String() string { return proto.CompactTextString(m) } -func (*ResizeVolumeRequest) ProtoMessage() {} -func (*ResizeVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{10} -} - -func (m *ResizeVolumeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResizeVolumeRequest.Unmarshal(m, b) -} -func (m *ResizeVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResizeVolumeRequest.Marshal(b, m, deterministic) -} -func (m *ResizeVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResizeVolumeRequest.Merge(m, src) -} -func (m *ResizeVolumeRequest) XXX_Size() int { - return xxx_messageInfo_ResizeVolumeRequest.Size(m) -} -func (m *ResizeVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ResizeVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ResizeVolumeRequest proto.InternalMessageInfo - -func (m *ResizeVolumeRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -func (m *ResizeVolumeRequest) GetSize() int64 { - if m != nil { - return m.Size - } - return 0 -} - -type ResizeVolumeResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResizeVolumeResponse) Reset() { *m = ResizeVolumeResponse{} } -func (m *ResizeVolumeResponse) String() string { return proto.CompactTextString(m) } -func (*ResizeVolumeResponse) ProtoMessage() {} -func (*ResizeVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{11} -} - -func (m *ResizeVolumeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResizeVolumeResponse.Unmarshal(m, b) -} -func (m *ResizeVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResizeVolumeResponse.Marshal(b, m, deterministic) -} -func (m *ResizeVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResizeVolumeResponse.Merge(m, src) -} -func (m *ResizeVolumeResponse) XXX_Size() int { - return xxx_messageInfo_ResizeVolumeResponse.Size(m) -} -func (m *ResizeVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ResizeVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ResizeVolumeResponse proto.InternalMessageInfo - -type VolumeStatsRequest struct { - // Volume device Id of the volume to get the stats for - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeStatsRequest) Reset() { *m = VolumeStatsRequest{} } -func (m *VolumeStatsRequest) String() string { return proto.CompactTextString(m) } -func (*VolumeStatsRequest) ProtoMessage() {} -func (*VolumeStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{12} -} - -func (m *VolumeStatsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeStatsRequest.Unmarshal(m, b) -} -func (m *VolumeStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeStatsRequest.Marshal(b, m, deterministic) -} -func (m *VolumeStatsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeStatsRequest.Merge(m, src) -} -func (m *VolumeStatsRequest) XXX_Size() int { - return xxx_messageInfo_VolumeStatsRequest.Size(m) -} -func (m *VolumeStatsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeStatsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeStatsRequest proto.InternalMessageInfo - -func (m *VolumeStatsRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -type VolumeStatsResponse struct { - // Capacity of the volume - VolumeSize int64 `protobuf:"varint,1,opt,name=volumeSize,proto3" json:"volumeSize,omitempty"` - // Used bytes - VolumeUsedSize int64 `protobuf:"varint,2,opt,name=volumeUsedSize,proto3" json:"volumeUsedSize,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeStatsResponse) Reset() { *m = VolumeStatsResponse{} } -func (m *VolumeStatsResponse) String() string { return proto.CompactTextString(m) } -func (*VolumeStatsResponse) ProtoMessage() {} -func (*VolumeStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{13} -} - -func (m *VolumeStatsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeStatsResponse.Unmarshal(m, b) -} -func (m *VolumeStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeStatsResponse.Marshal(b, m, deterministic) -} -func (m *VolumeStatsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeStatsResponse.Merge(m, src) -} -func (m *VolumeStatsResponse) XXX_Size() int { - return xxx_messageInfo_VolumeStatsResponse.Size(m) -} -func (m *VolumeStatsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeStatsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeStatsResponse proto.InternalMessageInfo - -func (m *VolumeStatsResponse) GetVolumeSize() int64 { - if m != nil { - return m.VolumeSize - } - return 0 -} - -func (m *VolumeStatsResponse) GetVolumeUsedSize() int64 { - if m != nil { - return m.VolumeUsedSize - } - return 0 -} - -type VolumeDiskNumberRequest struct { - // Volume device Id of the volume to get the disk number for - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeDiskNumberRequest) Reset() { *m = VolumeDiskNumberRequest{} } -func (m *VolumeDiskNumberRequest) String() string { return proto.CompactTextString(m) } -func (*VolumeDiskNumberRequest) ProtoMessage() {} -func (*VolumeDiskNumberRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{14} -} - -func (m *VolumeDiskNumberRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeDiskNumberRequest.Unmarshal(m, b) -} -func (m *VolumeDiskNumberRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeDiskNumberRequest.Marshal(b, m, deterministic) -} -func (m *VolumeDiskNumberRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeDiskNumberRequest.Merge(m, src) -} -func (m *VolumeDiskNumberRequest) XXX_Size() int { - return xxx_messageInfo_VolumeDiskNumberRequest.Size(m) -} -func (m *VolumeDiskNumberRequest) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeDiskNumberRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeDiskNumberRequest proto.InternalMessageInfo - -func (m *VolumeDiskNumberRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -type VolumeDiskNumberResponse struct { - // Corresponding disk number - DiskNumber int64 `protobuf:"varint,1,opt,name=diskNumber,proto3" json:"diskNumber,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeDiskNumberResponse) Reset() { *m = VolumeDiskNumberResponse{} } -func (m *VolumeDiskNumberResponse) String() string { return proto.CompactTextString(m) } -func (*VolumeDiskNumberResponse) ProtoMessage() {} -func (*VolumeDiskNumberResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{15} -} - -func (m *VolumeDiskNumberResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeDiskNumberResponse.Unmarshal(m, b) -} -func (m *VolumeDiskNumberResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeDiskNumberResponse.Marshal(b, m, deterministic) -} -func (m *VolumeDiskNumberResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeDiskNumberResponse.Merge(m, src) -} -func (m *VolumeDiskNumberResponse) XXX_Size() int { - return xxx_messageInfo_VolumeDiskNumberResponse.Size(m) -} -func (m *VolumeDiskNumberResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeDiskNumberResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeDiskNumberResponse proto.InternalMessageInfo - -func (m *VolumeDiskNumberResponse) GetDiskNumber() int64 { - if m != nil { - return m.DiskNumber - } - return 0 -} - -type VolumeIDFromMountRequest struct { - // Mount - Mount string `protobuf:"bytes,1,opt,name=mount,proto3" json:"mount,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeIDFromMountRequest) Reset() { *m = VolumeIDFromMountRequest{} } -func (m *VolumeIDFromMountRequest) String() string { return proto.CompactTextString(m) } -func (*VolumeIDFromMountRequest) ProtoMessage() {} -func (*VolumeIDFromMountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{16} -} - -func (m *VolumeIDFromMountRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeIDFromMountRequest.Unmarshal(m, b) -} -func (m *VolumeIDFromMountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeIDFromMountRequest.Marshal(b, m, deterministic) -} -func (m *VolumeIDFromMountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeIDFromMountRequest.Merge(m, src) -} -func (m *VolumeIDFromMountRequest) XXX_Size() int { - return xxx_messageInfo_VolumeIDFromMountRequest.Size(m) -} -func (m *VolumeIDFromMountRequest) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeIDFromMountRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeIDFromMountRequest proto.InternalMessageInfo - -func (m *VolumeIDFromMountRequest) GetMount() string { - if m != nil { - return m.Mount - } - return "" -} - -type VolumeIDFromMountResponse struct { - // Mount - VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VolumeIDFromMountResponse) Reset() { *m = VolumeIDFromMountResponse{} } -func (m *VolumeIDFromMountResponse) String() string { return proto.CompactTextString(m) } -func (*VolumeIDFromMountResponse) ProtoMessage() {} -func (*VolumeIDFromMountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e25953f9b6119981, []int{17} -} - -func (m *VolumeIDFromMountResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VolumeIDFromMountResponse.Unmarshal(m, b) -} -func (m *VolumeIDFromMountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VolumeIDFromMountResponse.Marshal(b, m, deterministic) -} -func (m *VolumeIDFromMountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeIDFromMountResponse.Merge(m, src) -} -func (m *VolumeIDFromMountResponse) XXX_Size() int { - return xxx_messageInfo_VolumeIDFromMountResponse.Size(m) -} -func (m *VolumeIDFromMountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeIDFromMountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeIDFromMountResponse proto.InternalMessageInfo - -func (m *VolumeIDFromMountResponse) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -func init() { - proto.RegisterType((*ListVolumesOnDiskRequest)(nil), "v1beta1.ListVolumesOnDiskRequest") - proto.RegisterType((*ListVolumesOnDiskResponse)(nil), "v1beta1.ListVolumesOnDiskResponse") - proto.RegisterType((*MountVolumeRequest)(nil), "v1beta1.MountVolumeRequest") - proto.RegisterType((*MountVolumeResponse)(nil), "v1beta1.MountVolumeResponse") - proto.RegisterType((*DismountVolumeRequest)(nil), "v1beta1.DismountVolumeRequest") - proto.RegisterType((*DismountVolumeResponse)(nil), "v1beta1.DismountVolumeResponse") - proto.RegisterType((*IsVolumeFormattedRequest)(nil), "v1beta1.IsVolumeFormattedRequest") - proto.RegisterType((*IsVolumeFormattedResponse)(nil), "v1beta1.IsVolumeFormattedResponse") - proto.RegisterType((*FormatVolumeRequest)(nil), "v1beta1.FormatVolumeRequest") - proto.RegisterType((*FormatVolumeResponse)(nil), "v1beta1.FormatVolumeResponse") - proto.RegisterType((*ResizeVolumeRequest)(nil), "v1beta1.ResizeVolumeRequest") - proto.RegisterType((*ResizeVolumeResponse)(nil), "v1beta1.ResizeVolumeResponse") - proto.RegisterType((*VolumeStatsRequest)(nil), "v1beta1.VolumeStatsRequest") - proto.RegisterType((*VolumeStatsResponse)(nil), "v1beta1.VolumeStatsResponse") - proto.RegisterType((*VolumeDiskNumberRequest)(nil), "v1beta1.VolumeDiskNumberRequest") - proto.RegisterType((*VolumeDiskNumberResponse)(nil), "v1beta1.VolumeDiskNumberResponse") - proto.RegisterType((*VolumeIDFromMountRequest)(nil), "v1beta1.VolumeIDFromMountRequest") - proto.RegisterType((*VolumeIDFromMountResponse)(nil), "v1beta1.VolumeIDFromMountResponse") -} - -func init() { proto.RegisterFile("volume/v1beta1/api.proto", fileDescriptor_e25953f9b6119981) } - -var fileDescriptor_e25953f9b6119981 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5b, 0x6f, 0xd3, 0x30, - 0x18, 0x5d, 0x19, 0x74, 0xeb, 0x07, 0x9a, 0x34, 0xb7, 0xdb, 0xd2, 0xee, 0x42, 0xe7, 0x07, 0xb4, - 0x97, 0x35, 0x74, 0x93, 0xb8, 0x4c, 0x42, 0x48, 0xa8, 0x14, 0x8a, 0x18, 0x48, 0xa9, 0xe0, 0x01, - 0x0d, 0x55, 0x6d, 0x63, 0x98, 0xd5, 0xe5, 0x42, 0xec, 0x4c, 0xc0, 0x8f, 0xe0, 0x37, 0xa3, 0xd8, - 0x4e, 0xe2, 0xdc, 0xaa, 0x22, 0xf1, 0x96, 0x1c, 0xfb, 0x9c, 0xf3, 0xd9, 0xdf, 0x77, 0x64, 0x30, - 0x6e, 0xbd, 0x9b, 0xd0, 0x21, 0xe6, 0x6d, 0x7f, 0x46, 0xf8, 0xb4, 0x6f, 0x4e, 0x7d, 0xda, 0xf3, - 0x03, 0x8f, 0x7b, 0x68, 0x43, 0x41, 0xf8, 0x1c, 0x8c, 0xf7, 0x94, 0xf1, 0xcf, 0x62, 0x23, 0xfb, - 0xe8, 0x0e, 0x28, 0x5b, 0x58, 0xe4, 0x47, 0x48, 0x18, 0x47, 0x7b, 0xb0, 0x61, 0x53, 0xb6, 0x98, - 0x50, 0xdb, 0xa8, 0x75, 0x6b, 0x27, 0x0d, 0xab, 0x1e, 0xfd, 0x8e, 0x6c, 0x7c, 0x01, 0xed, 0x12, - 0x12, 0xf3, 0x3d, 0x97, 0x11, 0x74, 0x08, 0x20, 0x6d, 0x27, 0xd4, 0x66, 0x46, 0xad, 0xbb, 0x7e, - 0xd2, 0xb0, 0x1a, 0x12, 0x19, 0xd9, 0x0c, 0xbf, 0x06, 0x74, 0xe9, 0x85, 0xae, 0x22, 0xc7, 0x56, - 0xfb, 0xd0, 0x48, 0x48, 0xca, 0x6c, 0x33, 0xe6, 0x20, 0x04, 0x77, 0xfd, 0x29, 0xbf, 0x36, 0xee, - 0x08, 0x5c, 0x7c, 0xe3, 0x1d, 0x68, 0x66, 0x64, 0xa4, 0x39, 0x7e, 0x0b, 0x3b, 0x03, 0xca, 0x9c, - 0xff, 0x60, 0x60, 0xc0, 0x6e, 0x5e, 0x49, 0x79, 0x3c, 0x05, 0x63, 0xc4, 0x24, 0x36, 0xf4, 0x02, - 0x67, 0xca, 0x39, 0xb1, 0x57, 0xb1, 0xc1, 0xcf, 0xa1, 0x5d, 0x42, 0x54, 0xd7, 0x76, 0x00, 0x8d, - 0x6f, 0x31, 0x28, 0x98, 0x9b, 0x56, 0x0a, 0xe0, 0x33, 0x68, 0x4a, 0xca, 0xea, 0xa7, 0xc2, 0xbb, - 0xd0, 0xca, 0x72, 0x54, 0xfd, 0x43, 0x68, 0x5a, 0x84, 0xd1, 0xdf, 0xe4, 0xdf, 0x6e, 0x28, 0x62, - 0x88, 0x1b, 0x5a, 0xb7, 0xc4, 0x77, 0xa4, 0x9f, 0xd5, 0x51, 0xfa, 0x7d, 0x40, 0x12, 0x19, 0xf3, - 0x29, 0x67, 0x2b, 0x95, 0xfa, 0x15, 0x9a, 0x19, 0x8a, 0xba, 0x93, 0xa3, 0x78, 0x94, 0xc6, 0x91, - 0x77, 0x4d, 0x78, 0x6b, 0x08, 0x7a, 0x04, 0x5b, 0xf2, 0xef, 0x13, 0x23, 0xf6, 0x38, 0xad, 0x2f, - 0x87, 0xe2, 0x27, 0xb0, 0x27, 0xe5, 0xa3, 0x41, 0xfd, 0x10, 0x3a, 0x33, 0x12, 0xac, 0x54, 0xd6, - 0x05, 0x18, 0x45, 0x5e, 0x5a, 0x9b, 0x9d, 0xa0, 0x71, 0x6d, 0x29, 0x82, 0x1f, 0xc7, 0xdc, 0xd1, - 0x60, 0x18, 0x78, 0x8e, 0x18, 0xd6, 0xd8, 0xb4, 0x05, 0xf7, 0xc4, 0x60, 0x29, 0x43, 0xf9, 0x83, - 0x9f, 0x41, 0xbb, 0x84, 0xa1, 0xec, 0x96, 0xd5, 0x79, 0xf6, 0xa7, 0x0e, 0x75, 0x49, 0x45, 0x57, - 0xb0, 0x5d, 0x88, 0x26, 0x3a, 0xee, 0xa9, 0xb8, 0xf7, 0xaa, 0xb2, 0xde, 0xc1, 0xcb, 0xb6, 0xa8, - 0xc6, 0xae, 0xa1, 0x77, 0x70, 0x5f, 0x4b, 0x1d, 0xda, 0x4f, 0x48, 0xc5, 0x48, 0x77, 0x0e, 0xca, - 0x17, 0x13, 0xad, 0x31, 0x6c, 0x65, 0x03, 0x86, 0x8e, 0x12, 0x46, 0x69, 0x86, 0x3b, 0x0f, 0x2b, - 0xd7, 0x13, 0xd1, 0x2b, 0xd8, 0x2e, 0x44, 0x4c, 0x3b, 0x7e, 0x55, 0x6e, 0xb5, 0xe3, 0x57, 0x26, - 0x14, 0xaf, 0xa1, 0x4b, 0x78, 0xa0, 0x27, 0x0a, 0xa5, 0x47, 0x2c, 0x09, 0x67, 0xe7, 0xb0, 0x62, - 0x55, 0x97, 0xd3, 0x03, 0xa4, 0xc9, 0x95, 0xe4, 0x53, 0x93, 0x2b, 0x4d, 0x9d, 0x68, 0x8e, 0x16, - 0x22, 0xad, 0x39, 0xc5, 0x34, 0x6a, 0xcd, 0x29, 0xc9, 0x9d, 0xb8, 0xc7, 0xe6, 0x1b, 0xc2, 0xf3, - 0xc3, 0x8f, 0xba, 0x39, 0x5a, 0x21, 0x4f, 0x9d, 0xe3, 0x25, 0x3b, 0x12, 0xf5, 0x09, 0xb4, 0x12, - 0x75, 0x6d, 0xd8, 0x51, 0x9e, 0x5c, 0x8c, 0x8e, 0xd6, 0xa8, 0xca, 0xac, 0xe0, 0xb5, 0x57, 0x2f, - 0xbf, 0xbc, 0xf8, 0x4e, 0xf9, 0x75, 0x38, 0xeb, 0xcd, 0x3d, 0xc7, 0x5c, 0x84, 0x33, 0x12, 0xb8, - 0x84, 0x13, 0x76, 0x3a, 0x67, 0xd4, 0x9c, 0x33, 0x7a, 0xea, 0x07, 0xde, 0xcf, 0x5f, 0xe6, 0xfc, - 0x86, 0x12, 0x97, 0x47, 0xcf, 0xa2, 0x99, 0x7d, 0x29, 0x67, 0x75, 0xf1, 0x4c, 0x9e, 0xff, 0x0d, - 0x00, 0x00, 0xff, 0xff, 0xb6, 0x33, 0x17, 0x80, 0x42, 0x07, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// VolumeClient is the client API for Volume service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type VolumeClient interface { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for - // all volumes on a Disk device - ListVolumesOnDisk(ctx context.Context, in *ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*ListVolumesOnDiskResponse, error) - // MountVolume mounts the volume at the requested global staging path - MountVolume(ctx context.Context, in *MountVolumeRequest, opts ...grpc.CallOption) (*MountVolumeResponse, error) - // DismountVolume gracefully dismounts a volume - DismountVolume(ctx context.Context, in *DismountVolumeRequest, opts ...grpc.CallOption) (*DismountVolumeResponse, error) - // IsVolumeFormatted checks if a volume is formatted with NTFS - IsVolumeFormatted(ctx context.Context, in *IsVolumeFormattedRequest, opts ...grpc.CallOption) (*IsVolumeFormattedResponse, error) - // FormatVolume formats a volume with the provided file system - FormatVolume(ctx context.Context, in *FormatVolumeRequest, opts ...grpc.CallOption) (*FormatVolumeResponse, error) - // ResizeVolume performs resizing of the partition and file system for a block based volume - ResizeVolume(ctx context.Context, in *ResizeVolumeRequest, opts ...grpc.CallOption) (*ResizeVolumeResponse, error) - // VolumeStats gathers DiskSize, VolumeSize and VolumeUsedSize for a volume - VolumeStats(ctx context.Context, in *VolumeStatsRequest, opts ...grpc.CallOption) (*VolumeStatsResponse, error) - // GetVolumeDiskNumber gets the disk number of the disk where the volume is located - GetVolumeDiskNumber(ctx context.Context, in *VolumeDiskNumberRequest, opts ...grpc.CallOption) (*VolumeDiskNumberResponse, error) - // GetVolumeIDFromMount gets the volume id for a given mount - GetVolumeIDFromMount(ctx context.Context, in *VolumeIDFromMountRequest, opts ...grpc.CallOption) (*VolumeIDFromMountResponse, error) -} - -type volumeClient struct { - cc *grpc.ClientConn -} - -func NewVolumeClient(cc *grpc.ClientConn) VolumeClient { - return &volumeClient{cc} -} - -func (c *volumeClient) ListVolumesOnDisk(ctx context.Context, in *ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*ListVolumesOnDiskResponse, error) { - out := new(ListVolumesOnDiskResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/ListVolumesOnDisk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) MountVolume(ctx context.Context, in *MountVolumeRequest, opts ...grpc.CallOption) (*MountVolumeResponse, error) { - out := new(MountVolumeResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/MountVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) DismountVolume(ctx context.Context, in *DismountVolumeRequest, opts ...grpc.CallOption) (*DismountVolumeResponse, error) { - out := new(DismountVolumeResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/DismountVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) IsVolumeFormatted(ctx context.Context, in *IsVolumeFormattedRequest, opts ...grpc.CallOption) (*IsVolumeFormattedResponse, error) { - out := new(IsVolumeFormattedResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/IsVolumeFormatted", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) FormatVolume(ctx context.Context, in *FormatVolumeRequest, opts ...grpc.CallOption) (*FormatVolumeResponse, error) { - out := new(FormatVolumeResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/FormatVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) ResizeVolume(ctx context.Context, in *ResizeVolumeRequest, opts ...grpc.CallOption) (*ResizeVolumeResponse, error) { - out := new(ResizeVolumeResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/ResizeVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) VolumeStats(ctx context.Context, in *VolumeStatsRequest, opts ...grpc.CallOption) (*VolumeStatsResponse, error) { - out := new(VolumeStatsResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/VolumeStats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) GetVolumeDiskNumber(ctx context.Context, in *VolumeDiskNumberRequest, opts ...grpc.CallOption) (*VolumeDiskNumberResponse, error) { - out := new(VolumeDiskNumberResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/GetVolumeDiskNumber", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *volumeClient) GetVolumeIDFromMount(ctx context.Context, in *VolumeIDFromMountRequest, opts ...grpc.CallOption) (*VolumeIDFromMountResponse, error) { - out := new(VolumeIDFromMountResponse) - err := c.cc.Invoke(ctx, "/v1beta1.Volume/GetVolumeIDFromMount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// VolumeServer is the server API for Volume service. -type VolumeServer interface { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for - // all volumes on a Disk device - ListVolumesOnDisk(context.Context, *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) - // MountVolume mounts the volume at the requested global staging path - MountVolume(context.Context, *MountVolumeRequest) (*MountVolumeResponse, error) - // DismountVolume gracefully dismounts a volume - DismountVolume(context.Context, *DismountVolumeRequest) (*DismountVolumeResponse, error) - // IsVolumeFormatted checks if a volume is formatted with NTFS - IsVolumeFormatted(context.Context, *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) - // FormatVolume formats a volume with the provided file system - FormatVolume(context.Context, *FormatVolumeRequest) (*FormatVolumeResponse, error) - // ResizeVolume performs resizing of the partition and file system for a block based volume - ResizeVolume(context.Context, *ResizeVolumeRequest) (*ResizeVolumeResponse, error) - // VolumeStats gathers DiskSize, VolumeSize and VolumeUsedSize for a volume - VolumeStats(context.Context, *VolumeStatsRequest) (*VolumeStatsResponse, error) - // GetVolumeDiskNumber gets the disk number of the disk where the volume is located - GetVolumeDiskNumber(context.Context, *VolumeDiskNumberRequest) (*VolumeDiskNumberResponse, error) - // GetVolumeIDFromMount gets the volume id for a given mount - GetVolumeIDFromMount(context.Context, *VolumeIDFromMountRequest) (*VolumeIDFromMountResponse, error) -} - -// UnimplementedVolumeServer can be embedded to have forward compatible implementations. -type UnimplementedVolumeServer struct { -} - -func (*UnimplementedVolumeServer) ListVolumesOnDisk(ctx context.Context, req *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListVolumesOnDisk not implemented") -} -func (*UnimplementedVolumeServer) MountVolume(ctx context.Context, req *MountVolumeRequest) (*MountVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MountVolume not implemented") -} -func (*UnimplementedVolumeServer) DismountVolume(ctx context.Context, req *DismountVolumeRequest) (*DismountVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DismountVolume not implemented") -} -func (*UnimplementedVolumeServer) IsVolumeFormatted(ctx context.Context, req *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsVolumeFormatted not implemented") -} -func (*UnimplementedVolumeServer) FormatVolume(ctx context.Context, req *FormatVolumeRequest) (*FormatVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FormatVolume not implemented") -} -func (*UnimplementedVolumeServer) ResizeVolume(ctx context.Context, req *ResizeVolumeRequest) (*ResizeVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResizeVolume not implemented") -} -func (*UnimplementedVolumeServer) VolumeStats(ctx context.Context, req *VolumeStatsRequest) (*VolumeStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VolumeStats not implemented") -} -func (*UnimplementedVolumeServer) GetVolumeDiskNumber(ctx context.Context, req *VolumeDiskNumberRequest) (*VolumeDiskNumberResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVolumeDiskNumber not implemented") -} -func (*UnimplementedVolumeServer) GetVolumeIDFromMount(ctx context.Context, req *VolumeIDFromMountRequest) (*VolumeIDFromMountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVolumeIDFromMount not implemented") -} - -func RegisterVolumeServer(s *grpc.Server, srv VolumeServer) { - s.RegisterService(&_Volume_serviceDesc, srv) -} - -func _Volume_ListVolumesOnDisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListVolumesOnDiskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).ListVolumesOnDisk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/ListVolumesOnDisk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).ListVolumesOnDisk(ctx, req.(*ListVolumesOnDiskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_MountVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MountVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).MountVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/MountVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).MountVolume(ctx, req.(*MountVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_DismountVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DismountVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).DismountVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/DismountVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).DismountVolume(ctx, req.(*DismountVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_IsVolumeFormatted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsVolumeFormattedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).IsVolumeFormatted(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/IsVolumeFormatted", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).IsVolumeFormatted(ctx, req.(*IsVolumeFormattedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_FormatVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FormatVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).FormatVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/FormatVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).FormatVolume(ctx, req.(*FormatVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_ResizeVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResizeVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).ResizeVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/ResizeVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).ResizeVolume(ctx, req.(*ResizeVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_VolumeStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VolumeStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).VolumeStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/VolumeStats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).VolumeStats(ctx, req.(*VolumeStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_GetVolumeDiskNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VolumeDiskNumberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).GetVolumeDiskNumber(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/GetVolumeDiskNumber", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetVolumeDiskNumber(ctx, req.(*VolumeDiskNumberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Volume_GetVolumeIDFromMount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VolumeIDFromMountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VolumeServer).GetVolumeIDFromMount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.Volume/GetVolumeIDFromMount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetVolumeIDFromMount(ctx, req.(*VolumeIDFromMountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Volume_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1beta1.Volume", - HandlerType: (*VolumeServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListVolumesOnDisk", - Handler: _Volume_ListVolumesOnDisk_Handler, - }, - { - MethodName: "MountVolume", - Handler: _Volume_MountVolume_Handler, - }, - { - MethodName: "DismountVolume", - Handler: _Volume_DismountVolume_Handler, - }, - { - MethodName: "IsVolumeFormatted", - Handler: _Volume_IsVolumeFormatted_Handler, - }, - { - MethodName: "FormatVolume", - Handler: _Volume_FormatVolume_Handler, - }, - { - MethodName: "ResizeVolume", - Handler: _Volume_ResizeVolume_Handler, - }, - { - MethodName: "VolumeStats", - Handler: _Volume_VolumeStats_Handler, - }, - { - MethodName: "GetVolumeDiskNumber", - Handler: _Volume_GetVolumeDiskNumber_Handler, - }, - { - MethodName: "GetVolumeIDFromMount", - Handler: _Volume_GetVolumeIDFromMount_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "volume/v1beta1/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.proto deleted file mode 100644 index 07eb7b200..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1/api.proto +++ /dev/null @@ -1,121 +0,0 @@ -syntax = "proto3"; - -package v1beta1; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1"; - -service Volume { - // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for - // all volumes on a Disk device - rpc ListVolumesOnDisk(ListVolumesOnDiskRequest) returns (ListVolumesOnDiskResponse) {} - // MountVolume mounts the volume at the requested global staging path - rpc MountVolume(MountVolumeRequest) returns (MountVolumeResponse) {} - // DismountVolume gracefully dismounts a volume - rpc DismountVolume(DismountVolumeRequest) returns (DismountVolumeResponse) {} - // IsVolumeFormatted checks if a volume is formatted with NTFS - rpc IsVolumeFormatted(IsVolumeFormattedRequest) returns (IsVolumeFormattedResponse) {} - // FormatVolume formats a volume with the provided file system - rpc FormatVolume(FormatVolumeRequest) returns (FormatVolumeResponse) {} - // ResizeVolume performs resizing of the partition and file system for a block based volume - rpc ResizeVolume(ResizeVolumeRequest) returns (ResizeVolumeResponse) {} - // VolumeStats gathers DiskSize, VolumeSize and VolumeUsedSize for a volume - rpc VolumeStats(VolumeStatsRequest) returns (VolumeStatsResponse) {} - // GetVolumeDiskNumber gets the disk number of the disk where the volume is located - rpc GetVolumeDiskNumber(VolumeDiskNumberRequest) returns (VolumeDiskNumberResponse) {} - // GetVolumeIDFromMount gets the volume id for a given mount - rpc GetVolumeIDFromMount(VolumeIDFromMountRequest) returns (VolumeIDFromMountResponse) {} -} - -message ListVolumesOnDiskRequest { - // Disk device ID of the disk to query for volumes - string disk_id = 1; -} - -message ListVolumesOnDiskResponse { - // Volume device IDs of volumes on the specified disk - repeated string volume_ids = 1; -} - -message MountVolumeRequest { - // Volume device ID of the volume to mount - string volume_id = 1; - // Path in the host's file system where the volume needs to be mounted - string path = 2; -} - -message MountVolumeResponse { - // Intentionally empty -} - -message DismountVolumeRequest { - // Volume device ID of the volume to dismount - string volume_id = 1; - // Path where the volume has been mounted. - string path = 2; -} - -message DismountVolumeResponse { - // Intentionally empty -} - -message IsVolumeFormattedRequest { - // Volume device ID of the volume to check - string volume_id = 1; -} - -message IsVolumeFormattedResponse { - // Is the volume formatted with NTFS - bool formatted = 1; -} - -message FormatVolumeRequest { - // Volume device ID of the volume to format - string volume_id = 1; -} - -message FormatVolumeResponse { - // Intentionally empty -} - -message ResizeVolumeRequest { - // Volume device ID of the volume to dismount - string volume_id = 1; - // New size of the volume - int64 size = 2; -} - -message ResizeVolumeResponse { - // Intentionally empty -} - -message VolumeStatsRequest{ - // Volume device Id of the volume to get the stats for - string volume_id = 1; -} - -message VolumeStatsResponse{ - // Capacity of the volume - int64 volumeSize = 1; - // Used bytes - int64 volumeUsedSize = 2; -} - -message VolumeDiskNumberRequest{ - // Volume device Id of the volume to get the disk number for - string volume_id = 1; -} - -message VolumeDiskNumberResponse{ - // Corresponding disk number - int64 diskNumber = 1; -} - -message VolumeIDFromMountRequest { - // Mount - string mount = 1; -} - -message VolumeIDFromMountResponse { - // Mount - string volume_id = 1; -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/apiversion/version.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/apiversion/version.go deleted file mode 100644 index 140529825..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/apiversion/version.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package apiversion - -import ( - "fmt" - "regexp" - "strconv" - - "github.com/pkg/errors" -) - -// API version names follow k8s style version names: -// valid API version names examples: "v1", "v1alpha2", "v2beta3", etc... -var nameRegex = regexp.MustCompile("^v([1-9][0-9]*)(?:(alpha|beta)([1-9][0-9]*))?$") - -type qualifier uint - -const ( - alpha qualifier = iota - beta - stable -) - -type Version struct { - // major version number, eg 1 for "v1", 2 for "v2beta3" - major uint - - // qualifier is "alpha" or "beta" - qualifier qualifier - - // the qualifier's version, eg 2 for "v1alpha2" or 3 for "v2beta3" - qualifierVersion uint - - rawName string -} - -// NewVersion builds a Version from a version string, eg "v1alpha2" -func NewVersion(name string) (version Version, err error) { - matches := nameRegex.FindStringSubmatch(name) - if len(matches) < 2 || matches[1] == "" { - err = fmt.Errorf("invalid version name: %q", name) - return - } - - major, err := toUint(matches[1], name) - if err != nil { - return - } - - qualifier := stable - var qualifierVersion uint - if len(matches) >= 4 && matches[2] != "" { - switch matches[2] { - case "alpha": - qualifier = alpha - case "beta": - qualifier = beta - } - - qualifierVersion, err = toUint(matches[3], name) - if err != nil { - return - } - } - - version.major = major - version.qualifier = qualifier - version.qualifierVersion = qualifierVersion - version.rawName = name - - return -} - -// NewVersionOrPanic is the same as NewVersion, but panics if -// passed an invalid version name. -func NewVersionOrPanic(name string) Version { - version, err := NewVersion(name) - if err != nil { - panic(err) - } - return version -} - -// IsValidVersion returns true iff the input is a valid version name. -func IsValidVersion(name string) bool { - return nameRegex.MatchString(name) -} - -func toUint(s, name string) (uint, error) { - i, err := strconv.ParseUint(s, 10, 0) - if err != nil { - return 0, errors.Wrapf(err, "unable to convert %q from version name %q to int", s, name) - } - return uint(i), nil -} - -type Comparison int - -const ( - Lesser Comparison = -1 - Equal Comparison = 0 - Greater Comparison = 1 -) - -// Compare return Lesser if v < other (ie other is more recent), Equal if v == other, -// and Greater if v > other (ie v is more recent) -func (v Version) Compare(other Version) Comparison { - if cmp := compareUints(v.major, other.major); cmp != Equal { - return cmp - } - if cmp := compareUints(uint(v.qualifier), uint(other.qualifier)); cmp != Equal { - return cmp - } - return compareUints(v.qualifierVersion, other.qualifierVersion) -} - -func compareUints(a, b uint) Comparison { - if a < b { - return Lesser - } - if a > b { - return Greater - } - return Equal -} - -func (v Version) String() string { - return v.rawName -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go deleted file mode 100644 index 9c932a77f..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "disk" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1") - -type Client struct { - client v1.DiskClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the disk API group version v1. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1.NewDiskClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1.DiskClient = &Client{} - -func (w *Client) GetDiskState(context context.Context, request *v1.GetDiskStateRequest, opts ...grpc.CallOption) (*v1.GetDiskStateResponse, error) { - return w.client.GetDiskState(context, request, opts...) -} - -func (w *Client) GetDiskStats(context context.Context, request *v1.GetDiskStatsRequest, opts ...grpc.CallOption) (*v1.GetDiskStatsResponse, error) { - return w.client.GetDiskStats(context, request, opts...) -} - -func (w *Client) ListDiskIDs(context context.Context, request *v1.ListDiskIDsRequest, opts ...grpc.CallOption) (*v1.ListDiskIDsResponse, error) { - return w.client.ListDiskIDs(context, request, opts...) -} - -func (w *Client) ListDiskLocations(context context.Context, request *v1.ListDiskLocationsRequest, opts ...grpc.CallOption) (*v1.ListDiskLocationsResponse, error) { - return w.client.ListDiskLocations(context, request, opts...) -} - -func (w *Client) PartitionDisk(context context.Context, request *v1.PartitionDiskRequest, opts ...grpc.CallOption) (*v1.PartitionDiskResponse, error) { - return w.client.PartitionDisk(context, request, opts...) -} - -func (w *Client) Rescan(context context.Context, request *v1.RescanRequest, opts ...grpc.CallOption) (*v1.RescanResponse, error) { - return w.client.Rescan(context, request, opts...) -} - -func (w *Client) SetDiskState(context context.Context, request *v1.SetDiskStateRequest, opts ...grpc.CallOption) (*v1.SetDiskStateResponse, error) { - return w.client.SetDiskState(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go deleted file mode 100644 index 95866cde7..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1beta2 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "disk" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1beta2") - -type Client struct { - client v1beta2.DiskClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the disk API group version v1beta2. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1beta2.NewDiskClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1beta2.DiskClient = &Client{} - -func (w *Client) DiskStats(context context.Context, request *v1beta2.DiskStatsRequest, opts ...grpc.CallOption) (*v1beta2.DiskStatsResponse, error) { - return w.client.DiskStats(context, request, opts...) -} - -func (w *Client) GetAttachState(context context.Context, request *v1beta2.GetAttachStateRequest, opts ...grpc.CallOption) (*v1beta2.GetAttachStateResponse, error) { - return w.client.GetAttachState(context, request, opts...) -} - -func (w *Client) ListDiskIDs(context context.Context, request *v1beta2.ListDiskIDsRequest, opts ...grpc.CallOption) (*v1beta2.ListDiskIDsResponse, error) { - return w.client.ListDiskIDs(context, request, opts...) -} - -func (w *Client) ListDiskLocations(context context.Context, request *v1beta2.ListDiskLocationsRequest, opts ...grpc.CallOption) (*v1beta2.ListDiskLocationsResponse, error) { - return w.client.ListDiskLocations(context, request, opts...) -} - -func (w *Client) PartitionDisk(context context.Context, request *v1beta2.PartitionDiskRequest, opts ...grpc.CallOption) (*v1beta2.PartitionDiskResponse, error) { - return w.client.PartitionDisk(context, request, opts...) -} - -func (w *Client) Rescan(context context.Context, request *v1beta2.RescanRequest, opts ...grpc.CallOption) (*v1beta2.RescanResponse, error) { - return w.client.Rescan(context, request, opts...) -} - -func (w *Client) SetAttachState(context context.Context, request *v1beta2.SetAttachStateRequest, opts ...grpc.CallOption) (*v1beta2.SetAttachStateResponse, error) { - return w.client.SetAttachState(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go deleted file mode 100644 index cf136c9d7..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "filesystem" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1") - -type Client struct { - client v1.FilesystemClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the filesystem API group version v1. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1.NewFilesystemClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1.FilesystemClient = &Client{} - -func (w *Client) CreateSymlink(context context.Context, request *v1.CreateSymlinkRequest, opts ...grpc.CallOption) (*v1.CreateSymlinkResponse, error) { - return w.client.CreateSymlink(context, request, opts...) -} - -func (w *Client) IsSymlink(context context.Context, request *v1.IsSymlinkRequest, opts ...grpc.CallOption) (*v1.IsSymlinkResponse, error) { - return w.client.IsSymlink(context, request, opts...) -} - -func (w *Client) Mkdir(context context.Context, request *v1.MkdirRequest, opts ...grpc.CallOption) (*v1.MkdirResponse, error) { - return w.client.Mkdir(context, request, opts...) -} - -func (w *Client) PathExists(context context.Context, request *v1.PathExistsRequest, opts ...grpc.CallOption) (*v1.PathExistsResponse, error) { - return w.client.PathExists(context, request, opts...) -} - -func (w *Client) Rmdir(context context.Context, request *v1.RmdirRequest, opts ...grpc.CallOption) (*v1.RmdirResponse, error) { - return w.client.Rmdir(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go deleted file mode 100644 index b75847250..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "filesystem" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1beta1") - -type Client struct { - client v1beta1.FilesystemClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the filesystem API group version v1beta1. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1beta1.NewFilesystemClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1beta1.FilesystemClient = &Client{} - -func (w *Client) IsMountPoint(context context.Context, request *v1beta1.IsMountPointRequest, opts ...grpc.CallOption) (*v1beta1.IsMountPointResponse, error) { - return w.client.IsMountPoint(context, request, opts...) -} - -func (w *Client) LinkPath(context context.Context, request *v1beta1.LinkPathRequest, opts ...grpc.CallOption) (*v1beta1.LinkPathResponse, error) { - return w.client.LinkPath(context, request, opts...) -} - -func (w *Client) Mkdir(context context.Context, request *v1beta1.MkdirRequest, opts ...grpc.CallOption) (*v1beta1.MkdirResponse, error) { - return w.client.Mkdir(context, request, opts...) -} - -func (w *Client) PathExists(context context.Context, request *v1beta1.PathExistsRequest, opts ...grpc.CallOption) (*v1beta1.PathExistsResponse, error) { - return w.client.PathExists(context, request, opts...) -} - -func (w *Client) Rmdir(context context.Context, request *v1beta1.RmdirRequest, opts ...grpc.CallOption) (*v1beta1.RmdirResponse, error) { - return w.client.Rmdir(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go deleted file mode 100644 index 8c9a3cd77..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "volume" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1") - -type Client struct { - client v1.VolumeClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the volume API group version v1. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1.NewVolumeClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1.VolumeClient = &Client{} - -func (w *Client) FormatVolume(context context.Context, request *v1.FormatVolumeRequest, opts ...grpc.CallOption) (*v1.FormatVolumeResponse, error) { - return w.client.FormatVolume(context, request, opts...) -} - -func (w *Client) GetDiskNumberFromVolumeID(context context.Context, request *v1.GetDiskNumberFromVolumeIDRequest, opts ...grpc.CallOption) (*v1.GetDiskNumberFromVolumeIDResponse, error) { - return w.client.GetDiskNumberFromVolumeID(context, request, opts...) -} - -func (w *Client) GetVolumeIDFromTargetPath(context context.Context, request *v1.GetVolumeIDFromTargetPathRequest, opts ...grpc.CallOption) (*v1.GetVolumeIDFromTargetPathResponse, error) { - return w.client.GetVolumeIDFromTargetPath(context, request, opts...) -} - -func (w *Client) GetVolumeStats(context context.Context, request *v1.GetVolumeStatsRequest, opts ...grpc.CallOption) (*v1.GetVolumeStatsResponse, error) { - return w.client.GetVolumeStats(context, request, opts...) -} - -func (w *Client) IsVolumeFormatted(context context.Context, request *v1.IsVolumeFormattedRequest, opts ...grpc.CallOption) (*v1.IsVolumeFormattedResponse, error) { - return w.client.IsVolumeFormatted(context, request, opts...) -} - -func (w *Client) ListVolumesOnDisk(context context.Context, request *v1.ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*v1.ListVolumesOnDiskResponse, error) { - return w.client.ListVolumesOnDisk(context, request, opts...) -} - -func (w *Client) MountVolume(context context.Context, request *v1.MountVolumeRequest, opts ...grpc.CallOption) (*v1.MountVolumeResponse, error) { - return w.client.MountVolume(context, request, opts...) -} - -func (w *Client) ResizeVolume(context context.Context, request *v1.ResizeVolumeRequest, opts ...grpc.CallOption) (*v1.ResizeVolumeResponse, error) { - return w.client.ResizeVolume(context, request, opts...) -} - -func (w *Client) UnmountVolume(context context.Context, request *v1.UnmountVolumeRequest, opts ...grpc.CallOption) (*v1.UnmountVolumeResponse, error) { - return w.client.UnmountVolume(context, request, opts...) -} - -func (w *Client) WriteVolumeCache(context context.Context, request *v1.WriteVolumeCacheRequest, opts ...grpc.CallOption) (*v1.WriteVolumeCacheResponse, error) { - return w.client.WriteVolumeCache(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1/client_generated.go deleted file mode 100644 index 9fca55dce..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1/client_generated.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by csi-proxy-api-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "net" - - "github.com/Microsoft/go-winio" - "github.com/kubernetes-csi/csi-proxy/client" - "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -// GroupName is the group name of this API. -const GroupName = "volume" - -// Version is the api version. -var Version = apiversion.NewVersionOrPanic("v1beta1") - -type Client struct { - client v1beta1.VolumeClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the volume API group version v1beta1. -// It's the caller's responsibility to Close the client when done. -func NewClient() (*Client, error) { - pipePath := client.PipePath(GroupName, Version) - return NewClientWithPipePath(pipePath) -} - -// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". -// It's the caller's responsibility to Close the client when done. -func NewClientWithPipePath(pipePath string) (*Client, error) { - - // verify that the pipe exists - _, err := winio.DialPipe(pipePath, nil) - if err != nil { - return nil, err - } - - connection, err := grpc.Dial(pipePath, - grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { - return winio.DialPipeContext(context, s) - }), - grpc.WithInsecure()) - if err != nil { - return nil, err - } - - client := v1beta1.NewVolumeClient(connection) - return &Client{ - client: client, - connection: connection, - }, nil -} - -// Close closes the client. It must be called before the client gets GC-ed. -func (w *Client) Close() error { - return w.connection.Close() -} - -// ensures we implement all the required methods -var _ v1beta1.VolumeClient = &Client{} - -func (w *Client) DismountVolume(context context.Context, request *v1beta1.DismountVolumeRequest, opts ...grpc.CallOption) (*v1beta1.DismountVolumeResponse, error) { - return w.client.DismountVolume(context, request, opts...) -} - -func (w *Client) FormatVolume(context context.Context, request *v1beta1.FormatVolumeRequest, opts ...grpc.CallOption) (*v1beta1.FormatVolumeResponse, error) { - return w.client.FormatVolume(context, request, opts...) -} - -func (w *Client) GetVolumeDiskNumber(context context.Context, request *v1beta1.VolumeDiskNumberRequest, opts ...grpc.CallOption) (*v1beta1.VolumeDiskNumberResponse, error) { - return w.client.GetVolumeDiskNumber(context, request, opts...) -} - -func (w *Client) GetVolumeIDFromMount(context context.Context, request *v1beta1.VolumeIDFromMountRequest, opts ...grpc.CallOption) (*v1beta1.VolumeIDFromMountResponse, error) { - return w.client.GetVolumeIDFromMount(context, request, opts...) -} - -func (w *Client) IsVolumeFormatted(context context.Context, request *v1beta1.IsVolumeFormattedRequest, opts ...grpc.CallOption) (*v1beta1.IsVolumeFormattedResponse, error) { - return w.client.IsVolumeFormatted(context, request, opts...) -} - -func (w *Client) ListVolumesOnDisk(context context.Context, request *v1beta1.ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*v1beta1.ListVolumesOnDiskResponse, error) { - return w.client.ListVolumesOnDisk(context, request, opts...) -} - -func (w *Client) MountVolume(context context.Context, request *v1beta1.MountVolumeRequest, opts ...grpc.CallOption) (*v1beta1.MountVolumeResponse, error) { - return w.client.MountVolume(context, request, opts...) -} - -func (w *Client) ResizeVolume(context context.Context, request *v1beta1.ResizeVolumeRequest, opts ...grpc.CallOption) (*v1beta1.ResizeVolumeResponse, error) { - return w.client.ResizeVolume(context, request, opts...) -} - -func (w *Client) VolumeStats(context context.Context, request *v1beta1.VolumeStatsRequest, opts ...grpc.CallOption) (*v1beta1.VolumeStatsResponse, error) { - return w.client.VolumeStats(context, request, opts...) -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/utils.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/utils.go deleted file mode 100644 index 5b4afc281..000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/utils.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package client - -import ( - "github.com/kubernetes-csi/csi-proxy/client/apiversion" -) - -const ( - // pipePrefix is the prefix for Windows named pipes' names - pipePrefix = `\\.\\pipe\\` - - // CsiProxyNamedPipePrefix is the prefix for the named pipes the proxy creates. - // The suffix will be the API group and version, - // e.g. "\\.\\pipe\\csi-proxy-iscsi-v1", "\\.\\pipe\\csi-proxy-filesystem-v2alpha1", etc. - csiProxyNamedPipePrefix = "csi-proxy-" -) - -func PipePath(apiGroupName string, apiVersion apiversion.Version) string { - return pipePrefix + csiProxyNamedPipePrefix + apiGroupName + "-" + apiVersion.String() -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/LICENSE b/vendor/github.com/kubernetes-csi/csi-proxy/v2/LICENSE similarity index 99% rename from vendor/github.com/kubernetes-csi/csi-proxy/client/LICENSE rename to vendor/github.com/kubernetes-csi/csi-proxy/v2/LICENSE index 8f71f43fe..8dada3eda 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/LICENSE +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/LICENSE @@ -199,4 +199,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/disk.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/disk.go new file mode 100644 index 000000000..74a5c56ad --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/disk.go @@ -0,0 +1,173 @@ +package disk + +import ( + "context" + + diskapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi" + "k8s.io/klog/v2" +) + +type Disk struct { + hostAPI diskapi.HostAPI +} + +type Interface interface { + // GetDiskState gets the offline/online state of a disk. + GetDiskState(context.Context, *GetDiskStateRequest) (*GetDiskStateResponse, error) + + // GetDiskStats returns the stats of a disk (currently it returns the disk size). + GetDiskStats(context.Context, *GetDiskStatsRequest) (*GetDiskStatsResponse, error) + + // ListDiskIDs returns a map of DiskID objects where the key is the disk number. + ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error) + + // ListDiskLocations returns locations of all + // disk devices enumerated by the host. + ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) + + // PartitionDisk initializes and partitions a disk device with the GPT partition style + // (if the disk has not been partitioned already) and returns the resulting volume device ID. + PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error) + + // Rescan refreshes the host's storage cache. + Rescan(context.Context, *RescanRequest) (*RescanResponse, error) + + // SetDiskState sets the offline/online state of a disk. + SetDiskState(context.Context, *SetDiskStateRequest) (*SetDiskStateResponse, error) +} + +// check that Disk implements Interface +var _ Interface = &Disk{} + +func New(hostAPI diskapi.HostAPI) (*Disk, error) { + return &Disk{ + hostAPI: hostAPI, + }, nil +} + +func (d *Disk) ListDiskLocations(context context.Context, request *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) { + klog.V(2).Infof("Request: ListDiskLocations: %+v", request) + response := &ListDiskLocationsResponse{} + m, err := d.hostAPI.ListDiskLocations() + if err != nil { + klog.Errorf("ListDiskLocations failed: %v", err) + return response, err + } + + response.DiskLocations = make(map[uint32]*DiskLocation) + for k, v := range m { + d := &DiskLocation{} + d.Adapter = v.Adapter + d.Bus = v.Bus + d.Target = v.Target + d.LUNID = v.LUNID + response.DiskLocations[k] = d + } + return response, nil +} + +func (d *Disk) PartitionDisk(context context.Context, request *PartitionDiskRequest) (*PartitionDiskResponse, error) { + klog.V(2).Infof("Request: PartitionDisk with diskNumber=%d", request.DiskNumber) + response := &PartitionDiskResponse{} + diskNumber := request.DiskNumber + + initialized, err := d.hostAPI.IsDiskInitialized(diskNumber) + if err != nil { + klog.Errorf("IsDiskInitialized failed: %v", err) + return response, err + } + if !initialized { + klog.V(4).Infof("Initializing disk %d", diskNumber) + err = d.hostAPI.InitializeDisk(diskNumber) + if err != nil { + klog.Errorf("failed InitializeDisk %v", err) + return response, err + } + } else { + klog.V(4).Infof("Disk %d already initialized", diskNumber) + } + + klog.V(4).Infof("Checking if disk %d has basic partitions", diskNumber) + partitioned, err := d.hostAPI.BasicPartitionsExist(diskNumber) + if err != nil { + klog.Errorf("failed check BasicPartitionsExist %v", err) + return response, err + } + if !partitioned { + klog.V(4).Infof("Creating basic partition on disk %d", diskNumber) + err = d.hostAPI.CreateBasicPartition(diskNumber) + if err != nil { + klog.Errorf("failed CreateBasicPartition %v", err) + return response, err + } + } else { + klog.V(4).Infof("Disk %d already partitioned", diskNumber) + } + return response, nil +} + +func (d *Disk) Rescan(context context.Context, request *RescanRequest) (*RescanResponse, error) { + klog.V(2).Infof("Request: Rescan") + response := &RescanResponse{} + err := d.hostAPI.Rescan() + if err != nil { + klog.Errorf("Rescan failed %v", err) + return nil, err + } + return response, nil +} + +func (d *Disk) ListDiskIDs(context context.Context, request *ListDiskIDsRequest) (*ListDiskIDsResponse, error) { + klog.V(4).Infof("Request: ListDiskIDs") + + diskIDs, err := d.hostAPI.ListDiskIDs() + if err != nil { + klog.Errorf("ListDiskIDs failed: %v", err) + return nil, err + } + + // Convert from shared to internal type + responseDiskIDs := make(map[uint32]*DiskIDs) + for k, v := range diskIDs { + responseDiskIDs[k] = &DiskIDs{ + Page83: v.Page83, + SerialNumber: v.SerialNumber, + } + } + response := &ListDiskIDsResponse{DiskIDs: responseDiskIDs} + klog.V(5).Infof("Response=%v", response) + return response, nil +} + +func (d *Disk) GetDiskStats(context context.Context, request *GetDiskStatsRequest) (*GetDiskStatsResponse, error) { + klog.V(2).Infof("Request: GetDiskStats: diskNumber=%d", request.DiskNumber) + diskNumber := request.DiskNumber + totalBytes, err := d.hostAPI.GetDiskStats(diskNumber) + if err != nil { + klog.Errorf("GetDiskStats failed: %v", err) + return nil, err + } + return &GetDiskStatsResponse{ + TotalBytes: totalBytes, + }, nil +} + +func (d *Disk) SetDiskState(context context.Context, request *SetDiskStateRequest) (*SetDiskStateResponse, error) { + klog.V(2).Infof("Request: SetDiskState with diskNumber=%d and isOnline=%v", request.DiskNumber, request.IsOnline) + err := d.hostAPI.SetDiskState(request.DiskNumber, request.IsOnline) + if err != nil { + klog.Errorf("SetDiskState failed: %v", err) + return nil, err + } + return &SetDiskStateResponse{}, nil +} + +func (d *Disk) GetDiskState(context context.Context, request *GetDiskStateRequest) (*GetDiskStateResponse, error) { + klog.V(4).Infof("Request: GetDiskState with diskNumber=%d", request.DiskNumber) + isOnline, err := d.hostAPI.GetDiskState(request.DiskNumber) + if err != nil { + klog.Errorf("GetDiskState failed with: %v", err) + return nil, err + } + return &GetDiskStateResponse{IsOnline: isOnline}, nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/hostapi.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/hostapi.go new file mode 100644 index 000000000..a3e1bb839 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/hostapi.go @@ -0,0 +1,360 @@ +package api + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "regexp" + "strconv" + "strings" + "syscall" + "unsafe" + + "github.com/kubernetes-csi/csi-proxy/v2/pkg/utils" + "k8s.io/klog/v2" +) + +var ( + kernel32DLL = syscall.NewLazyDLL("kernel32.dll") +) + +const ( + IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080 + IOCTL_STORAGE_QUERY_PROPERTY = 0x002d1400 +) + +// HostAPI declares the interface exposed by the internal API +type HostAPI interface { + // ListDiskLocations - constructs a map with the disk number as the key and the DiskLocation structure + // as the value. The DiskLocation struct has various fields like the Adapter, Bus, Target and LUNID. + ListDiskLocations() (map[uint32]DiskLocation, error) + // IsDiskInitialized returns true if the disk identified by `diskNumber` is initialized. + IsDiskInitialized(diskNumber uint32) (bool, error) + // InitializeDisk initializes the disk `diskNumber` + InitializeDisk(diskNumber uint32) error + // BasicPartitionsExist checks if the disk `diskNumber` has any basic partitions. + BasicPartitionsExist(diskNumber uint32) (bool, error) + // CreateBasicPartition creates a partition in disk `diskNumber` + CreateBasicPartition(diskNumber uint32) error + // Rescan updates the host storage cache (re-enumerates disk, partition and volume objects) + Rescan() error + // ListDiskIDs list all disks by disk number. + ListDiskIDs() (map[uint32]DiskIDs, error) + // GetDiskStats gets the disk stats of the disk `diskNumber`. + GetDiskStats(diskNumber uint32) (int64, error) + // SetDiskState sets the offline/online state of the disk `diskNumber`. + SetDiskState(diskNumber uint32, isOnline bool) error + // GetDiskState gets the offline/online state of the disk `diskNumber`. + GetDiskState(diskNumber uint32) (bool, error) +} + +// DiskAPI implements the OS API calls related to Disk Devices. All code here should be very simple +// pass-through to the OS APIs or cmdlets. Any logic around the APIs/cmdlet invocation +// should go in pkg/disk/disk.go so that logic can be easily unit-tested +// without requiring specific OS environments. +type DiskAPI struct{} + +// ensure that DiskAPI implements the exposed API +var _ HostAPI = &DiskAPI{} + +func New() DiskAPI { + return DiskAPI{} +} + +// ListDiskLocations - constructs a map with the disk number as the key and the DiskLocation structure +// as the value. The DiskLocation struct has various fields like the Adapter, Bus, Target and LUNID. +func (DiskAPI) ListDiskLocations() (map[uint32]DiskLocation, error) { + // sample response + // [{ + // "number": 0, + // "location": "PCI Slot 3 : Adapter 0 : Port 0 : Target 1 : LUN 0" + // }, ...] + cmd := "ConvertTo-Json @(Get-Disk | select Number, Location)" + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return nil, fmt.Errorf("failed to list disk location. cmd: %q, output: %q, err %v", cmd, string(out), err) + } + + var getDisk []map[string]interface{} + err = json.Unmarshal(out, &getDisk) + if err != nil { + return nil, err + } + + m := make(map[uint32]DiskLocation) + for _, v := range getDisk { + str := v["Location"].(string) + num := v["Number"].(float64) + + found := false + s := strings.Split(str, ":") + if len(s) >= 5 { + var d DiskLocation + for _, item := range s { + item = strings.TrimSpace(item) + itemSplit := strings.Split(item, " ") + if len(itemSplit) == 2 { + found = true + switch strings.TrimSpace(itemSplit[0]) { + case "Adapter": + d.Adapter = strings.TrimSpace(itemSplit[1]) + case "Target": + d.Target = strings.TrimSpace(itemSplit[1]) + case "LUN": + d.LUNID = strings.TrimSpace(itemSplit[1]) + default: + klog.Warningf("Got unknown field : %s=%s", itemSplit[0], itemSplit[1]) + } + } + } + + if found { + m[uint32(num)] = d + } + } + } + return m, nil +} + +func (DiskAPI) Rescan() error { + cmd := "Update-HostStorageCache" + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error updating host storage cache output: %q, err: %v", string(out), err) + } + return nil +} + +func (DiskAPI) IsDiskInitialized(diskNumber uint32) (bool, error) { + cmd := fmt.Sprintf("Get-Disk -Number %d | Where partitionstyle -eq 'raw'", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return false, fmt.Errorf("error checking initialized status of disk %d: %v, %v", diskNumber, out, err) + } + if len(out) == 0 { + // disks with raw initialization not detected + return true, nil + } + return false, nil +} + +func (DiskAPI) InitializeDisk(diskNumber uint32) error { + cmd := fmt.Sprintf("Initialize-Disk -Number %d -PartitionStyle GPT", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error initializing disk %d: %v, %v", diskNumber, out, err) + } + return nil +} + +func (DiskAPI) BasicPartitionsExist(diskNumber uint32) (bool, error) { + cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %d | Where Type -ne Reserved", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return false, fmt.Errorf("error checking presence of partitions on disk %d: %v, %v", diskNumber, out, err) + } + if len(out) > 0 { + // disk has partitions in it + return true, nil + } + return false, nil +} + +func (DiskAPI) CreateBasicPartition(diskNumber uint32) error { + cmd := fmt.Sprintf("New-Partition -DiskNumber %d -UseMaximumSize", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error creating partition on disk %d: %v, %v", diskNumber, out, err) + } + return nil +} + +func (DiskAPI) GetDiskNumber(disk syscall.Handle) (uint32, error) { + var bytes uint32 + devNum := StorageDeviceNumber{} + buflen := uint32(unsafe.Sizeof(devNum.DeviceType)) + uint32(unsafe.Sizeof(devNum.DeviceNumber)) + uint32(unsafe.Sizeof(devNum.PartitionNumber)) + + err := syscall.DeviceIoControl(disk, IOCTL_STORAGE_GET_DEVICE_NUMBER, nil, 0, (*byte)(unsafe.Pointer(&devNum)), buflen, &bytes, nil) + + return devNum.DeviceNumber, err +} + +func (DiskAPI) GetDiskPage83ID(disk syscall.Handle) (string, error) { + query := StoragePropertyQuery{} + + bufferSize := uint32(4 * 1024) + buffer := make([]byte, 4*1024) + var size uint32 + var n uint32 + var m uint16 + + query.QueryType = PropertyStandardQuery + query.PropertyID = StorageDeviceIDProperty + + querySize := uint32(unsafe.Sizeof(query)) + err := syscall.DeviceIoControl(disk, IOCTL_STORAGE_QUERY_PROPERTY, (*byte)(unsafe.Pointer(&query)), querySize, (*byte)(unsafe.Pointer(&buffer[0])), bufferSize, &size, nil) + if err != nil { + return "", fmt.Errorf("IOCTL_STORAGE_QUERY_PROPERTY failed: %v", err) + } + + devIDDesc := (*StorageDeviceIDDescriptor)(unsafe.Pointer(&buffer[0])) + + pID := (*StorageIdentifier)(unsafe.Pointer(&devIDDesc.Identifiers[0])) + + page83ID := []byte{} + byteSize := unsafe.Sizeof(byte(0)) + for n = 0; n < devIDDesc.NumberOfIdentifiers; n++ { + if pID.Association == StorageIDAssocDevice && (pID.CodeSet == StorageIDCodeSetBinary || pID.CodeSet == StorageIDCodeSetASCII) { + for m = 0; m < pID.IdentifierSize; m++ { + page83ID = append(page83ID, *(*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&pID.Identifier[0])) + byteSize*uintptr(m)))) + } + + if pID.CodeSet == StorageIDCodeSetASCII { + return string(page83ID), nil + } else if pID.CodeSet == StorageIDCodeSetBinary { + return hex.EncodeToString(page83ID), nil + } + } + pID = (*StorageIdentifier)(unsafe.Pointer(uintptr(unsafe.Pointer(pID)) + byteSize*uintptr(pID.NextOffset))) + } + return "", nil +} + +func (imp DiskAPI) GetDiskNumberWithID(page83ID string) (uint32, error) { + cmd := "ConvertTo-Json @(Get-Disk | Select Path)" + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return 0, fmt.Errorf("Could not query disk paths") + } + + outString := string(out) + disks := []Disk{} + err = json.Unmarshal([]byte(outString), &disks) + if err != nil { + return 0, err + } + + for i := range disks { + diskNumber, diskPage83ID, err := imp.GetDiskNumberAndPage83ID(disks[i].Path) + if err != nil { + return 0, err + } + + if diskPage83ID == page83ID { + return diskNumber, nil + } + } + + return 0, fmt.Errorf("Could not find disk with Page83 ID %s", page83ID) +} + +func (imp DiskAPI) GetDiskNumberAndPage83ID(path string) (uint32, string, error) { + h, err := syscall.Open(path, syscall.O_RDONLY, 0) + defer syscall.Close(h) + if err != nil { + return 0, "", err + } + + diskNumber, err := imp.GetDiskNumber(h) + if err != nil { + return 0, "", err + } + + page83ID, err := imp.GetDiskPage83ID(h) + if err != nil { + return 0, "", err + } + + return diskNumber, page83ID, nil +} + +// ListDiskIDs - constructs a map with the disk number as the key and the DiskID structure +// as the value. The DiskID struct has a field for the page83 ID. +func (imp DiskAPI) ListDiskIDs() (map[uint32]DiskIDs, error) { + // sample response + // [ + // { + // "Path": "\\\\?\\scsi#disk\u0026ven_google\u0026prod_persistentdisk#4\u002621cb0360\u00260\u0026000100#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}", + // "SerialNumber": " " + // }, + // { + // "Path": "\\\\?\\scsi#disk\u0026ven_msft\u0026prod_virtual_disk#2\u00261f4adffe\u00260\u0026000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}", + // "SerialNumber": null + // }, ] + cmd := "ConvertTo-Json @(Get-Disk | Select Path, SerialNumber)" + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return nil, fmt.Errorf("Could not query disk paths: %v", err) + } + + outString := string(out) + disks := []Disk{} + err = json.Unmarshal([]byte(outString), &disks) + if err != nil { + return nil, err + } + + m := make(map[uint32]DiskIDs) + + for i := range disks { + diskNumber, page83, err := imp.GetDiskNumberAndPage83ID(disks[i].Path) + if err != nil { + return nil, err + } + + m[diskNumber] = DiskIDs{ + Page83: page83, + SerialNumber: disks[i].SerialNumber, + } + } + + return m, nil +} + +func (imp DiskAPI) GetDiskStats(diskNumber uint32) (int64, error) { + cmd := fmt.Sprintf("(Get-Disk -Number %d).Size", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil || len(out) == 0 { + return -1, fmt.Errorf("error getting size of disk. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + reg, err := regexp.Compile("[^0-9]+") + if err != nil { + return -1, fmt.Errorf("error compiling regex. err: %v", err) + } + diskSizeOutput := reg.ReplaceAllString(string(out), "") + + diskSize, err := strconv.ParseInt(diskSizeOutput, 10, 64) + + if err != nil { + return -1, fmt.Errorf("error parsing size of disk. cmd: %s, output: %s, error: %v", cmd, diskSizeOutput, err) + } + + return diskSize, nil +} + +func (imp DiskAPI) SetDiskState(diskNumber uint32, isOnline bool) error { + cmd := fmt.Sprintf("(Get-Disk -Number %d) | Set-Disk -IsOffline $%t", diskNumber, !isOnline) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error setting disk attach state. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + return nil +} + +func (imp DiskAPI) GetDiskState(diskNumber uint32) (bool, error) { + cmd := fmt.Sprintf("(Get-Disk -Number %d) | Select-Object -ExpandProperty IsOffline", diskNumber) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return false, fmt.Errorf("error getting disk state. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + sout := strings.TrimSpace(string(out)) + isOffline, err := strconv.ParseBool(sout) + if err != nil { + return false, fmt.Errorf("error parsing disk state. output: %s, error: %v", sout, err) + } + + return !isOffline, nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/types.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/types.go new file mode 100644 index 000000000..f0ba588dc --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi/types.go @@ -0,0 +1,129 @@ +package api + +type StorageDeviceNumber struct { + DeviceType DeviceType + DeviceNumber uint32 + PartitionNumber uint32 +} +type DeviceType uint32 + +type StoragePropertyID uint32 + +const ( + StorageDeviceProperty StoragePropertyID = iota + StorageAdapterProperty + StorageDeviceIDProperty + StorageDeviceUniqueIDProperty + StorageDeviceWriteCacheProperty + StorageMiniportProperty + StorageAccessAlignmentProperty + StorageDeviceSeekPenaltyProperty + StorageDeviceTrimProperty + StorageDeviceWriteAggregationProperty + StorageDeviceDeviceTelemetryProperty + StorageDeviceLBProvisioningProperty + StorageDevicePowerProperty + StorageDeviceCopyOffloadProperty + StorageDeviceResiliencyProperty + StorageDeviceMediumProductType + StorageAdapterRpmbProperty + StorageAdapterCryptoProperty + StorageDeviceIoCapabilityProperty + StorageAdapterProtocolSpecificProperty + StorageDeviceProtocolSpecificProperty + StorageAdapterTemperatureProperty + StorageDeviceTemperatureProperty + StorageAdapterPhysicalTopologyProperty + StorageDevicePhysicalTopologyProperty + StorageDeviceAttributesProperty + StorageDeviceManagementStatus + StorageAdapterSerialNumberProperty + StorageDeviceLocationProperty + StorageDeviceNumaProperty + StorageDeviceZonedDeviceProperty + StorageDeviceUnsafeShutdownCount + StorageDeviceEnduranceProperty +) + +type StorageQueryType uint32 + +const ( + PropertyStandardQuery StorageQueryType = iota + PropertyExistsQuery + PropertyMaskQuery + PropertyQueryMaxDefined +) + +type StoragePropertyQuery struct { + PropertyID StoragePropertyID + QueryType StorageQueryType + Byte []AdditionalParameters +} + +type AdditionalParameters byte + +type StorageDeviceIDDescriptor struct { + Version uint32 + Size uint32 + NumberOfIdentifiers uint32 + Identifiers [1]byte +} + +type StorageIdentifierCodeSet uint32 + +const ( + StorageIDCodeSetReserved StorageIdentifierCodeSet = iota + StorageIDCodeSetBinary + StorageIDCodeSetASCII + StorageIDCodeSetUtf8 +) + +type StorageIdentifierType uint32 + +const ( + StorageIdTypeVendorSpecific StorageIdentifierType = iota + StorageIDTypeVendorID + StorageIDTypeEUI64 + StorageIDTypeFCPHName + StorageIDTypePortRelative + StorageIDTypeTargetPortGroup + StorageIDTypeLogicalUnitGroup + StorageIDTypeMD5LogicalUnitIdentifier + StorageIDTypeScsiNameString +) + +type StorageAssociationType uint32 + +const ( + StorageIDAssocDevice StorageAssociationType = iota + StorageIDAssocPort + StorageIDAssocTarget +) + +type StorageIdentifier struct { + CodeSet StorageIdentifierCodeSet + Type StorageIdentifierType + IdentifierSize uint16 + NextOffset uint16 + Association StorageAssociationType + Identifier [1]byte +} + +type Disk struct { + Path string `json:"Path"` + SerialNumber string `json:"SerialNumber"` +} + +// DiskLocation definition +type DiskLocation struct { + Adapter string + Bus string + Target string + LUNID string +} + +// DiskIDs definition +type DiskIDs struct { + Page83 string + SerialNumber string +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/types.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/types.go new file mode 100644 index 000000000..e9bae221d --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/types.go @@ -0,0 +1,81 @@ +package disk + +type DiskLocation struct { + Adapter string + Bus string + Target string + LUNID string +} + +type ListDiskLocationsRequest struct { + // Intentionally empty +} + +type ListDiskLocationsResponse struct { + // Map of disk device IDs and associated with each disk device + DiskLocations map[uint32]*DiskLocation +} + +type PartitionDiskRequest struct { + // Disk device ID of the disk to partition + DiskNumber uint32 +} + +type PartitionDiskResponse struct { + // Intentionally empty +} + +type RescanRequest struct { + // Intentionally empty +} + +type RescanResponse struct { + // Intentionally empty +} + +type ListDiskIDsRequest struct { + // Intentionally empty +} + +type DiskIDs struct { + // Map of Disk ID types and Disk ID values + Page83 string + + // The disk serial number + SerialNumber string +} + +type ListDiskIDsResponse struct { + // Map of disk device numbers and IDs associated with each disk device + DiskIDs map[uint32]*DiskIDs +} + +type GetDiskStatsRequest struct { + // Disk device number of the disk to get the stats from + DiskNumber uint32 +} + +type GetDiskStatsResponse struct { + TotalBytes int64 +} + +type SetDiskStateRequest struct { + // Disk device ID of the disk which state will change + DiskNumber uint32 + + // Online state to set for the disk. true for online, false for offline + IsOnline bool +} + +type SetDiskStateResponse struct { +} + +type GetDiskStateRequest struct { + // Disk device ID of the disk + DiskNumber uint32 +} + +type GetDiskStateResponse struct { + // Online state of the disk. true for online, false for offline + IsOnline bool +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/filesystem.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/filesystem.go new file mode 100644 index 000000000..365bddea5 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/filesystem.go @@ -0,0 +1,152 @@ +package filesystem + +import ( + "context" + + filesystemapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi" + "k8s.io/klog/v2" +) + +type Filesystem struct { + hostAPI filesystemapi.HostAPI +} + +type Interface interface { + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) + + // IsSymlink checks if a given path is a symlink. + IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) + + // Mkdir creates a directory at the requested path in the host filesystem. + Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) + + // PathExists checks if the requested path exists in the host filesystem. + PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) + + // PathValid checks if the given path is accessible. + PathValid(context.Context, *PathValidRequest) (*PathValidResponse, error) + + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through CreateSymlink. + Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) + + // RmdirContents removes the contents of a directory in the host filesystem. + // Unlike Rmdir it won't delete the requested path, it'll only delete its contents. + RmdirContents(context.Context, *RmdirContentsRequest) (*RmdirContentsResponse, error) +} + +// check that Filesystem implements Interface +var _ Interface = &Filesystem{} + +func New(hostAPI filesystemapi.HostAPI) (*Filesystem, error) { + return &Filesystem{ + hostAPI: hostAPI, + }, nil +} + +// PathExists checks if the given path exists on the host. +func (f *Filesystem) PathExists(ctx context.Context, request *PathExistsRequest) (*PathExistsResponse, error) { + klog.V(2).Infof("Request: PathExists with path=%q", request.Path) + err := ValidatePathWindows(request.Path) + if err != nil { + klog.Errorf("failed validatePathWindows %v", err) + return nil, err + } + exists, err := f.hostAPI.PathExists(request.Path) + if err != nil { + klog.Errorf("failed check PathExists %v", err) + return nil, err + } + return &PathExistsResponse{ + Exists: exists, + }, err +} + +func (f *Filesystem) PathValid(ctx context.Context, request *PathValidRequest) (*PathValidResponse, error) { + klog.V(2).Infof("Request: PathValid with path %q", request.Path) + valid, err := f.hostAPI.PathValid(request.Path) + return &PathValidResponse{ + Valid: valid, + }, err +} + +func (f *Filesystem) Mkdir(ctx context.Context, request *MkdirRequest) (*MkdirResponse, error) { + klog.V(2).Infof("Request: Mkdir with path=%q", request.Path) + err := ValidatePathWindows(request.Path) + if err != nil { + klog.Errorf("failed validatePathWindows %v", err) + return nil, err + } + err = f.hostAPI.Mkdir(request.Path) + if err != nil { + klog.Errorf("failed Mkdir %v", err) + return nil, err + } + + return &MkdirResponse{}, err +} + +func (f *Filesystem) Rmdir(ctx context.Context, request *RmdirRequest) (*RmdirResponse, error) { + klog.V(2).Infof("Request: Rmdir with path=%q", request.Path) + err := ValidatePathWindows(request.Path) + if err != nil { + klog.Errorf("failed validatePathWindows %v", err) + return nil, err + } + err = f.hostAPI.Rmdir(request.Path, request.Force) + if err != nil { + klog.Errorf("failed Rmdir %v", err) + return nil, err + } + return nil, err +} + +func (f *Filesystem) RmdirContents(ctx context.Context, request *RmdirContentsRequest) (*RmdirContentsResponse, error) { + klog.V(2).Infof("Request: RmdirContents with path=%q", request.Path) + err := ValidatePathWindows(request.Path) + if err != nil { + klog.Errorf("failed validatePathWindows %v", err) + return nil, err + } + err = f.hostAPI.RmdirContents(request.Path) + if err != nil { + klog.Errorf("failed RmdirContents %v", err) + return nil, err + } + return nil, err +} + +func (f *Filesystem) CreateSymlink(ctx context.Context, request *CreateSymlinkRequest) (*CreateSymlinkResponse, error) { + klog.V(2).Infof("Request: CreateSymlink with targetPath=%q sourcePath=%q", request.TargetPath, request.SourcePath) + err := ValidatePathWindows(request.TargetPath) + if err != nil { + klog.Errorf("failed validatePathWindows for target path %v", err) + return nil, err + } + err = ValidatePathWindows(request.SourcePath) + if err != nil { + klog.Errorf("failed validatePathWindows for source path %v", err) + return nil, err + } + err = f.hostAPI.CreateSymlink(request.SourcePath, request.TargetPath) + if err != nil { + klog.Errorf("failed CreateSymlink: %v", err) + return nil, err + } + return &CreateSymlinkResponse{}, nil +} + +func (f *Filesystem) IsSymlink(ctx context.Context, request *IsSymlinkRequest) (*IsSymlinkResponse, error) { + klog.V(2).Infof("Request: IsSymlink with path=%q", request.Path) + isSymlink, err := f.hostAPI.IsSymlink(request.Path) + if err != nil { + klog.Errorf("failed IsSymlink %v", err) + return nil, err + } + return &IsSymlinkResponse{ + IsSymlink: isSymlink, + }, nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi/hostapi.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi/hostapi.go new file mode 100644 index 000000000..d81777287 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi/hostapi.go @@ -0,0 +1,146 @@ +package api + +import ( + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/kubernetes-csi/csi-proxy/v2/pkg/utils" +) + +// Implements the Filesystem OS API calls. All code here should be very simple +// pass-through to the OS APIs. Any logic around the APIs should go in +// pkg/filesystem/filesystem.go so that logic can be easily unit-tested +// without requiring specific OS environments. + +// HostAPI is the exposed Filesystem API +type HostAPI interface { + PathExists(path string) (bool, error) + PathValid(path string) (bool, error) + Mkdir(path string) error + Rmdir(path string, force bool) error + RmdirContents(path string) error + CreateSymlink(oldname string, newname string) error + IsSymlink(path string) (bool, error) +} + +type filesystemAPI struct{} + +// check that filesystemAPI implements HostAPI +var _ HostAPI = &filesystemAPI{} + +func New() HostAPI { + return filesystemAPI{} +} + +func pathExists(path string) (bool, error) { + _, err := os.Lstat(path) + if err == nil { + return true, nil + } + if os.IsNotExist(err) { + return false, nil + } + return false, err +} + +func (filesystemAPI) PathExists(path string) (bool, error) { + return pathExists(path) +} + +func pathValid(path string) (bool, error) { + cmd := `Test-Path $Env:remotepath` + cmdEnv := fmt.Sprintf("remotepath=%s", path) + output, err := utils.RunPowershellCmd(cmd, cmdEnv) + if err != nil { + return false, fmt.Errorf("returned output: %s, error: %v", string(output), err) + } + + return strings.HasPrefix(strings.ToLower(string(output)), "true"), nil +} + +// PathValid determines whether all elements of a path exist +// +// https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-path?view=powershell-7 +// +// for a remote path, determines whether connection is ok +// +// e.g. in a SMB server connection, if password is changed, connection will be lost, this func will return false +func (filesystemAPI) PathValid(path string) (bool, error) { + return pathValid(path) +} + +// Mkdir makes a dir with `os.MkdirAll`. +func (filesystemAPI) Mkdir(path string) error { + return os.MkdirAll(path, 0755) +} + +// Rmdir removes a dir with `os.Remove`, if force is true then `os.RemoveAll` is used instead. +func (filesystemAPI) Rmdir(path string, force bool) error { + if force { + return os.RemoveAll(path) + } + return os.Remove(path) +} + +// RmdirContents removes the contents of a directory with `os.RemoveAll` +func (filesystemAPI) RmdirContents(path string) error { + dir, err := os.Open(path) + if err != nil { + return err + } + defer dir.Close() + + files, err := dir.Readdirnames(-1) + if err != nil { + return err + } + for _, file := range files { + candidatePath := filepath.Join(path, file) + err = os.RemoveAll(candidatePath) + if err != nil { + return err + } + } + + return nil +} + +// CreateSymlink creates newname as a symbolic link to oldname. +func (filesystemAPI) CreateSymlink(oldname, newname string) error { + return os.Symlink(oldname, newname) +} + +// IsSymlink - returns true if tgt is a mount point. +// A path is considered a mount point if: +// - directory exists and +// - it is a soft link and +// - the target path of the link exists. +// +// If tgt path does not exist, it returns an error +// if tgt path exists, but the source path tgt points to does not exist, it returns false without error. +func (filesystemAPI) IsSymlink(tgt string) (bool, error) { + // This code is similar to k8s.io/kubernetes/pkg/util/mount except the pathExists usage. + // Also in a remote call environment the os error cannot be passed directly back, hence the callers + // are expected to perform the isExists check before calling this call in CSI proxy. + stat, err := os.Lstat(tgt) + if err != nil { + return false, err + } + + // If its a link and it points to an existing file then its a mount point. + if stat.Mode()&os.ModeSymlink != 0 { + target, err := os.Readlink(tgt) + if err != nil { + return false, fmt.Errorf("readlink error: %v", err) + } + exists, err := pathExists(target) + if err != nil { + return false, err + } + return exists, nil + } + + return false, nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/types.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/types.go new file mode 100644 index 000000000..d1a0120f1 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/types.go @@ -0,0 +1,145 @@ +package filesystem + +type PathExistsRequest struct { + // The path whose existence we want to check in the host's filesystem + Path string +} + +type PathExistsResponse struct { + // Indicates whether the path in PathExistsRequest exists in the host's filesystem + Exists bool +} + +type PathValidRequest struct { + // The path whose validity we want to check in the host's filesystem + Path string +} + +type PathValidResponse struct { + // Indicates whether the path in PathValidRequest is a valid path + Valid bool +} + +type MkdirRequest struct { + // The path to create in the host's filesystem. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // Non-existent parent directories in the path will be automatically created. + // Directories will be created with Read and Write privileges of the Windows + // User account under which csi-proxy is started (typically LocalSystem). + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // Depending on the context parameter of this function, the path prefix needs + // to match the paths specified either as kubelet-csi-plugins-path + // or as kubelet-pod-path parameters of csi-proxy. + // The path parameter cannot already exist on host filesystem. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // Maximum path length will be capped to 260 characters. + Path string +} + +type MkdirResponse struct { + // Intentionally empty +} + +type RmdirRequest struct { + // The path to remove in the host's filesystem. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // Depending on the context parameter of this function, the path prefix needs + // to match the paths specified either as kubelet-csi-plugins-path + // or as kubelet-pod-path parameters of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // Path cannot be a file of type symlink. + // Maximum path length will be capped to 260 characters. + Path string + + // Force remove all contents under path (if any). + Force bool +} + +type RmdirResponse struct { + // Intentionally empty +} + +type RmdirContentsRequest struct { + // The path to remove in the host's filesystem. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // Depending on the context parameter of this function, the path prefix needs + // to match the paths specified either as kubelet-csi-plugins-path + // or as kubelet-pod-path parameters of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // Path cannot be a file of type symlink. + // Maximum path length will be capped to 260 characters. + Path string +} + +type RmdirContentsResponse struct { + // Intentionally empty +} + +type CreateSymlinkRequest struct { + // The path of the existing directory to be linked. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // The path prefix needs needs to match the paths specified as + // kubelet-csi-plugins-path parameter of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // source_path cannot already exist in the host filesystem. + // Maximum path length will be capped to 260 characters. + SourcePath string + + // Target path is the location of the new directory entry to be created in the host's filesystem. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // The path prefix needs to match the paths specified as + // kubelet-pod-path parameter of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // target_path needs to exist as a directory in the host that is empty. + // target_path cannot be a symbolic link. + // Maximum path length will be capped to 260 characters. + TargetPath string +} + +type CreateSymlinkResponse struct { + // Intentionally empty +} + +type IsSymlinkRequest struct { + // The path whose existence as a symlink we want to check in the host's filesystem + Path string +} + +type IsSymlinkResponse struct { + // Indicates whether the path in IsSymlinkRequest is a symlink + IsSymlink bool +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/utils.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/utils.go new file mode 100644 index 000000000..f1c96a8a2 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/utils.go @@ -0,0 +1,69 @@ +package filesystem + +import ( + "fmt" + "regexp" + "strings" + + "github.com/kubernetes-csi/csi-proxy/v2/pkg/utils" +) + +var invalidPathCharsRegexWindows = regexp.MustCompile(`["/\:\?\*|]`) +var absPathRegexWindows = regexp.MustCompile(`^[a-zA-Z]:\\`) + +func isUNCPathWindows(path string) bool { + // check for UNC/pipe prefixes like "\\" + if len(path) < 2 { + return false + } + if path[0] == '\\' && path[1] == '\\' { + return true + } + return false +} + +func isAbsWindows(path string) bool { + // for Windows check for C:\\.. prefix only + // UNC prefixes of the form \\ are not considered + // absolute in the context of CSI proxy + return absPathRegexWindows.MatchString(path) +} + +func containsInvalidCharactersWindows(path string) bool { + if isAbsWindows(path) { + path = path[3:] + } + if invalidPathCharsRegexWindows.MatchString(path) { + return true + } + if strings.Contains(path, `..`) { + return true + } + return false +} + +func ValidatePathWindows(path string) error { + pathlen := len(path) + + if pathlen > utils.MaxPathLengthWindows { + return fmt.Errorf("path length %d exceeds maximum characters: %d", pathlen, utils.MaxPathLengthWindows) + } + + if pathlen > 0 && (path[0] == '\\') { + return fmt.Errorf("invalid character \\ at beginning of path: %s", path) + } + + if isUNCPathWindows(path) { + return fmt.Errorf("unsupported UNC path prefix: %s", path) + } + + if containsInvalidCharactersWindows(path) { + return fmt.Errorf("path contains invalid characters: %s", path) + } + + if !isAbsWindows(path) { + return fmt.Errorf("not an absolute Windows path: %s", path) + } + + return nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/utils/utils.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/utils/utils.go new file mode 100644 index 000000000..ec9569584 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/utils/utils.go @@ -0,0 +1,20 @@ +package utils + +import ( + "fmt" + "os" + "os/exec" + + "k8s.io/klog/v2" +) + +const MaxPathLengthWindows = 260 + +func RunPowershellCmd(command string, envs ...string) ([]byte, error) { + command = fmt.Sprintf("$global:ProgressPreference = 'SilentlyContinue'; %s", command) + cmd := exec.Command("powershell", "-Mta", "-NoProfile", "-Command", command) + cmd.Env = append(os.Environ(), envs...) + klog.V(8).Infof("Executing command: %q", cmd.String()) + out, err := cmd.CombinedOutput() + return out, err +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi/hostapi.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi/hostapi.go new file mode 100644 index 000000000..1d9006c10 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi/hostapi.go @@ -0,0 +1,388 @@ +package api + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + + "github.com/kubernetes-csi/csi-proxy/v2/pkg/utils" + "k8s.io/klog/v2" +) + +// HostAPI exposes the internal volume operations available in the server +type HostAPI interface { + // ListVolumesOnDisk lists volumes on a disk identified by a `diskNumber` and optionally a partition identified by `partitionNumber`. + ListVolumesOnDisk(diskNumber uint32, partitionNumber uint32) (volumeIDs []string, err error) + // MountVolume mounts the volume at the requested global staging target path. + MountVolume(volumeID, targetPath string) error + // UnmountVolume gracefully dismounts a volume. + UnmountVolume(volumeID, targetPath string) error + // IsVolumeFormatted checks if a volume is formatted with NTFS. + IsVolumeFormatted(volumeID string) (bool, error) + // FormatVolume formats a volume with the NTFS format. + FormatVolume(volumeID string) error + // ResizeVolume performs resizing of the partition and file system for a block based volume. + ResizeVolume(volumeID string, sizeBytes int64) error + // GetVolumeStats gets the volume information. + GetVolumeStats(volumeID string) (int64, int64, error) + // GetDiskNumberFromVolumeID returns the disk number for a given volumeID. + GetDiskNumberFromVolumeID(volumeID string) (uint32, error) + // GetVolumeIDFromTargetPath returns the volume id of a given target path. + GetVolumeIDFromTargetPath(targetPath string) (string, error) + // WriteVolumeCache writes the volume `volumeID`'s cache to disk. + WriteVolumeCache(volumeID string) error + // GetVolumeIDFromTargetPath returns the volume id of a given target path. + GetClosestVolumeIDFromTargetPath(targetPath string) (string, error) +} + +// volumeAPI implements the internal Volume APIs +type volumeAPI struct{} + +// verifies that HostAPI is implemented +var _ HostAPI = &volumeAPI{} + +var ( + // VolumeRegexp matches a Windows Volume + // example: Volume{452e318a-5cde-421e-9831-b9853c521012} + // + // The field UniqueId has an additional prefix which is NOT included in the regex + // however the regex can match UniqueId too + // PS C:\disks> (Get-Disk -Number 1 | Get-Partition | Get-Volume).UniqueId + // \\?\Volume{452e318a-5cde-421e-9831-b9853c521012}\ + VolumeRegexp = regexp.MustCompile(`Volume\{[\w-]*\}`) +) + +// New - Construct a new Volume API Implementation. +func New() HostAPI { + return &volumeAPI{} +} + +func getVolumeSize(volumeID string) (int64, error) { + cmd := fmt.Sprintf("(Get-Volume -UniqueId \"%s\" | Get-partition).Size", volumeID) + out, err := utils.RunPowershellCmd(cmd) + + if err != nil || len(out) == 0 { + return -1, fmt.Errorf("error getting size of the partition from mount. cmd %s, output: %s, error: %v", cmd, string(out), err) + } + + outString := strings.TrimSpace(string(out)) + volumeSize, err := strconv.ParseInt(outString, 10, 64) + if err != nil { + return -1, fmt.Errorf("error parsing size of volume %s received %v trimmed to %v err %v", volumeID, out, outString, err) + } + + return volumeSize, nil +} + +// ListVolumesOnDisk - returns back list of volumes(volumeIDs) in a disk and a partition. +func (volumeAPI) ListVolumesOnDisk(diskNumber uint32, partitionNumber uint32) (volumeIDs []string, err error) { + var cmd string + if partitionNumber == 0 { + // 0 means that the partitionNumber wasn't set so we list all the partitions + cmd = fmt.Sprintf("(Get-Disk -Number %d | Get-Partition | Get-Volume).UniqueId", diskNumber) + } else { + cmd = fmt.Sprintf("(Get-Disk -Number %d | Get-Partition -PartitionNumber %d | Get-Volume).UniqueId", diskNumber, partitionNumber) + } + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return []string{}, fmt.Errorf("error list volumes on disk. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + volumeIds := strings.Split(strings.TrimSpace(string(out)), "\r\n") + return volumeIds, nil +} + +// FormatVolume - Formats a volume with the NTFS format. +func (volumeAPI) FormatVolume(volumeID string) (err error) { + cmd := fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Format-Volume -FileSystem ntfs -Confirm:$false", volumeID) + out, err := utils.RunPowershellCmd(cmd) + + if err != nil { + return fmt.Errorf("error formatting volume. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + // TODO: Do we need to handle anything for len(out) == 0 + return nil +} + +// WriteVolumeCache - Writes the file system cache to disk with the given volume id +func (volumeAPI) WriteVolumeCache(volumeID string) (err error) { + return writeCache(volumeID) +} + +// IsVolumeFormatted - Check if the volume is formatted with the pre specified filesystem(typically ntfs). +func (volumeAPI) IsVolumeFormatted(volumeID string) (bool, error) { + cmd := fmt.Sprintf("(Get-Volume -UniqueId \"%s\" -ErrorAction Stop).FileSystemType", volumeID) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return false, fmt.Errorf("error checking if volume is formatted. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + stringOut := strings.TrimSpace(string(out)) + if len(stringOut) == 0 || strings.EqualFold(stringOut, "Unknown") { + return false, nil + } + return true, nil +} + +// MountVolume - mounts a volume to a path. This is done using the Add-PartitionAccessPath for presenting the volume via a path. +func (volumeAPI) MountVolume(volumeID, path string) error { + cmd := fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Get-Partition | Add-PartitionAccessPath -AccessPath %s", volumeID, path) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error mount volume to path. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + return nil +} + +// UnmountVolume - unmounts the volume path by removing the partition access path +func (volumeAPI) UnmountVolume(volumeID, path string) error { + if err := writeCache(volumeID); err != nil { + return err + } + cmd := fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Get-Partition | Remove-PartitionAccessPath -AccessPath %s", volumeID, path) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error getting driver letter to mount volume. cmd: %s, output: %s,error: %v", cmd, string(out), err) + } + return nil +} + +// ResizeVolume - resizes a volume with the given size, if size == 0 then max supported size is used +func (volumeAPI) ResizeVolume(volumeID string, size int64) error { + // If size is 0 then we will resize to the maximum size possible, otherwise just resize to size + var cmd string + var out []byte + var err error + var finalSize int64 + var outString string + if size == 0 { + cmd = fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Get-partition | Get-PartitionSupportedSize | Select SizeMax | ConvertTo-Json", volumeID) + out, err = utils.RunPowershellCmd(cmd) + + if err != nil || len(out) == 0 { + return fmt.Errorf("error getting sizemin,sizemax from mount. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + var getVolumeSizing map[string]int64 + outString = string(out) + err = json.Unmarshal([]byte(outString), &getVolumeSizing) + if err != nil { + return fmt.Errorf("out %v outstring %v err %v", out, outString, err) + } + + sizeMax := getVolumeSizing["SizeMax"] + + finalSize = sizeMax + } else { + finalSize = size + } + + currentSize, err := getVolumeSize(volumeID) + if err != nil { + return fmt.Errorf("error getting the current size of volume (%s) with error (%v)", volumeID, err) + } + + //if the partition's size is already the size we want this is a noop, just return + if currentSize >= finalSize { + klog.V(2).Infof("Attempted to resize volume %s to a lower size, from currentBytes=%d wantedBytes=%d", volumeID, currentSize, finalSize) + return nil + } + + cmd = fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Get-Partition | Resize-Partition -Size %d", volumeID, finalSize) + out, err = utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error resizing volume. cmd: %s, output: %s size:%v, finalSize %v, error: %v", cmd, string(out), size, finalSize, err) + } + return nil +} + +// GetVolumeStats - retrieves the volume stats for a given volume +func (volumeAPI) GetVolumeStats(volumeID string) (int64, int64, error) { + // get the size and sizeRemaining for the volume + cmd := fmt.Sprintf("(Get-Volume -UniqueId \"%s\" | Select SizeRemaining,Size) | ConvertTo-Json", volumeID) + out, err := utils.RunPowershellCmd(cmd) + + if err != nil { + return -1, -1, fmt.Errorf("error getting capacity and used size of volume. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + var getVolume map[string]int64 + outString := string(out) + err = json.Unmarshal([]byte(outString), &getVolume) + if err != nil { + return -1, -1, fmt.Errorf("out %v outstring %v err %v", out, outString, err) + } + + volumeSize := getVolume["Size"] + volumeSizeRemaining := getVolume["SizeRemaining"] + + volumeUsedSize := volumeSize - volumeSizeRemaining + return volumeSize, volumeUsedSize, nil +} + +// GetDiskNumberFromVolumeID - gets the disk number where the volume is. +func (volumeAPI) GetDiskNumberFromVolumeID(volumeID string) (uint32, error) { + // get the size and sizeRemaining for the volume + cmd := fmt.Sprintf("(Get-Volume -UniqueId \"%s\" | Get-Partition).DiskNumber", volumeID) + out, err := utils.RunPowershellCmd(cmd) + + if err != nil || len(out) == 0 { + return 0, fmt.Errorf("error getting disk number. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + + reg, err := regexp.Compile("[^0-9]+") + if err != nil { + return 0, fmt.Errorf("error compiling regex. err: %v", err) + } + diskNumberOutput := reg.ReplaceAllString(string(out), "") + + diskNumber, err := strconv.ParseUint(diskNumberOutput, 10, 32) + + if err != nil { + return 0, fmt.Errorf("error parsing disk number. cmd: %s, output: %s, error: %v", cmd, diskNumberOutput, err) + } + + return uint32(diskNumber), nil +} + +// GetVolumeIDFromTargetPath - gets the volume ID given a mount point, the function is recursive until it find a volume or errors out +func (volumeAPI) GetVolumeIDFromTargetPath(mount string) (string, error) { + volumeString, err := getTarget(mount) + + if err != nil { + return "", fmt.Errorf("error getting the volume for the mount %s, internal error %v", mount, err) + } + + return volumeString, nil +} + +func getTarget(mount string) (string, error) { + cmd := fmt.Sprintf("(Get-Item -Path %s).Target", mount) + out, err := utils.RunPowershellCmd(cmd) + if err != nil || len(out) == 0 { + return "", fmt.Errorf("error getting volume from mount. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + volumeString := strings.TrimSpace(string(out)) + if !strings.HasPrefix(volumeString, "Volume") { + return getTarget(volumeString) + } + + return ensureVolumePrefix(volumeString), nil +} + +// GetVolumeIDFromTargetPath returns the volume id of a given target path. +func (volumeAPI) GetClosestVolumeIDFromTargetPath(targetPath string) (string, error) { + volumeString, err := findClosestVolume(targetPath) + + if err != nil { + return "", fmt.Errorf("error getting the closest volume for the path=%s, err=%v", targetPath, err) + } + + return volumeString, nil +} + +// findClosestVolume finds the closest volume id for a given target path +// by following symlinks and moving up in the filesystem, if after moving up in the filesystem +// we get to a DriveLetter then the volume corresponding to this drive letter is returned instead. +func findClosestVolume(path string) (string, error) { + candidatePath := path + + // Run in a bounded loop to avoid doing an infinite loop + // while trying to follow symlinks + // + // The maximum path length in Windows is 260, it could be possible to end + // up in a sceneario where we do more than 256 iterations (e.g. by following symlinks from + // a place high in the hierarchy to a nested sibling location many times) + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#:~:text=In%20editions%20of%20Windows%20before,required%20to%20remove%20the%20limit. + // + // The number of iterations is 256, which is similar to the number of iterations in filepath-securejoin + // https://github.com/cyphar/filepath-securejoin/blob/64536a8a66ae59588c981e2199f1dcf410508e07/join.go#L51 + for i := 0; i < 256; i++ { + fi, err := os.Lstat(candidatePath) + if err != nil { + return "", err + } + isSymlink := fi.Mode()&os.ModeSymlink != 0 + + if isSymlink { + target, err := dereferenceSymlink(candidatePath) + if err != nil { + return "", err + } + // if it has the form Volume{volumeid} then it's a volume + if VolumeRegexp.Match([]byte(target)) { + // symlinks that are pointing to Volumes don't have this prefix + return ensureVolumePrefix(target), nil + } + // otherwise follow the symlink + candidatePath = target + } else { + // if it's not a symlink move one level up + previousPath := candidatePath + candidatePath = filepath.Dir(candidatePath) + + // if the new path is the same as the previous path then we reached the root path + if previousPath == candidatePath { + // find the volume for the root path (assuming that it's a DriveLetter) + target, err := getVolumeForDriveLetter(candidatePath[0:1]) + if err != nil { + return "", err + } + return target, nil + } + } + + } + + return "", fmt.Errorf("Failed to find the closest volume for path=%s", path) +} + +// ensureVolumePrefix makes sure that the volume has the Volume prefix +func ensureVolumePrefix(volume string) string { + prefix := "\\\\?\\" + if !strings.HasPrefix(volume, prefix) { + volume = prefix + volume + } + return volume +} + +// dereferenceSymlink dereferences the symlink `path` and returns the stdout. +func dereferenceSymlink(path string) (string, error) { + cmd := fmt.Sprintf(`(Get-Item -Path %s).Target`, path) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return "", err + } + output := strings.TrimSpace(string(out)) + klog.V(8).Infof("Stdout: %s", output) + return output, nil +} + +// getVolumeForDriveLetter gets a volume from a drive letter (e.g. C:/). +func getVolumeForDriveLetter(path string) (string, error) { + if len(path) != 1 { + return "", fmt.Errorf("The path=%s is not a valid DriverLetter", path) + } + + cmd := fmt.Sprintf(`(Get-Partition -DriveLetter %s | Get-Volume).UniqueId`, path) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return "", err + } + output := strings.TrimSpace(string(out)) + klog.V(8).Infof("Stdout: %s", output) + return output, nil +} + +func writeCache(volumeID string) error { + cmd := fmt.Sprintf("Get-Volume -UniqueId \"%s\" | Write-Volumecache", volumeID) + out, err := utils.RunPowershellCmd(cmd) + if err != nil { + return fmt.Errorf("error writing volume cache. cmd: %s, output: %s, error: %v", cmd, string(out), err) + } + return nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/types.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/types.go new file mode 100644 index 000000000..78430be8b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/types.go @@ -0,0 +1,121 @@ +package volume + +type ListVolumesOnDiskRequest struct { + // Disk device number of the disk to query for volumes + DiskNumber uint32 + + // The partition number (optional), by default it uses the first partition of the disk + PartitionNumber uint32 +} + +type ListVolumesOnDiskResponse struct { + // Volume device IDs of volumes on the specified disk + VolumeIDs []string +} + +type MountVolumeRequest struct { + // Volume device ID of the volume to mount + VolumeID string + + // Path in the host's file system where the volume needs to be mounted + TargetPath string +} + +type MountVolumeResponse struct { + // Intentionally empty +} + +type IsVolumeFormattedRequest struct { + // Volume device ID of the volume to check + VolumeID string +} + +type IsVolumeFormattedResponse struct { + // Whether the volume is formatted with NTFS + Formatted bool +} + +type FormatVolumeRequest struct { + // Volume device ID of the volume to format + VolumeID string +} + +type FormatVolumeResponse struct { + // Intentionally empty +} + +type WriteVolumeCacheRequest struct { + // Volume device ID of the volume to flush the cache + VolumeID string +} + +type WriteVolumeCacheResponse struct { + // Intentionally empty +} + +type UnmountVolumeRequest struct { + // Volume device ID of the volume to dismount + VolumeID string + + // Path where the volume has been mounted + TargetPath string +} + +type UnmountVolumeResponse struct { + // Intentionally empty +} + +type ResizeVolumeRequest struct { + // Volume device ID of the volume to resize + VolumeID string + + // New size in bytes of the volume + SizeBytes int64 +} + +type ResizeVolumeResponse struct { + // Intentionally empty +} + +type GetVolumeStatsRequest struct { + // Volume device Id of the volume to get the stats for + VolumeID string +} + +type GetVolumeStatsResponse struct { + // Total bytes + TotalBytes int64 + + // Used bytes + UsedBytes int64 +} + +type GetDiskNumberFromVolumeIDRequest struct { + // Volume device ID of the volume to get the disk number for + VolumeID string +} + +type GetDiskNumberFromVolumeIDResponse struct { + // Corresponding disk number + DiskNumber uint32 +} + +type GetVolumeIDFromTargetPathRequest struct { + // The target path + TargetPath string +} + +type GetVolumeIDFromTargetPathResponse struct { + // The volume device ID + VolumeID string +} + +type GetClosestVolumeIDFromTargetPathRequest struct { + // The target path + TargetPath string +} + +type GetClosestVolumeIDFromTargetPathResponse struct { + // The volume device ID + VolumeID string +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/volume.go b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/volume.go new file mode 100644 index 000000000..dca8de1d9 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/volume.go @@ -0,0 +1,280 @@ +package volume + +import ( + "context" + "fmt" + + volumeapi "github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi" + "k8s.io/klog/v2" +) + +// Volume wraps the host API and implements the interface +type Volume struct { + hostAPI volumeapi.HostAPI +} + +type Interface interface { + // FormatVolume formats a volume with NTFS. + FormatVolume(context.Context, *FormatVolumeRequest) (*FormatVolumeResponse, error) + + // GetClosestVolumeIDFromTargetPath gets the closest volume id for a given target path + // by following symlinks and moving up in the filesystem, if after moving up in the filesystem + // we get to a DriveLetter then the volume corresponding to this drive letter is returned instead. + GetClosestVolumeIDFromTargetPath(context.Context, *GetClosestVolumeIDFromTargetPathRequest) (*GetClosestVolumeIDFromTargetPathResponse, error) + + // GetDiskNumberFromVolumeID gets the disk number of the disk where the volume is located. + GetDiskNumberFromVolumeID(context.Context, *GetDiskNumberFromVolumeIDRequest) (*GetDiskNumberFromVolumeIDResponse, error) + + // GetVolumeIDFromTargetPath gets the volume id for a given target path. + GetVolumeIDFromTargetPath(context.Context, *GetVolumeIDFromTargetPathRequest) (*GetVolumeIDFromTargetPathResponse, error) + + // GetVolumeStats gathers total bytes and used bytes for a volume. + GetVolumeStats(context.Context, *GetVolumeStatsRequest) (*GetVolumeStatsResponse, error) + + // IsVolumeFormatted checks if a volume is formatted. + IsVolumeFormatted(context.Context, *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) + + // ListVolumesOnDisk returns the volume IDs (in \\.\Volume{GUID} format) for all volumes from a + // given disk number and partition number (optional) + ListVolumesOnDisk(context.Context, *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) + + // MountVolume mounts the volume at the requested global staging path. + MountVolume(context.Context, *MountVolumeRequest) (*MountVolumeResponse, error) + + // ResizeVolume performs resizing of the partition and file system for a block based volume. + ResizeVolume(context.Context, *ResizeVolumeRequest) (*ResizeVolumeResponse, error) + + // UnmountVolume flushes data cache to disk and removes the global staging path. + UnmountVolume(context.Context, *UnmountVolumeRequest) (*UnmountVolumeResponse, error) + + // WriteVolumeCache write volume cache to disk. + WriteVolumeCache(context.Context, *WriteVolumeCacheRequest) (*WriteVolumeCacheResponse, error) +} + +var _ Interface = &Volume{} + +func New(hostAPI volumeapi.HostAPI) (*Volume, error) { + return &Volume{ + hostAPI: hostAPI, + }, nil +} + +func (v *Volume) ListVolumesOnDisk(context context.Context, request *ListVolumesOnDiskRequest) (*ListVolumesOnDiskResponse, error) { + klog.V(2).Infof("ListVolumesOnDisk: Request: %+v", request) + response := &ListVolumesOnDiskResponse{} + + volumeIDs, err := v.hostAPI.ListVolumesOnDisk(request.DiskNumber, request.PartitionNumber) + if err != nil { + klog.Errorf("failed ListVolumeOnDisk %v", err) + return response, err + } + + response.VolumeIDs = volumeIDs + return response, nil +} + +func (v *Volume) MountVolume(context context.Context, request *MountVolumeRequest) (*MountVolumeResponse, error) { + klog.V(2).Infof("MountVolume: Request: %+v", request) + response := &MountVolumeResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("MountVolumeRequest.VolumeID is empty") + } + targetPath := request.TargetPath + if targetPath == "" { + klog.Errorf("targetPath empty") + return response, fmt.Errorf("MountVolumeRequest.TargetPath is empty") + } + + err := v.hostAPI.MountVolume(volumeID, targetPath) + if err != nil { + klog.Errorf("failed MountVolume %v", err) + return response, err + } + return response, nil +} + +func (v *Volume) UnmountVolume(context context.Context, request *UnmountVolumeRequest) (*UnmountVolumeResponse, error) { + klog.V(2).Infof("UnmountVolume: Request: %+v", request) + response := &UnmountVolumeResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("volume id empty") + } + targetPath := request.TargetPath + if targetPath == "" { + klog.Errorf("target path empty") + return response, fmt.Errorf("target path empty") + } + err := v.hostAPI.UnmountVolume(volumeID, targetPath) + if err != nil { + klog.Errorf("failed UnmountVolume %v", err) + return response, err + } + return response, nil +} + +func (v *Volume) IsVolumeFormatted(context context.Context, request *IsVolumeFormattedRequest) (*IsVolumeFormattedResponse, error) { + klog.V(2).Infof("IsVolumeFormatted: Request: %+v", request) + response := &IsVolumeFormattedResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("volume id empty") + } + isFormatted, err := v.hostAPI.IsVolumeFormatted(volumeID) + if err != nil { + klog.Errorf("failed IsVolumeFormatted %v", err) + return response, err + } + klog.V(5).Infof("IsVolumeFormatted: return: %v", isFormatted) + response.Formatted = isFormatted + return response, nil +} + +func (v *Volume) FormatVolume(context context.Context, request *FormatVolumeRequest) (*FormatVolumeResponse, error) { + klog.V(2).Infof("FormatVolume: Request: %+v", request) + response := &FormatVolumeResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("volume id empty") + } + + err := v.hostAPI.FormatVolume(volumeID) + if err != nil { + klog.Errorf("failed FormatVolume %v", err) + return response, err + } + return response, nil +} + +func (v *Volume) WriteVolumeCache(context context.Context, request *WriteVolumeCacheRequest) (*WriteVolumeCacheResponse, error) { + klog.V(2).Infof("WriteVolumeCache: Request: %+v", request) + response := &WriteVolumeCacheResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("volume id empty") + } + + err := v.hostAPI.WriteVolumeCache(volumeID) + if err != nil { + klog.Errorf("failed WriteVolumeCache %v", err) + return response, err + } + return response, nil +} + +func (v *Volume) ResizeVolume(context context.Context, request *ResizeVolumeRequest) (*ResizeVolumeResponse, error) { + klog.V(2).Infof("ResizeVolume: Request: %+v", request) + response := &ResizeVolumeResponse{} + + volumeID := request.VolumeID + if volumeID == "" { + klog.Errorf("volume id empty") + return response, fmt.Errorf("volume id empty") + } + sizeBytes := request.SizeBytes + // TODO : Validate size param + + err := v.hostAPI.ResizeVolume(volumeID, sizeBytes) + if err != nil { + klog.Errorf("failed ResizeVolume %v", err) + return response, err + } + return response, nil +} + +func (v *Volume) GetVolumeStats(context context.Context, request *GetVolumeStatsRequest) (*GetVolumeStatsResponse, error) { + klog.V(2).Infof("GetVolumeStats: Request: %+v", request) + volumeID := request.VolumeID + if volumeID == "" { + return nil, fmt.Errorf("volume id empty") + } + + totalBytes, usedBytes, err := v.hostAPI.GetVolumeStats(volumeID) + if err != nil { + klog.Errorf("failed GetVolumeStats %v", err) + return nil, err + } + + klog.V(2).Infof("VolumeStats: returned: Capacity %v Used %v", totalBytes, usedBytes) + + response := &GetVolumeStatsResponse{ + TotalBytes: totalBytes, + UsedBytes: usedBytes, + } + + return response, nil +} + +func (v *Volume) GetDiskNumberFromVolumeID(context context.Context, request *GetDiskNumberFromVolumeIDRequest) (*GetDiskNumberFromVolumeIDResponse, error) { + klog.V(2).Infof("GetDiskNumberFromVolumeID: Request: %+v", request) + + volumeID := request.VolumeID + if volumeID == "" { + return nil, fmt.Errorf("volume id empty") + } + + diskNumber, err := v.hostAPI.GetDiskNumberFromVolumeID(volumeID) + if err != nil { + klog.Errorf("failed GetDiskNumberFromVolumeID %v", err) + return nil, err + } + + response := &GetDiskNumberFromVolumeIDResponse{ + DiskNumber: diskNumber, + } + + return response, nil +} + +func (v *Volume) GetVolumeIDFromTargetPath(context context.Context, request *GetVolumeIDFromTargetPathRequest) (*GetVolumeIDFromTargetPathResponse, error) { + klog.V(2).Infof("GetVolumeIDFromTargetPath: Request: %+v", request) + + targetPath := request.TargetPath + if targetPath == "" { + return nil, fmt.Errorf("target path is empty") + } + + volume, err := v.hostAPI.GetVolumeIDFromTargetPath(targetPath) + if err != nil { + klog.Errorf("failed GetVolumeIDFromTargetPath: %v", err) + return nil, err + } + + response := &GetVolumeIDFromTargetPathResponse{ + VolumeID: volume, + } + + return response, nil +} + +func (v *Volume) GetClosestVolumeIDFromTargetPath(context context.Context, request *GetClosestVolumeIDFromTargetPathRequest) (*GetClosestVolumeIDFromTargetPathResponse, error) { + klog.V(2).Infof("GetClosestVolumeIDFromTargetPath: Request: %+v", request) + + targetPath := request.TargetPath + if targetPath == "" { + return nil, fmt.Errorf("target path is empty") + } + + volume, err := v.hostAPI.GetClosestVolumeIDFromTargetPath(targetPath) + if err != nil { + klog.Errorf("failed GetClosestVolumeIDFromTargetPath: %v", err) + return nil, err + } + + response := &GetClosestVolumeIDFromTargetPathResponse{ + VolumeID: volume, + } + + return response, nil +} diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore deleted file mode 100644 index daf913b1b..000000000 --- a/vendor/github.com/pkg/errors/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml deleted file mode 100644 index 9159de03e..000000000 --- a/vendor/github.com/pkg/errors/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go_import_path: github.com/pkg/errors -go: - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -script: - - make check diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE deleted file mode 100644 index 835ba3e75..000000000 --- a/vendor/github.com/pkg/errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/Makefile b/vendor/github.com/pkg/errors/Makefile deleted file mode 100644 index ce9d7cded..000000000 --- a/vendor/github.com/pkg/errors/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -PKGS := github.com/pkg/errors -SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) -GO := go - -check: test vet gofmt misspell unconvert staticcheck ineffassign unparam - -test: - $(GO) test $(PKGS) - -vet: | test - $(GO) vet $(PKGS) - -staticcheck: - $(GO) get honnef.co/go/tools/cmd/staticcheck - staticcheck -checks all $(PKGS) - -misspell: - $(GO) get github.com/client9/misspell/cmd/misspell - misspell \ - -locale GB \ - -error \ - *.md *.go - -unconvert: - $(GO) get github.com/mdempsky/unconvert - unconvert -v $(PKGS) - -ineffassign: - $(GO) get github.com/gordonklaus/ineffassign - find $(SRCDIRS) -name '*.go' | xargs ineffassign - -pedantic: check errcheck - -unparam: - $(GO) get mvdan.cc/unparam - unparam ./... - -errcheck: - $(GO) get github.com/kisielk/errcheck - errcheck $(PKGS) - -gofmt: - @echo Checking code is gofmted - @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md deleted file mode 100644 index 54dfdcb12..000000000 --- a/vendor/github.com/pkg/errors/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge) - -Package errors provides simple error handling primitives. - -`go get github.com/pkg/errors` - -The traditional error handling idiom in Go is roughly akin to -```go -if err != nil { - return err -} -``` -which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. - -## Adding context to an error - -The errors.Wrap function returns a new error that adds context to the original error. For example -```go -_, err := ioutil.ReadAll(r) -if err != nil { - return errors.Wrap(err, "read failed") -} -``` -## Retrieving the cause of an error - -Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. -```go -type causer interface { - Cause() error -} -``` -`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: -```go -switch err := errors.Cause(err).(type) { -case *MyError: - // handle specifically -default: - // unknown error -} -``` - -[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). - -## Roadmap - -With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows: - -- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible) -- 1.0. Final release. - -## Contributing - -Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. - -Before sending a PR, please discuss your change by raising an issue. - -## License - -BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml deleted file mode 100644 index a932eade0..000000000 --- a/vendor/github.com/pkg/errors/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\pkg\errors -shallow_clone: true # for startup speed - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -# http://www.appveyor.com/docs/installed-software -install: - # some helpful output for debugging builds - - go version - - go env - # pre-installed MinGW at C:\MinGW is 32bit only - # but MSYS2 at C:\msys64 has mingw64 - - set PATH=C:\msys64\mingw64\bin;%PATH% - - gcc --version - - g++ --version - -build_script: - - go install -v ./... - -test_script: - - set PATH=C:\gopath\bin;%PATH% - - go test -v ./... - -#artifacts: -# - path: '%GOPATH%\bin\*.exe' -deploy: off diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go deleted file mode 100644 index 161aea258..000000000 --- a/vendor/github.com/pkg/errors/errors.go +++ /dev/null @@ -1,288 +0,0 @@ -// Package errors provides simple error handling primitives. -// -// The traditional error handling idiom in Go is roughly akin to -// -// if err != nil { -// return err -// } -// -// which when applied recursively up the call stack results in error reports -// without context or debugging information. The errors package allows -// programmers to add context to the failure path in their code in a way -// that does not destroy the original value of the error. -// -// Adding context to an error -// -// The errors.Wrap function returns a new error that adds context to the -// original error by recording a stack trace at the point Wrap is called, -// together with the supplied message. For example -// -// _, err := ioutil.ReadAll(r) -// if err != nil { -// return errors.Wrap(err, "read failed") -// } -// -// If additional control is required, the errors.WithStack and -// errors.WithMessage functions destructure errors.Wrap into its component -// operations: annotating an error with a stack trace and with a message, -// respectively. -// -// Retrieving the cause of an error -// -// Using errors.Wrap constructs a stack of errors, adding context to the -// preceding error. Depending on the nature of the error it may be necessary -// to reverse the operation of errors.Wrap to retrieve the original error -// for inspection. Any error value which implements this interface -// -// type causer interface { -// Cause() error -// } -// -// can be inspected by errors.Cause. errors.Cause will recursively retrieve -// the topmost error that does not implement causer, which is assumed to be -// the original cause. For example: -// -// switch err := errors.Cause(err).(type) { -// case *MyError: -// // handle specifically -// default: -// // unknown error -// } -// -// Although the causer interface is not exported by this package, it is -// considered a part of its stable public interface. -// -// Formatted printing of errors -// -// All error values returned from this package implement fmt.Formatter and can -// be formatted by the fmt package. The following verbs are supported: -// -// %s print the error. If the error has a Cause it will be -// printed recursively. -// %v see %s -// %+v extended format. Each Frame of the error's StackTrace will -// be printed in detail. -// -// Retrieving the stack trace of an error or wrapper -// -// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are -// invoked. This information can be retrieved with the following interface: -// -// type stackTracer interface { -// StackTrace() errors.StackTrace -// } -// -// The returned errors.StackTrace type is defined as -// -// type StackTrace []Frame -// -// The Frame type represents a call site in the stack trace. Frame supports -// the fmt.Formatter interface that can be used for printing information about -// the stack trace of this error. For example: -// -// if err, ok := err.(stackTracer); ok { -// for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d\n", f, f) -// } -// } -// -// Although the stackTracer interface is not exported by this package, it is -// considered a part of its stable public interface. -// -// See the documentation for Frame.Format for more details. -package errors - -import ( - "fmt" - "io" -) - -// New returns an error with the supplied message. -// New also records the stack trace at the point it was called. -func New(message string) error { - return &fundamental{ - msg: message, - stack: callers(), - } -} - -// Errorf formats according to a format specifier and returns the string -// as a value that satisfies error. -// Errorf also records the stack trace at the point it was called. -func Errorf(format string, args ...interface{}) error { - return &fundamental{ - msg: fmt.Sprintf(format, args...), - stack: callers(), - } -} - -// fundamental is an error that has a message and a stack, but no caller. -type fundamental struct { - msg string - *stack -} - -func (f *fundamental) Error() string { return f.msg } - -func (f *fundamental) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - io.WriteString(s, f.msg) - f.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, f.msg) - case 'q': - fmt.Fprintf(s, "%q", f.msg) - } -} - -// WithStack annotates err with a stack trace at the point WithStack was called. -// If err is nil, WithStack returns nil. -func WithStack(err error) error { - if err == nil { - return nil - } - return &withStack{ - err, - callers(), - } -} - -type withStack struct { - error - *stack -} - -func (w *withStack) Cause() error { return w.error } - -// Unwrap provides compatibility for Go 1.13 error chains. -func (w *withStack) Unwrap() error { return w.error } - -func (w *withStack) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v", w.Cause()) - w.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, w.Error()) - case 'q': - fmt.Fprintf(s, "%q", w.Error()) - } -} - -// Wrap returns an error annotating err with a stack trace -// at the point Wrap is called, and the supplied message. -// If err is nil, Wrap returns nil. -func Wrap(err error, message string) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: message, - } - return &withStack{ - err, - callers(), - } -} - -// Wrapf returns an error annotating err with a stack trace -// at the point Wrapf is called, and the format specifier. -// If err is nil, Wrapf returns nil. -func Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } - return &withStack{ - err, - callers(), - } -} - -// WithMessage annotates err with a new message. -// If err is nil, WithMessage returns nil. -func WithMessage(err error, message string) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: message, - } -} - -// WithMessagef annotates err with the format specifier. -// If err is nil, WithMessagef returns nil. -func WithMessagef(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } -} - -type withMessage struct { - cause error - msg string -} - -func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } -func (w *withMessage) Cause() error { return w.cause } - -// Unwrap provides compatibility for Go 1.13 error chains. -func (w *withMessage) Unwrap() error { return w.cause } - -func (w *withMessage) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v\n", w.Cause()) - io.WriteString(s, w.msg) - return - } - fallthrough - case 's', 'q': - io.WriteString(s, w.Error()) - } -} - -// Cause returns the underlying cause of the error, if possible. -// An error value has a cause if it implements the following -// interface: -// -// type causer interface { -// Cause() error -// } -// -// If the error does not implement Cause, the original error will -// be returned. If the error is nil, nil will be returned without further -// investigation. -func Cause(err error) error { - type causer interface { - Cause() error - } - - for err != nil { - cause, ok := err.(causer) - if !ok { - break - } - err = cause.Cause() - } - return err -} diff --git a/vendor/github.com/pkg/errors/go113.go b/vendor/github.com/pkg/errors/go113.go deleted file mode 100644 index be0d10d0c..000000000 --- a/vendor/github.com/pkg/errors/go113.go +++ /dev/null @@ -1,38 +0,0 @@ -// +build go1.13 - -package errors - -import ( - stderrors "errors" -) - -// Is reports whether any error in err's chain matches target. -// -// The chain consists of err itself followed by the sequence of errors obtained by -// repeatedly calling Unwrap. -// -// An error is considered to match a target if it is equal to that target or if -// it implements a method Is(error) bool such that Is(target) returns true. -func Is(err, target error) bool { return stderrors.Is(err, target) } - -// As finds the first error in err's chain that matches target, and if so, sets -// target to that error value and returns true. -// -// The chain consists of err itself followed by the sequence of errors obtained by -// repeatedly calling Unwrap. -// -// An error matches target if the error's concrete value is assignable to the value -// pointed to by target, or if the error has a method As(interface{}) bool such that -// As(target) returns true. In the latter case, the As method is responsible for -// setting target. -// -// As will panic if target is not a non-nil pointer to either a type that implements -// error, or to any interface type. As returns false if err is nil. -func As(err error, target interface{}) bool { return stderrors.As(err, target) } - -// Unwrap returns the result of calling the Unwrap method on err, if err's -// type contains an Unwrap method returning error. -// Otherwise, Unwrap returns nil. -func Unwrap(err error) error { - return stderrors.Unwrap(err) -} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go deleted file mode 100644 index 779a8348f..000000000 --- a/vendor/github.com/pkg/errors/stack.go +++ /dev/null @@ -1,177 +0,0 @@ -package errors - -import ( - "fmt" - "io" - "path" - "runtime" - "strconv" - "strings" -) - -// Frame represents a program counter inside a stack frame. -// For historical reasons if Frame is interpreted as a uintptr -// its value represents the program counter + 1. -type Frame uintptr - -// pc returns the program counter for this frame; -// multiple frames may have the same PC value. -func (f Frame) pc() uintptr { return uintptr(f) - 1 } - -// file returns the full path to the file that contains the -// function for this Frame's pc. -func (f Frame) file() string { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return "unknown" - } - file, _ := fn.FileLine(f.pc()) - return file -} - -// line returns the line number of source code of the -// function for this Frame's pc. -func (f Frame) line() int { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return 0 - } - _, line := fn.FileLine(f.pc()) - return line -} - -// name returns the name of this function, if known. -func (f Frame) name() string { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return "unknown" - } - return fn.Name() -} - -// Format formats the frame according to the fmt.Formatter interface. -// -// %s source file -// %d source line -// %n function name -// %v equivalent to %s:%d -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+s function name and path of source file relative to the compile time -// GOPATH separated by \n\t (\n\t) -// %+v equivalent to %+s:%d -func (f Frame) Format(s fmt.State, verb rune) { - switch verb { - case 's': - switch { - case s.Flag('+'): - io.WriteString(s, f.name()) - io.WriteString(s, "\n\t") - io.WriteString(s, f.file()) - default: - io.WriteString(s, path.Base(f.file())) - } - case 'd': - io.WriteString(s, strconv.Itoa(f.line())) - case 'n': - io.WriteString(s, funcname(f.name())) - case 'v': - f.Format(s, 's') - io.WriteString(s, ":") - f.Format(s, 'd') - } -} - -// MarshalText formats a stacktrace Frame as a text string. The output is the -// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. -func (f Frame) MarshalText() ([]byte, error) { - name := f.name() - if name == "unknown" { - return []byte(name), nil - } - return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil -} - -// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). -type StackTrace []Frame - -// Format formats the stack of Frames according to the fmt.Formatter interface. -// -// %s lists source files for each Frame in the stack -// %v lists the source file and line number for each Frame in the stack -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+v Prints filename, function, and line number for each Frame in the stack. -func (st StackTrace) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case s.Flag('+'): - for _, f := range st { - io.WriteString(s, "\n") - f.Format(s, verb) - } - case s.Flag('#'): - fmt.Fprintf(s, "%#v", []Frame(st)) - default: - st.formatSlice(s, verb) - } - case 's': - st.formatSlice(s, verb) - } -} - -// formatSlice will format this StackTrace into the given buffer as a slice of -// Frame, only valid when called with '%s' or '%v'. -func (st StackTrace) formatSlice(s fmt.State, verb rune) { - io.WriteString(s, "[") - for i, f := range st { - if i > 0 { - io.WriteString(s, " ") - } - f.Format(s, verb) - } - io.WriteString(s, "]") -} - -// stack represents a stack of program counters. -type stack []uintptr - -func (s *stack) Format(st fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case st.Flag('+'): - for _, pc := range *s { - f := Frame(pc) - fmt.Fprintf(st, "\n%+v", f) - } - } - } -} - -func (s *stack) StackTrace() StackTrace { - f := make([]Frame, len(*s)) - for i := 0; i < len(f); i++ { - f[i] = Frame((*s)[i]) - } - return f -} - -func callers() *stack { - const depth = 32 - var pcs [depth]uintptr - n := runtime.Callers(3, pcs[:]) - var st stack = pcs[0:n] - return &st -} - -// funcname removes the path prefix component of a function's name reported by func.Name(). -func funcname(name string) string { - i := strings.LastIndex(name, "/") - name = name[i+1:] - i = strings.Index(name, ".") - return name[i+1:] -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 3b1dce51a..3870e4dad 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,10 +14,6 @@ cloud.google.com/go/kms/internal # github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0 ## explicit; go 1.13 github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta -# github.com/Microsoft/go-winio v0.4.17 -## explicit; go 1.12 -github.com/Microsoft/go-winio -github.com/Microsoft/go-winio/pkg/guid # github.com/PuerkitoBio/purell v1.1.1 ## explicit github.com/PuerkitoBio/purell @@ -121,22 +117,15 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-proxy/client v1.1.1 +# github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.0 ## explicit; go 1.16 -github.com/kubernetes-csi/csi-proxy/client -github.com/kubernetes-csi/csi-proxy/client/api/disk/v1 -github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2 -github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1 -github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1 -github.com/kubernetes-csi/csi-proxy/client/api/volume/v1 -github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1 -github.com/kubernetes-csi/csi-proxy/client/apiversion -github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1 -github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2 -github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1 -github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1 -github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1 -github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1 +github.com/kubernetes-csi/csi-proxy/v2/pkg/disk +github.com/kubernetes-csi/csi-proxy/v2/pkg/disk/hostapi +github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem +github.com/kubernetes-csi/csi-proxy/v2/pkg/filesystem/hostapi +github.com/kubernetes-csi/csi-proxy/v2/pkg/utils +github.com/kubernetes-csi/csi-proxy/v2/pkg/volume +github.com/kubernetes-csi/csi-proxy/v2/pkg/volume/hostapi # github.com/kubernetes-csi/csi-test/v4 v4.4.0 ## explicit; go 1.16 github.com/kubernetes-csi/csi-test/v4/pkg/sanity @@ -199,9 +188,6 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/pkg/errors v0.9.1 -## explicit -github.com/pkg/errors # github.com/prometheus/client_golang v1.12.1 ## explicit; go 1.13 github.com/prometheus/client_golang/prometheus